BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

BUG newSpecFile() does not reset scan_id in RE.md #153

Closed prjemian closed 1 year ago

prjemian commented 1 year ago

The test suite needs more cases to confirm.

prjemian commented 1 year ago

Actually, there are no tests now.

prjemian commented 1 year ago

Could not reproduce the problem yet. Try calling newSpecFile() with an existing file. (add that to the test suite)

prjemian commented 1 year ago

Found something. There is a difference in the behavior of newSpecFile() depending on if the file already exists. So far, the tests have all been for the case when the file does not already exist.

If the file already exists, and is a valid SPEC data file, then these (new) tests describe the present behavior: https://github.com/BCDA-APS/bluesky_training/blob/a5f704707fd2805086190049ee68ab41ed35709a/bluesky/tests/test_newSpecFile.py#L90-L100

In both cases, the proposed scan_id argument is ignored and the RunEngine is told to use the last scan number in the existing SPEC data file. https://github.com/BCDA-APS/bluesky_training/blob/a5f704707fd2805086190049ee68ab41ed35709a/bluesky/instrument/callbacks/spec_data_file_writer.py#L62-L68

prjemian commented 1 year ago

Either: