Closed prjemian closed 1 year ago
Actually, there are no tests now.
Could not reproduce the problem yet. Try calling newSpecFile()
with an existing file. (add that to the test suite)
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
Either:
scan_id
should be used when specified, even if file exists
The test suite needs more cases to confirm.