Skip to content

Latest Ophyd-async API and add Tomography plans - #49

Open
tomkane-dls wants to merge 15 commits into
test_flyscanfrom
tomo-plans
Open

Latest Ophyd-async API and add Tomography plans#49
tomkane-dls wants to merge 15 commits into
test_flyscanfrom
tomo-plans

Conversation

@tomkane-dls

@tomkane-dls tomkane-dls commented Aug 12, 2026

Copy link
Copy Markdown

Aims:

  1. Update with most recent ophyd-async and dodal APIs
  2. Split spectroscopy out of plans.py, make what remains in plans.py experiment agnostic
  3. Add new tomography plans, one for calibrating, one for experiment demo

These also need to be implemented elsewhere alongside this PR:

blueapi config needs both new plan modules added
PR for after ophyd-async and dodal upgraded


1. New ophyd-async/dodal

  • StandardFlyer → StandardFlyable, built via FlyableLogic.with_device()
  • PmacTrajectoryTriggerLogic → PmacTrajectoryFlyableLogic, prepare takes PmacScanInfo
  • ScanSpecSeqTableTriggerLogic → ScanSpecSeqTableFlyableLogic
  • Baseline YAML: 24 keys writer.* → hdf.*
  • Detector whitelist fileio-* → hdf-*
  • Deleted debug line dereferencing non-existent pandabrick.absenc
  • Test fixtures use b01_1..build(...), depend on run_eng
  • Added pandabrick fixture; spectroscopy dereferences it
  • Test call sites use keywords, pinned to fly=False
  • callback_on_mock_put callback no longer takes wait

2. Spectroscopy out of plans.py

  • plans.py reduced to shared infrastructure only
  • New spectroscopy_plans.py holds both spectroscopy plans
  • Added serialize_spec(); function-local imports moved to module
  • snapshot() takes a device list
  • fly_scan parameterised: detector, deadtime, trigger, whitelist
  • fly_scan derives num_points from spec — fixes 30-vs-25
  • Removed unused sample_stage parameter from fly_scan
  • Magic numbers to constants: PANDA_WHITELIST, MAX_STAGE_VELOCITY

3. Add tomography plans

  • New tomography_plans.py
  • Currently made it so that step and flyscans are explicitly callable rather than calculated from the velocity
  • Stage returns to start_angle after scanning, uses finalize_wrapper, so runs on failure too
  • collect_calibration_images plan endpoint for flats and darks
  • bound num_projections 30–1440

Housekeeping

  • Baseline YAMLs moved into baselines/ subdirectory
  • Fixed stale assertions: ROI 295, Blue/Green/Red, snake
  • Split ARAVIS_ into MANTA_ and ALVIUM_ constants
  • Removed imaging_detector everywhere as it no longer exists
  • Fixed test_spectroscopy_re stale API and positional arguments

@tomkane-dls tomkane-dls changed the title Latest Ophyd-async API a Latest Ophyd-async API and add Tomography plans Aug 12, 2026
@tomkane-dls
tomkane-dls marked this pull request as draft August 12, 2026 14:19
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.83007% with 89 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (test_flyscan@7557832). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/test_rig_bluesky/tomography_plans.py 0.00% 73 Missing ⚠️
src/test_rig_bluesky/plans.py 50.00% 11 Missing ⚠️
src/test_rig_bluesky/spectroscopy_plans.py 91.37% 5 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             test_flyscan      #49   +/-   ##
===============================================
  Coverage                ?   48.40%           
===============================================
  Files                   ?        5           
  Lines                   ?      219           
  Branches                ?        0           
===============================================
  Hits                    ?      106           
  Misses                  ?      113           
  Partials                ?        0           

☔ 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.

@EmsArnold EmsArnold 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.

Looks good at a first pass, I'd like to get it live on the beamline and properly test it though!

Comment on lines +11 to +34
hdf.array_counter: 3
hdf.auto_increment: true
hdf.capture: false
hdf.chunk_size_auto: true
hdf.compression: None
hdf.create_directory: 0
hdf.enable_callbacks: Enable
hdf.file_name: 5073260b-9688-4283-84d1-204955e423aa
hdf.file_number: 1
hdf.file_path: /tmp/
hdf.file_template: "%s%s.h5"
hdf.file_write_mode: Stream
hdf.flush_now: false
hdf.lazy_open: true
hdf.nd_array_address: 0
hdf.nd_array_port: D2.ROISTAT
hdf.nd_attributes_file: ""
hdf.num_capture: 0
hdf.num_extra_dims: 0
hdf.num_frames_chunks: 1
hdf.position_mode: false
hdf.queue_size: 2
hdf.swmr_mode: true
hdf.xml_file_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.

Would be good to test these on the beamline to ensure they work as intended. The file was originally generated with the save_settings plan, so I assume there's been some change in the ophyd device to prompt this change here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes i think because of this. but i changed this manually actually, so once ophyd-async is updated we can run the save_settings plan again?

Will the tomography baselines be generated in the same way?

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.

Ah okay, that's fine. It would probably be good to run the save_settings plan again to make sure that everything is working as it should.

Yes, once we have a good set of settings for tomography, we should save and load those in the same manner. This should also help if we need different panda settings down the line.


yield from load_panda_settings(
panda=pandabrick,
design_name="pandabrick_baseline",

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.

I could see a world where you may want to have different panda setups for each fly scan, it may be good to allow this to be a variable passed into fly_scan (potentially with a default design_name = "pandabrick_baseline")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okay i will implement that, no downside

@EmsArnold

Copy link
Copy Markdown
Contributor

Additionally, I believe that some changes to src/test_rig_bluesky/testing/_util.py will fix some of the linting errors:

        # Run plan
        end_event = self.client.run_task(task_request, timeout=timeout)
        assert end_event.result is not None
        task_id = end_event.task_id

@tomkane-dls
tomkane-dls marked this pull request as ready for review August 18, 2026 13:50
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