Skip to content

Ophyd definition - #36

Draft
MTakahashi-KWH wants to merge 10 commits into
mainfrom
ophyd_definition
Draft

MTakahashi-KWH wants to merge 10 commits into
mainfrom
ophyd_definition

Conversation

@MTakahashi-KWH

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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
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

Comment thread chxtools/ophyd/_devices.py Resolved
@@ -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 thread chxtools/ophyd/sample_stages.py Outdated
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 thread chxtools/ophyd/syringe.py
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
Comment thread chxtools/ophyd/tpx_pipe.py Resolved
Comment thread pixi.toml
eiger-io = "*"
nslsii = "*"#"==0.11.8"
#databroker = "==2.0.0b68"
#eiger-io = "*"
MTakahashi-KWH and others added 2 commits October 28, 2026 10:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants