SiLab-Bonn / pyBAR

Bonn ATLAS Readout in Python - A readout software for FEI4 pixel detectors
BSD 3-Clause "New" or "Revised" License
9 stars 17 forks source link

run started in thread returns run_status none #91

Closed owtscharenko closed 6 years ago

owtscharenko commented 6 years ago

After starting a run with use_thread=True and calling the status with a timeout eg. join(0.01) it returns none. Reading the code I think the status should be RUNNING. When the run is finished, the correct status is returned (CRASHED / FINISHED / ABORTED / STOPPED).

laborleben commented 6 years ago

join() returns the status of the run after the run has finished. None is returned because no status is available before the scan has finished. This can lead to ambiguous situations where the return value is None.

Adding a parameter to thunkfy() to set up a default return value, would improve the situation.

owtscharenko commented 6 years ago

I see. But now RunManager crashes in threaded mode:

File "pybar/run_manager.py", line 562, in run_run_in_thread return run.run(run_conf=local_run_conf, default=self.current_run.run_status) TypeError: run() got an unexpected keyword argument 'default'

this is fixed by adding default = None in run method of RunBase (L. 137)

Nevertheless, for me it is still returning None when calling a running run

laborleben commented 6 years ago

OK, this is fixed. I rebased the development branch.