labscript-suite-temp-2 / runmanager

runmanager is a graphical user interface (GUI) used to aid the compilation of labscript experiment scripts into hardware instructions to be executed on the hardware. Experiment parameters can be adjusted in the GUI, and lists of parameters can be used to create sequences of experiments, and scan over complex parameter spaces.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

.next_sequence_index not found error using pre-sequence index defaults #67

Closed philipstarkey closed 5 years ago

philipstarkey commented 5 years ago

Original report (archived issue) by David Meyer (Bitbucket: dihm, GitHub: dihm).


Updating to tag 2.4.0 I now get many file not found errors for the .next_sequence_index file when opening and closing runmanager. It also appears that the closing error is preventing runmanager from updating runmanager.ini.

Also, my shot output folder gets erased on load. I get the corresponding non-default output folder message, but the reset to default folder button is not available.

I'm guessing that part of this is just me not understanding how to work with the new sequence_index, but I also thought the idea was to not force people to immediately update to the new scheme so I'm not quite sure what is going on.

The opening runmanager traceback (which appears twice) is

Traceback (most recent call last):
  File "C:\labscript_suite\runmanager\__main__.py", line 1411, in load_the_config_file
    self.load_configuration(autoload_config_file)
  File "C:\labscript_suite\runmanager\__main__.py", line 3110, in load_configuration
    default_output_folder = self.get_default_output_folder()
  File "C:\Anaconda3\envs\labscript\lib\site-packages\qtutils\invoke_in_main.py", line 228, in f
    return inmain(fn, *args, **kwargs)
  File "C:\Anaconda3\envs\labscript\lib\site-packages\qtutils\invoke_in_main.py", line 102, in inmain
    return fn(*args, **kwargs)
  File "C:\labscript_suite\runmanager\__main__.py", line 2388, in get_default_output_folder
    increment_sequence_index=False,
  File "C:\labscript_suite\runmanager\__init__.py", line 663, in new_sequence_details
    sequence_index = next_sequence_index(shot_basedir, now, increment_sequence_index)
  File "C:\labscript_suite\runmanager\__init__.py", line 624, in next_sequence_index
    with open(sequence_index_file) as f:
IOError: [Errno 2] No such file or directory: u'C:\\Users\\Experiment Control\\Experiments\\RydEIT2\\ProbeSweep\\.next_sequence_index'

Relevant labconfig is

[DEFAULT]
experiment_shot_storage = %(shared_drive)s\Experiments\%(experiment_name)s
[runmanager]
autoload_config_file = %(experiment_shot_storage)s\runmanager.ini
output_folder_format = %%Y\%%m\%%d
philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Thanks for the bug report! It was supposed to be completely backward compatible, so apologies that it broke for you. You shouldn't have to understand or do anything for it not to break. I'll see what I can do.

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


What Python version are you on? I think the issue is that different Python versions raise different errors when a file or directory does not exist, and I'm not catching the full range of possibilities when determining if the file exists or not.

philipstarkey commented 5 years ago

Original comment by David Meyer (Bitbucket: dihm, GitHub: dihm).


Oh, that's interesting. At tag 2.4.0 the first error on open gets caught and displayed in the output box, with the second in a pop-up. Going to PR #35 both errors show as pop-ups. Not really sure what that means.

philipstarkey commented 5 years ago

Original comment by David Meyer (Bitbucket: dihm, GitHub: dihm).


I'm python 2.7.15 on this system.

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Oh, yikes, the change in how the errors appear is my fault - I left debug code in the PR that raised the error instead of showing it in the output box. Basically if errors occur during config-file-loading they are displayed in the outputbox since the are probably about the config file. But during developing it hides actual errors so I turned that off and forgot to turn it back on again...

Great, it's definitely that I'm not catching the right exceptions. I'll read up on the exception hierarchy changes for OSErrors etc between Python 2 and 3 and make sure I'm catching the right exception. It will be an easy fix, just gotta make sure I'm covering all the bases. Will have it fixed soon!

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


This should be resolved by b2ca5d9ed415c65a82261761a447989efa586a61, could you check if it fixes it as expected?

philipstarkey commented 5 years ago

Original comment by David Meyer (Bitbucket: dihm, GitHub: dihm).


3e0aa63 works like a charm.

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Fixed in b2ca5d9ed415c65a82261761a447989efa586a61