Skip to content

Fix misc eiger arming issues#2052

Open
rtuck99 wants to merge 2 commits intomainfrom
fix_misc_eiger_arming_issues
Open

Fix misc eiger arming issues#2052
rtuck99 wants to merge 2 commits intomainfrom
fix_misc_eiger_arming_issues

Conversation

@rtuck99
Copy link
Copy Markdown
Contributor

@rtuck99 rtuck99 commented May 7, 2026

Fixes

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

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
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.11%. Comparing base (4ba9de1) to head (1b68b6a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2052   +/-   ##
=======================================
  Coverage   99.11%   99.11%           
=======================================
  Files         327      327           
  Lines       12810    12830   +20     
=======================================
+ Hits        12697    12717   +20     
  Misses        113      113           

☔ View full report in Codecov by Sentry.
📢 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.

@rtuck99 rtuck99 marked this pull request as ready for review May 7, 2026 16:12
@rtuck99 rtuck99 requested a review from a team as a code owner May 7, 2026 16:12
Copy link
Copy Markdown
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Couple of suggestions. Now we're less parallel this presumably will affect the time it takes to arm/disarm the detector. Have you investigated how much it changes throughput and agreed that the stability is preferred?

Comment on lines 229 to +232
status = self.cam.roi_mode.set(
1 if enable else 0, timeout=self.timeouts.general_status_timeout
)
status.wait(timeout=self.timeouts.general_status_timeout)
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.

Could: If we're going to wait on each individual status then we don't need to keep the status around, e.g.

Suggested change
status = self.cam.roi_mode.set(
1 if enable else 0, timeout=self.timeouts.general_status_timeout
)
status.wait(timeout=self.timeouts.general_status_timeout)
self.cam.roi_mode.set(1 if enable else 0, timeout=self.timeouts.general_status_timeout).wait(timeout=self.timeouts.general_status_timeout)

)
status.wait(timeout=self.timeouts.general_status_timeout)
LOGGER.debug(f"Setting image_height to {detector_dimensions.height}")
status &= self.odin.file_writer.image_height.set(
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.

Should: The last status has already been waited on so no need to do &= here, = will do (or just don't keep it around as above)

timeout=self.timeouts.general_status_timeout,
)
status.wait(timeout=self.timeouts.general_status_timeout)
return status
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.

Should: The only reason this returns the status is so that we can wait on it, if we've already waited on it then it seems a bit pointless

def _wait_for_odin_status(self) -> StatusBase:
self.forward_bit_depth_to_filewriter()
await_value(self.odin.meta.active, 1).wait(self.timeouts.general_status_timeout)
await_value(self.odin.meta.active, 1).wait(60)
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.

Should: Can we pull this into a const?

fake_eiger.arming_status.wait(1) # This should complete long before 1s
# One log message kicking off arming, then one for each of the 13 arming stages
assert len(caplog.messages) == 14
assert len(caplog.messages) == 18
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.

Should: This no longer matches the comment above

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