Skip to content

Ophyd async v0.19.3 - #64

Merged
Bilchreis merged 14 commits into
masterfrom
ophyd-async-v0.19.3
Jul 14, 2026
Merged

Ophyd async v0.19.3#64
Bilchreis merged 14 commits into
masterfrom
ophyd-async-v0.19.3

Conversation

@Bilchreis

@Bilchreis Bilchreis commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Migrate to ophyd-async 0.19.3

Bumps the ophyd-async dependency bound from >=0.13.1,<=0.18 to >0.18,<=0.19.3 and adapts secop-ophyd to the new device/command/movable APIs introduced in that range.

Command devices

  • Replaces the hand-rolled SECoPCMDDevice (arg/result Signals + a SignalX trigger) with ophyd-async's native Command / TriggerableCommand device backends.
  • Adds SECoPCommandBackend (SECoPSignal.py) and wires it into DeviceFiller via a command_backend_factory, so commands are filled through create_commands_from_annotations alongside signals and sub-devices.
  • build_command_signature() (util.py) builds the call signature for a SECoP command from its CommandType datatype: struct arguments are unraveled into keyword-only parameters, non-struct arguments become a single positional-or-keyword arg, and a trailing wait_for_idle: bool = False is always appended.
  • stop is intentionally excluded from auto-generated command devices, since SECoPMoveableDevice already implements Stoppable.stop() and a raw command device at the same name would silently shadow it.

Movable devices

  • Rewrites SECoPMoveableDevice on top of the new StandardMovable[Any] / MovableLogic[Any], replacing the old Locatable/Stoppable implementation.
  • Adds SECoPMovableLogic, which treats a move as complete once the module's status leaves BUSY and enters the IDLE range (rather than waiting for readback == setpoint).
  • Pins _mock_class = DeviceMock on SECoPMoveableDevice since StandardMovable's default InstantMovableMock would otherwise install its own mock put-callback on target, conflicting with this project's SECoPBackend mock machinery.

Enum handling

  • Adds secop_enum_name_to_python() and dynamic StrictEnum class generation (util.py) so SECoP enum member names (e.g. "Low Energy", "high-power") are consistently mapped to valid Python identifiers.
  • Unifies enum handling between pure runtime introspection (_dynamic_enum_class) and codegen'd device classes, reusing a concrete generated StrictEnum subclass from an annotated Command[[ArgT], ResT] signature when one is already available instead of building a duplicate.

Other fixes

  • Fixes a set_name cascade bug in SECoPDevices.py so names propagate correctly to child signals/devices.
  • Removes the plan-generation code path from GenNodeCode.py and its template/tests — no longer needed with the new command device model.
  • Updates uv.lock for the new ophyd-async version range.

Testing

  • Updates tests/test_Node.py, tests/test_commands.py, and tests/test_classgen.py to cover the new command backend, movable logic, and enum generation behavior.
  • check pre-commit hook in nodebook

@Bilchreis
Bilchreis merged commit 0ba81dc into master Jul 14, 2026
14 checks passed
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.

1 participant