brainglobe / brainglobe-workflows

Workflows that utilise BrainGlobe tools to perform data analysis and visualisation.
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

Provide better error messages in case of a single corrupt file #43

Open adamltyson opened 2 years ago

adamltyson commented 2 years ago

In the case of one file becoming corrupt (e.g. in a directory of 2000), the user gets an error such as the following, which doesn't help them debug.

  File "/ceph/apps/ubuntu-20/packages/cellfinder/0.4.17/lib/python3.9/site-packages/imio/load.py", line 239, in load_from_folder
    return load_image_series(
  File "/ceph/apps/ubuntu-20/packages/cellfinder/0.4.17/lib/python3.9/site-packages/imio/load.py", line 330, in load_image_series
    img = threaded_load_from_sequence(
  File "/ceph/apps/ubuntu-20/packages/cellfinder/0.4.17/lib/python3.9/site-packages/imio/load.py", line 404, in threaded_load_from_sequence
    stack = np.dstack([s.result() for s in stacks])
  File "<__array_function__ internals>", line 5, in dstack
  File "/ceph/apps/ubuntu-20/packages/cellfinder/0.4.17/lib/python3.9/site-packages/numpy/lib/shape_base.py", line 723, in dstack
    return _nx.concatenate(arrs, 2)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate