Repository navigation
Ophyd definition - #36
Draft
MTakahashi-KWH wants to merge 10 commits into
Draft
MTakahashi-KWH wants to merge 10 commits into
MTakahashi-KWH wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Critical packaging and import errors prevent installed devices from loading, while detector staging and trigger defects can direct writes to the wrong path or leave acquisitions waiting indefinitely.
16 open issues
These are absolute imports of top-levelarea_detectorsandbeam_monitorsmodules, but the… · New The newchxtools/ophyddirectory has no__init__.py, butsetup.py:22discovers packages with… · Newprosilica.pydefines theProsilicafactory, but neitherStandardProsilicaV33nor… · New The parent stage call stages the file plugin, whosestage()immediately uses… · New The in-progress guard checks_set_st, but the newly created status is never assigned to it. A… · New This import overwrites the synchronousophyd.Deviceimported above; the later async… · New Both status components point to the samePos-StsPV. In every stable state their values are… · Newtrigger()andkickoff()subscribe after firing the pipeline, so a fast state transition can be… · Newttime.timeis a function and has nosleepattribute. Every manual-detector unstage raises… · New These are instantiated signals stored on the class rather than Ophyd Components. They are shared by… · Newpos.sample_holderis the numeric coordinate in aPseudoPosition, not a positioner object, so… · Newarr2wordis not defined onLinkamThermalor itsDevicebase. Consequently, accessing… · New These three*_setpositionattributes do not exist; the declared components are named… · Newset_vol_unit()andset_rate_unit()(lines 75–79) only read the selectors and accept no unit… · New This callsstage()again on an already-staged detector instead of cleaning it up. It also clears… · New The Pixi environment no longer installseiger-io, althoughchxtools/handlers.py:6-10still… · New
What changed in this PR
This PR brings beamline device definitions from the profile collection into chxtools, consolidates shared detector code, and begins supporting asynchronous Ophyd devices.
Changes:
- Adds devices for detectors, optics, shutters, sample stages, pumps, and beam monitors.
- Shares detector plugins and path utilities, with synchronous and asynchronous Timepix implementations.
- Updates dependencies and adds a device registry.
| File | Description |
|---|---|
requirements.txt |
Comments out databroker and removes eiger-io. |
requirements_backup.txt |
Removes eiger-io. |
pixi.toml |
Updates shared dependencies and environment configuration. |
chxtools/ophyd/tpx_pipe.py |
Adds Timepix pipeline acquisition control. |
chxtools/ophyd/syringe.py |
Adds syringe pump controls. |
chxtools/ophyd/shutters.py |
Adds shutter device definitions. |
chxtools/ophyd/sample_stages.py |
Adds thermal and tensile stage controls. |
chxtools/ophyd/sample_positioners.py |
Adds sample motors and coordinated positioning. |
chxtools/ophyd/optics.py |
Adds beamline optics and positioning devices. |
chxtools/ophyd/insertion_device.py |
Adds undulator gap and brake control. |
chxtools/ophyd/beam_monitors.py |
Adds beam monitoring and feedback controls. |
chxtools/ophyd/area_detectors/xpress3.py |
Adds Xspress3 and Zebra timing devices. |
chxtools/ophyd/area_detectors/utils.py |
Adds shared path mappings and signal utilities. |
chxtools/ophyd/area_detectors/timepix.py |
Adds synchronous and asynchronous Timepix support. |
chxtools/ophyd/area_detectors/prosilica.py |
Adds a configurable camera factory. |
chxtools/ophyd/area_detectors/plugins.py |
Adds shared TIFF plugins. |
chxtools/ophyd/area_detectors/pilatus.py |
Adds Pilatus detector configurations. |
chxtools/ophyd/area_detectors/eiger.py |
Adds Eiger triggering, file handling, and plugin controls. |
chxtools/ophyd/area_detectors/__init__.py |
Exports detector interfaces. |
chxtools/ophyd/_devices.py |
Adds device descriptors and a registry. |
Review effort: Balanced
| @@ -0,0 +1,13 @@ | |||
| from .eiger import EigerFastTrigger, EigerManualTrigger, EigerSingleTrigger | |||
Comment on lines
+2
to
+13
| from .prosilica import StandardProsilicaV33, StandardProsilicaWithTIFFV33, Prosilica | ||
| from .timepix import TimePixDetector | ||
|
|
||
| __all__ = [ | ||
| "EigerFastTrigger", | ||
| "EigerManualTrigger", | ||
| "EigerSingleTrigger", | ||
| "Prosilica", | ||
| "StandardProsilicaV33", | ||
| "StandardProsilicaWithTIFFV33", | ||
| "TimePixDetector" | ||
| ] No newline at end of file |
Comment on lines
+129
to
+136
| def stage(self, *args, **kwargs): | ||
| # before parent | ||
| ret = super().stage(*args, **kwargs) | ||
| # after parent | ||
| self.manual_trigger.set(1).wait() | ||
| self.file.write_path_template = self.assets_path() + f'{name_dir_mapping[self.name]}/%Y/%m/%d/' | ||
| self.file.reg_root = self.assets_path() + f'{name_dir_mapping[self.name]}' | ||
| return ret |
| raise RuntimeError(f'trying to set {self.name}' | ||
| ' while a set is in progress') | ||
|
|
||
| st = StatusBase() |
Comment on lines
+110
to
+112
| @property | ||
| def serial(self): | ||
| return self.arr2word(self.serial_array.get()) |
Comment on lines
+496
to
+498
| text += f"\nCurrent distance = {self.distance.get():1f}, setpoint={self.distance_setposition.get():1f}\n\n" | ||
| text += f"\nCurrent velocity = {self.velocity.get():1f}, setpoint={self.velocity_setposition.get():1f}\n\n" | ||
| text += f"\nCurrent force = {self.force.get():1f}, setpoint={self.force_setposition.get():1f}\n\n" |
Comment on lines
+63
to
+79
| def set_vol_unit( self, pump =1 ): | ||
| if pump==1: | ||
| return self.vol_unit_sp.p1.value | ||
| else: | ||
| return self.vol_unit_sp.p2.value | ||
|
|
||
| def get_rate_unit( self, pump =1 ): | ||
| if pump==1: | ||
| return self.rate_unit_rb.p1.value | ||
| else: | ||
| return self.rate_unit_rb.p2.value | ||
|
|
||
| def set_rate_unit( self, pump =1 ): | ||
| if pump==1: | ||
| return self.rate_unit_sp.p1.value | ||
| else: | ||
| return self.rate_unit_sp.p2.value |
| eiger-io = "*" | ||
| nslsii = "*"#"==0.11.8" | ||
| #databroker = "==2.0.0b68" | ||
| #eiger-io = "*" |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


added many of the ophyd devices from profile collection and reduced some of the code duplication. Work to be done on shifting to ophyd async devices.