-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added number_of_frames instead of iterations #581
Conversation
d86e04c
to
c52e34b
Compare
e7c72ba
to
31c7ded
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can we have a test that looks like the tomography example?
] | ||
|
||
|
||
async def test_hdf_panda_hardware_triggered_flyable_with_iterations( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have deleted test_hdf_panda_hardware_triggered_flyable_with_iterations
and moved it to
@pytest.mark.parametrize("number_of_frames", [[1, 1, 1, 1], [2, 3, 100, 3]])
async def test_hardware_triggered_flyable(
As we are removing iterations
fb3343e
to
3a56af0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this, I think we should wait for a once over from @coretl before we merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed my mind, I'd quite like
Which means either:
1)
adding
self._frames_completed += 1
to complete
and removing
self._frames_completed += self._frames_to_complete
from kickoff
.
Or (and I actually think the following is the nicer option)
2)
Changing its name to self._completable_frames
and leaving a comment in init
that it represents the total number of frames that will have been completed at the end of the next complete
.
This is nicer because it means that
if self._completable_frames >= self._trigger_info.total_number_of_triggers:
raise RuntimeError(
will still work - if we changed to increment by 1 then would probably still need this variable to make sure you can't kickoff
too many times.
…etable frames This commit refactors the kickoff method in the StandardDetector class to track the number of frames that can be completed after kickoff. The frames_completed attribute has been replaced with the completable_frames attribute, which represents the number of frames that can be completed. Additionally, the frames_completed attribute has been removed from the complete method and replaced with the completable_frames attribute. This change ensures that the completable_frames attribute is reset to 0 once the target number of iterations is reached and the detector is disarmed.
…stead of number_of_frames
…d invoke_extra_kickoff_before_complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fab, thank you 🙏
We should wait for a once over from @coretl
* Added more flexible multi-run specs * Refactor StandardDetector kickoff method to track the number of completable frames This commit refactors the kickoff method in the StandardDetector class to track the number of frames that can be completed after kickoff. The frames_completed attribute has been replaced with the completable_frames attribute, which represents the number of frames that can be completed. Additionally, the frames_completed attribute has been removed from the complete method and replaced with the completable_frames attribute. This change ensures that the completable_frames attribute is reset to 0 once the target number of iterations is reached and the detector is disarmed. * Refactor test_hardware_triggered_flyable to use number_of_triggers instead of number_of_frames * Refactor test_hardware_triggered_flyable to use number_of_triggers and invoke_extra_kickoff_before_complete * Refactor kickoff method to track total number of frames completed
closes #575
This pull request introduces significant changes to the
TriggerInfo
class and related logic in theophyd_async
package to support multiple trigger counts. The main changes include renaming thenumber
field tonumber_of_triggers
, updating associated logic, and modifying tests to accommodate these changes.Core changes:
TriggerInfo Class:
number
tonumber_of_triggers
and updated its type to support both single integers and lists of integers. (src/ophyd_async/core/_detector.py
)computed_field
andcached_property
to calculate the total number of triggers. (src/ophyd_async/core/_detector.py
)Detector Logic:
prepare
,kickoff
, andcomplete
methods to handle the newnumber_of_triggers
logic. (src/ophyd_async/core/_detector.py
)Controller updates:
prepare
methods to usetotal_number_of_triggers
instead ofnumber
. (src/ophyd_async/epics/adaravis/_aravis_controller.py
,src/ophyd_async/epics/adkinetix/_kinetix_controller.py
,src/ophyd_async/epics/adpilatus/_pilatus_controller.py
,src/ophyd_async/epics/adsimdetector/_sim_controller.py
,src/ophyd_async/epics/advimba/_vimba_controller.py
,src/ophyd_async/epics/eiger/_eiger_controller.py
)Test updates:
number_of_triggers
field. (tests/core/test_flyer.py
,tests/conftest.py
,system_tests/epics/eiger/test_eiger_system.py
)Other changes:
cached_property
and updated imports forNonNegativeInt
andcomputed_field
. (src/ophyd_async/core/_detector.py
)iteration
parameter fromprepare_static_seq_table_flyer_and_detectors_with_same_trigger
. (src/ophyd_async/plan_stubs/_fly.py
)