v0.11
Notable changes
Child signals named on attach to device
Previously the naming of child signals was inconsistent between those named by passing name in __init__, and those named after the fact using set_name via init_devices or something similar. Now child devices are now named when they are attached to a parent, which means that the super order in __init__ doesn't matter from the perspective of naming. For example:
class Base(Device):
def __init__(self, name: str = ""):
self.sig1 = soft_signal_rw(float)
super().__init__(name=name)
class Derived1(Base):
def __init__(self, name: str = ""):
self.sig2 = soft_signal_rw(float)
super().__init__(name=name)
class Derived2(Base):
def __init__(self, name: str = ""):
super().__init__(name=name)
self.sig2 = soft_signal_rw(float)Previously:
-If device = Derived1(name="mydevice") then device.sig2.name == "mydevice-sig2"
-If device = Derived2(name="mydevice") then device.sig2.name == ""
Now:
device.sig2.name == "mydevice-sig2"in both cases
The canonical way to rename a signal to something different to {parent.name}-{signal_name} is to override set_name, e.g. in motor:
def set_name(self, name: str, *, child_name_separator: str | None = None) -> None:
"""Set name of the motor and its children."""
super().set_name(name, child_name_separator=child_name_separator)
# Readback should be named the same as its parent in read()
self.user_readback.set_name(name)Shared FlyMotorInfo for SimMotor and EpicsMotor
# old
from ophyd_async.sim import FlySimMotorInfo
info = FlySimMotorInfo(cv_start=0, cv_end=1, cv_time=0.2)
# new
from ophyd_async.core import FlyMotorInfo
info = FlyMotorInfo(start_position=0, end_position=1, time_for_move=0.2)or
# old
from ophyd_async.epics import motor
info = motor.FlyMotorInfo(start_position=0, end_position=1, time_for_move=0.2)
# new
from ophyd_async.core import FlyMotorInfo
info = FlyMotorInfo(start_position=0, end_position=1, time_for_move=0.2)Remove EigerTriggerInfo
# old
from ophyd_async.fastcs.eiger import EigerDetector, EigerTriggerInfo
await det.prepare(
EigerTriggerInfo(
number_of_events=1,
trigger=DetectorTrigger.INTERNAL,
energy_ev=10000,
)
)
# new
from ophyd_async.core import TriggerInfo
await det.drv.detector.photon_energy.set(10000)
await det.prepare(
TriggerInfo(
number_of_events=1,
trigger=DetectorTrigger.INTERNAL,
)
)What's Changed
- 729 make it easier to spot when slow tests are added by @Relm-Arrowny in #916
- Modify SimMotor to use the same FlyMotorInfo as the EPICS motor, move… by @jwlodek in #920
- Fix CI tests which involve ophyd by @coretl in #927
- Add
ConfinedModelto explicitly defined fields in the model schema by @hyperrealist in #925 - Simplify HDFDocumentComposer by @shihab-dls in #858
- add ExampleTable to
test_soft_signal_backend_get_put_monitorby @hyperrealist in #930 - Allow constants in kwargs of derived_signal by @shihab-dls in #859
- Allow n nodes in Odin by @RJCD-Diamond in #926
- create pmac IO interface classes for trajectory scanning by @gilesknap in #929
- Remove EigerTriggerInfo by @shihab-dls in #928
- Add check_value utility function fixes #874 by @gilesknap in #931
- Set device name when child device attached by @coretl in #899
- Point back at latest ophyd release by @coretl in #934
- signal walking added for debugging by @stan-dot in #917
- Update ADAndor to match ADAravis by @Relm-Arrowny in #942
New Contributors
- @hyperrealist made their first contribution in #925
- @RJCD-Diamond made their first contribution in #926
Full Changelog: v0.10.1...v0.11