Skip to content

Add i09-2 stage using StandardMovable#2093

Open
oliwenmandiamond wants to merge 27 commits into
mainfrom
add_i09_2_stage
Open

Add i09-2 stage using StandardMovable#2093
oliwenmandiamond wants to merge 27 commits into
mainfrom
add_i09_2_stage

Conversation

@oliwenmandiamond

@oliwenmandiamond oliwenmandiamond commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #2107

Instructions to reviewer on how to test:

  1. Check implementation makes sense
  2. Refactor of existing logic is okay
  3. Tests pass
  4. dodal connect works for i09-2

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.16%. Comparing base (80b0c62) to head (79e938b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2093   +/-   ##
=======================================
  Coverage   99.16%   99.16%           
=======================================
  Files         347      350    +3     
  Lines       13578    13633   +55     
=======================================
+ Hits        13464    13519   +55     
  Misses        114      114           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oliwenmandiamond oliwenmandiamond marked this pull request as ready for review June 25, 2026 08:18
@oliwenmandiamond oliwenmandiamond requested a review from a team as a code owner June 25, 2026 08:18
@oliwenmandiamond oliwenmandiamond changed the title Add i09 2 stage using StandardMovable Add i09-2 stage using StandardMovable Jun 25, 2026
@Relm-Arrowny Relm-Arrowny self-assigned this Jun 26, 2026

@Relm-Arrowny Relm-Arrowny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few minor things.

await wait_for_value(self.within_tolerance, True, timeout=timeout)


def _within_tolerance_read(setpoint: float, readback: float, tolerance: float) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is not really doing read?

Suggested change
def _within_tolerance_read(setpoint: float, readback: float, tolerance: float) -> bool:
def _is_within_tolerance(setpoint: float, readback: float, tolerance: float) -> bool:

Comment on lines +35 to +44

self.user_setpoint = epics_signal_rw(float, prefix + ":MOV:RD")
self.tolerance = soft_signal_rw(float, initial_value=tolerance)
self.motor_stop = epics_signal_w(int, prefix + ":HLT:WR.PROC")
super().__init__(
tolerance=self.tolerance,
setpoint=self.user_setpoint,
readback=self.user_readback,
name=name,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feel really wrong, PiezoElectricMotor now has both user_setpoint(feedback) and self._setpoint(feedback)_ref pointing to the exact same underlying signal. Since the singalRW already use standard setpoint and readback as names, it’s probably better to just standardise on those names here and eliminate the duplicate references.

Comment on lines +20 to +21
async def stop(self) -> None:
await self.motor_stop.set(1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does epics do the cleanup after motor_stop is call? If a move is currently in progress, it will be stuck awaiting within_tolerance until timeout as the readback never get to the setpoint.

Comment on lines +93 to +98
await wait_for_value(
movable_with_tolerance.movable_logic.setpoint, setpoint, timeout=1
)
assert (
await movable_with_tolerance.movable_logic.setpoint.get_value() == setpoint
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The are doing the same thing here.

Suggested change
await wait_for_value(
movable_with_tolerance.movable_logic.setpoint, setpoint, timeout=1
)
assert (
await movable_with_tolerance.movable_logic.setpoint.get_value() == setpoint
)
await wait_for_value(
movable_with_tolerance.movable_logic.setpoint, setpoint, timeout=1
)

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.

Add I09-2 sample stage

2 participants