Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt hardware objects from mocked beamline to YAML #998

Merged
merged 9 commits into from
Aug 28, 2024

Conversation

elmjag
Copy link
Contributor

@elmjag elmjag commented Aug 26, 2024

This makes the required changes to the hardware objects used by mocked beamline to work with YAML config files.

With this changes, it's possible to start the mocked beamline using YAML config files.

Note, this PR depends on code changes in these PRs: #997 and #996.

I have used YAML config files from this PR: mxcube/mxcubeweb#1358

@elmjag elmjag added the YAML Work on supporting YAML configuration files. label Aug 26, 2024
Copy link
Collaborator

@rhfogh rhfogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to a quick glance

Add a 'acquisition_limit_values' proxy attribute to the Beamline
HWOBJ. This way the limits can be accessed with:

   HWR.beamline.acquisition_limit_values

This is how MXCuBE-web reads the limits. Let's support this style
for a while, for backward compability reason.
Update AbstractDetector class to access it's 'beam' setting with
get_property().

Replaces self["beam"] expression, as it does not work when YAML
config file is used.
Change code implementing Beam and Slits HWOBJs to work both with
YAML and XML configure files.

Add 'name' named attribute to __init__(), as it's required when
loading from YAML.

Renamed '_aperture' and '_slits' attributes to 'aperture' and
'slits', as this is the new style for attaching sub-HWOBJs. Added
a backward compability hack, so that 'aperture' and 'slits' get
populated when loading from XML configure file.
Drop proxy attributes 'kappa' and 'kappa_phi' from
GenericDiffractometer class. These interfere with attaching of
sub-HWOBJs for diffractometer HWOBJ.

Add named parameter 'name' to DiffractometerMockup.__init__().
This parameter is required when loading HWOBJ from YAML
configuration file.
Make it possible to create SampleChangerMockup and
AbstractSampleChanger derived HWOBJs with ClassName(name=foo)
expressions. This is the expression used when loading from a
YAML configuration file.
The 'camera' attribute is now automagically set from the 'objects'
settings in YAML/XML configure file.
The 'image_name' configuration property is not available in
_init() method.

Move set-up of 'static' attributes into __init__() method.

Move set-up that requires access to configuration properties into
init() method.
Make it possible to create BeamlineActions derived HWOBJs with
ClassName(name=foo)  expressions. This is the expression used when
loading from a YAML configuration file.
When loading DetectorMockup hardware object from YAML
configuration file, you'll get a warning if there is no
'detector_distance' attribute.
@elmjag elmjag merged commit 2987c68 into mxcube:xml_yaml_conversion Aug 28, 2024
2 of 7 checks passed
@elmjag elmjag deleted the adapt-hwobjs-to-yaml branch August 28, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YAML Work on supporting YAML configuration files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants