Skip to content

Commit

Permalink
Use pmac abort program (#466)
Browse files Browse the repository at this point in the history
* Use pmac abort

* repin dodal

* Update test
  • Loading branch information
noemifrisina committed Sep 13, 2024
1 parent cc3b1f0 commit ea7b4e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies = [
"ophyd == 1.9.0",
"ophyd-async >= 0.3a5",
"bluesky >= 1.13.0a4",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@5e8b6fc2933a2b2b2e788d432c8408317ac4a5cc",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@dadbe02e15a8325fef44c8619dae4569e98a56cb",
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,7 @@ def run_aborted_plan(pmac: PMAC, dcid: DCID):
P variable.
"""
logger.warning("Data Collection Aborted")
yield from bps.abs_set(pmac.pmac_string, "A", wait=True)
yield from bps.sleep(1.0)
yield from bps.abs_set(pmac.pmac_string, "P2401=0", wait=True)
yield from bps.trigger(pmac.abort_program, wait=True)

end_time = datetime.now()
dcid.collection_complete(end_time, aborted=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,11 @@ def test_finish_i24(


@patch("mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID")
@patch(
"mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.bps.sleep"
)
def test_run_aborted_plan(mock_sleep, fake_dcid: MagicMock, pmac: PMAC, RE):
def test_run_aborted_plan(fake_dcid: MagicMock, pmac: PMAC, RE, done_status):
pmac.abort_program.trigger = MagicMock(return_value=done_status)
RE(run_aborted_plan(pmac, fake_dcid))

mock_pmac_string = get_mock_put(pmac.pmac_string)
pmac_string_calls = [
call("A", wait=True, timeout=ANY),
call("P2401=0", wait=True, timeout=ANY),
]
mock_pmac_string.assert_has_calls(pmac_string_calls)
pmac.abort_program.trigger.assert_called_once()
fake_dcid.collection_complete.assert_called_once_with(ANY, aborted=True)


Expand Down

0 comments on commit ea7b4e8

Please sign in to comment.