Skip to content

Fixes for ophyd-async 0.9.0a2#1014

Merged
olliesilvester merged 13 commits intomainfrom
update-ophyd-async
Feb 5, 2025
Merged

Fixes for ophyd-async 0.9.0a2#1014
olliesilvester merged 13 commits intomainfrom
update-ophyd-async

Conversation

@DiamondJoseph
Copy link
Contributor

@DiamondJoseph DiamondJoseph commented Jan 24, 2025

Fixes #1017

  • DeviceCollector renamed to init_device

  • sim.demo module renamed to sim

  • Initialisation arguments for HDF detectors change slightly as a result of added support for non-hdf writers

  • save_panda utility plan updated to use new ophyd-async save

  • Merlin now inherits from ADBaseController

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}

@DiamondJoseph DiamondJoseph requested a review from a team as a code owner January 24, 2025 14:03
@DiamondJoseph DiamondJoseph linked an issue Jan 24, 2025 that may be closed by this pull request
@DiamondJoseph DiamondJoseph linked an issue Jan 24, 2025 that may be closed by this pull request


class MerlinController(DetectorController):
class MerlinController(ADBaseController):
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't properly check if this is correct but it looked about right

assert await tetramm.hdf.lazy_open.get_value()
assert await tetramm.hdf.swmr_mode.get_value()
assert (await tetramm.hdf.file_template.get_value()) == "%s/%s.h5"
assert (await tetramm.hdf.file_template.get_value()) == "%s%s.h5"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't know if this change in syntax could break anything for anyone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking to try and find where this has even come from

@codecov
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.67%. Comparing base (f69b1e6) to head (f93b924).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1014      +/-   ##
==========================================
+ Coverage   97.62%   97.67%   +0.04%     
==========================================
  Files         159      159              
  Lines        6581     6589       +8     
==========================================
+ Hits         6425     6436      +11     
+ Misses        156      153       -3     

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

@olliesilvester
Copy link
Contributor

@DiamondJoseph It's pretty much there now but please can you check the linting ins tetramm and test_dcm ?

bl_prefix=False,
drv_suffix="CAM:",
hdf_suffix="HDF5:",
fileio_suffix="HDF5:",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we at least be consistent about whether or not we are using HDF5_PREFIX?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've adjusted all of the existing beamlines to make use of it- and CAM_SUFFIX/DET_SUFFIX to at least make it clear we have 2 standards and absolutely for sure definitely never any more.

await merlin.stage()
await merlin.prepare(one_shot_trigger_info)
await merlin.controller.arm()
await merlin._controller.arm()
Copy link
Contributor

Choose a reason for hiding this comment

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

How was this working before?

Copy link
Contributor

Choose a reason for hiding this comment

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

i13_1's MerlinController changed inheritance in this PR, I think it lead to the slightly changed syntax here

return 1

if Path(output_file).exists() and not force:
if Path(file_name).exists() and not force:
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't this now need to be output directory / file_name?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah thanks, good catch

output_file = args.output_file
file_name = args.file_name
output_directory = args.output_directory
force = args.force
Copy link
Contributor

@rtuck99 rtuck99 Feb 4, 2025

Choose a reason for hiding this comment

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

I think you could just leave the options unchanged and do

p = Path(output_file)
output_directory, file_name = str(p.parent), str(p.name)

then you wouldn't need two parameters. It's a bit strange to make the output directory a mandatory option but the filename optional, normally the output file is the last parameter for most tools

Copy link
Contributor

@rtuck99 rtuck99 left a comment

Choose a reason for hiding this comment

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

Approved with above observations, I leave it to you to decide whether to change back the save_panda options

@olliesilvester olliesilvester merged commit 2b18524 into main Feb 5, 2025
19 checks passed
@olliesilvester olliesilvester deleted the update-ophyd-async branch February 5, 2025 10:43
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.

Update use of save/load from ophyd-async to version 0.9.0a2

3 participants