labscript-suite-temp-2 / lyse

lyse is an analysis framework. It coordinates the running of python analysis scripts on experiment data as it becomes availiable, updating plots in real time.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Exceptions in scientific notation package should be caught #15

Closed philipstarkey closed 9 years ago

philipstarkey commented 9 years ago

Original report (archived issue) by Shaun Johnstone (Bitbucket: shjohnst, GitHub: shjohnst).


I experienced a traceback which required a restart of lyse to recover from:

#!python

Traceback (most recent call last):
  File "C:\Anaconda\lib\threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\labscript_suite\lyse\__main__.py", line 1535, in analysis_loop
    self.do_singleshot_analysis(filepath)
  File "C:\labscript_suite\lyse\__main__.py", line 1564, in do_singleshot_analysis
    self.shots_model.update_row(filepath, status_percent=status_percent, new_row_data=new_row_data)
  File "C:\Anaconda\lib\site-packages\qtutils\invoke_in_main.py", line 105, in f
    return inmain(fn, *args, **kwargs)
  File "C:\Anaconda\lib\site-packages\qtutils\invoke_in_main.py", line 68, in inmain
    return get_inmain_result(in_main_later(fn,False,*args,**kwargs))
  File "C:\Anaconda\lib\site-packages\qtutils\invoke_in_main.py", line 47, in event
    result = event.fn(*event.args, **event.kwargs)
  File "C:\labscript_suite\lyse\__main__.py", line 1264, in update_row
    value_str = scientific_notation(value)
  File "C:\labscript_suite\lyse\__main__.py", line 154, in scientific_notation
    prefix = prefixes[exponent]
KeyError: 84

Yes, it was trying to update a value which was something by 10^84 - the culprit was the width in a failed fit. While the crazy number really should be caught in the analysis script, it still isn't nice to have the whole program taken down by the scientific notation function not knowing what to do with a septemvigintillion!

philipstarkey commented 9 years ago

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


Fixes #15 by catching errors caused by very large or small numbers not having SI prefixes

→ \<\<cset 8c0ff3881ad1256572d5711d31049bb95b42babc>>