Skip to content

ElectronAnalyser no longer depends directly on sequence file path to work with BlueAPI#1923

Open
oliwenmandiamond wants to merge 7 commits intomainfrom
analyser_works_with_blueapi
Open

ElectronAnalyser no longer depends directly on sequence file path to work with BlueAPI#1923
oliwenmandiamond wants to merge 7 commits intomainfrom
analyser_works_with_blueapi

Conversation

@oliwenmandiamond
Copy link
Contributor

@oliwenmandiamond oliwenmandiamond commented Feb 17, 2026

Fixes #1924

Instructions to reviewer on how to test:

  1. Check tests pass

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}

@oliwenmandiamond oliwenmandiamond changed the title ElectronAnalyser no longer depends directly on sequence file path to … ElectronAnalyser no longer depends directly on sequence file path to work with BlueAPI Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.05%. Comparing base (ec5fc8d) to head (de1c820).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1923      +/-   ##
==========================================
- Coverage   99.05%   99.05%   -0.01%     
==========================================
  Files         312      312              
  Lines       11754    11735      -19     
==========================================
- Hits        11643    11624      -19     
  Misses        111      111              

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

):
self._sequence_class = sequence_class
# Save on device so connect works and names it as child
self.driver = controller.driver
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a driver that is created and passed in a child class, here in parent class it is taken out from the controller and saved as a class object - wouldn't it be clearer to make it in a child class directly when driver is created?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The class is then in charge of making sure the driver and detector connect and parent/name relationship is correct rather than the API. It's much better to make sure the API does it as all classes will need to do this, otherwise we copy and paste this line x number times for number of implementations which is unnecessary.

Copy link
Contributor

@Villtord Villtord Feb 19, 2026

Choose a reason for hiding this comment

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

you probably won't need to copy paste anything just add "self.driver" instead of making internal "driver" in a child class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue with this is that if we type anything as using the GenericElectronAnalyser for tests or plans or other devices i.e it doesn't care about if it Specs, Mbs, VGScienta etc. then it loses access to the driver because it lives now on the implementation and not on the base. We need it to be done here.

@@ -201,7 +187,7 @@ def create_region_detector_list(


GenericElectronAnalyserDetector = ElectronAnalyserDetector[
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need this class here? it seems to be used only in tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this will be used in plan repo too.

Copy link
Contributor

Choose a reason for hiding this comment

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

which plan repo? sm-bluesky?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Make ElectronAnalyserDetector work with BlueAPI

2 participants

Comments