You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you try to export a summary montage and load a -STATS.csv file that has no particles, you get the following errorL
0it [00:00, ?it/s]
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:124: RuntimeWarning: invalid value encountered in true_divide
vd = tpvol / sv # micro-litres / litre
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:140: RuntimeWarning: invalid value encountered in double_scalars
nc = np.sum(count) / sv
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:696: RuntimeWarning: invalid value encountered in true_divide
nd = np.float64(nd) / sample_volume # nc per size bin per litre
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:701: RuntimeWarning: invalid value encountered in less
nd[nd<0] = np.nan # and nan impossible values!
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:198: RuntimeWarning: invalid value encountered in greater
ind = np.argwhere(nd>0)
Traceback (most recent call last):
File "/home/dave/PycharmProjects/PySilCam/pysilcam/silcamgui/silcamgui.py", line 458, in export_summary_figure
self.configfile, monitor=False)
File "/home/dave/PycharmProjects/PySilCam/pysilcam/plotting.py", line 281, in summarise_fancy_stats
settings.PostProcess, oilgas=oilgas)
File "/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py", line 199, in nc_vc_from_stats
nd[ind[0]] = np.nan
IndexError: index 0 is out of bounds for axis 0 with size 0
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
Low priority bug, you should rarely load a stats file with no particles. I'll submit a pull request to fix it by adding a 0-length check when I get around to it.
Yes, I think exactly that would be good. It can just warn that there are no particles, not create a plot and return you to the interface so you can continue. I believe it currently creates empty oil and gas plots and then freezes.
Describe the bug
If you try to export a summary montage and load a -STATS.csv file that has no particles, you get the following errorL
0it [00:00, ?it/s]
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:124: RuntimeWarning: invalid value encountered in true_divide
vd = tpvol / sv # micro-litres / litre
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:140: RuntimeWarning: invalid value encountered in double_scalars
nc = np.sum(count) / sv
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:696: RuntimeWarning: invalid value encountered in true_divide
nd = np.float64(nd) / sample_volume # nc per size bin per litre
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:701: RuntimeWarning: invalid value encountered in less
nd[nd<0] = np.nan # and nan impossible values!
/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py:198: RuntimeWarning: invalid value encountered in greater
ind = np.argwhere(nd>0)
Traceback (most recent call last):
File "/home/dave/PycharmProjects/PySilCam/pysilcam/silcamgui/silcamgui.py", line 458, in export_summary_figure
self.configfile, monitor=False)
File "/home/dave/PycharmProjects/PySilCam/pysilcam/plotting.py", line 281, in summarise_fancy_stats
settings.PostProcess, oilgas=oilgas)
File "/home/dave/PycharmProjects/PySilCam/pysilcam/postprocess.py", line 199, in nc_vc_from_stats
nd[ind[0]] = np.nan
IndexError: index 0 is out of bounds for axis 0 with size 0
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
Pysilcam will quit or freeze after this error.
To Reproduce
Use the attached file to try exporting a summary figure from.
run_D20210829T100138-STATS.csv
Expected behavior
Should probably present a message saying that the loaded stats file has no particles, and continue without crashing.
Additional context
Exporting a summary time series works OK and exports an empty time series.
The text was updated successfully, but these errors were encountered: