Skip to content

v0.11

Choose a tag to compare

@coretl coretl released this 26 Jun 09:48
· 84 commits to main since this release
5b9e43b

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

New Contributors

Full Changelog: v0.10.1...v0.11