SpikeInterface / spikeinterface

A Python-based module for creating flexible and robust spike sorting pipelines.
https://spikeinterface.readthedocs.io
MIT License
531 stars 188 forks source link

Need to save analyzer extension's run_info before run starts (bug from #3347?) #3451

Open jonahpearl opened 1 month ago

jonahpearl commented 1 month ago

@ alejoe91, can you explain why this call to self._save_run_info() line got deleted? I think it's important to have it saved before the run starts, otherwise if the run crashes there is no run_info present to be loaded.

Originally posted by @jonahpearl in ff07ac6

jonahpearl commented 1 month ago

Sorry idk how well the commenting works, but here's a screenshot of the line i'm referencing, specifically the deletion of line 2017:

image
alejoe91 commented 1 month ago

The run info dict is instantiated with the object, so there is no need to save it before it has run.

Is it triggering a specific error for you? All tests are running fine, so I don't think it's crashing

jonahpearl commented 1 month ago

It doesn't accomplish the intended use case, which was to allow the user (or the code) to check the run info dict for run_completed as being true or false in case the analyzer code crashes. As it is, one could check for the existence of the run info json file as a proxy for whether the run finished, I suppose, but that's a bit counterintuitive.