ome / omero-parade

OMERO.web plugin for displaying Dataset thumbnails or Plates in webclient center panel
GNU Affero General Public License v3.0
1 stars 12 forks source link

Data provider min() error if no images #45

Open will-moore opened 6 years ago

will-moore commented 6 years ago

For example, select an empty Orphaned Dataset and "Add Table Data..." > "ROI_count"

Since the img_ids list is empty, we get empty values list in numpy.amin(values) which fails.

Nightshade error reported with URL /parade/data/Uk9JX2NvdW50/ (ROI_count) with no query string for e.g. ?dataset=1, which gives us an empty img_ids list. Don't know how this occurred in the UI.

Internal Server Error: /parade/data/Uk9JX2NvdW50/
Traceback (most recent call last):
 File "/opt/omero/web/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
   response = wrapped_callback(request, *callback_args, **callback_kwargs)
 File "/opt/omero/web/OMERO.web/lib/python/omeroweb/decorators.py", line 488, in wrapped
   retval = f(request, *args, **kwargs)
 File "/opt/omero/web/venv/lib/python2.7/site-packages/omero_parade/views.py", line 180, in get_data
   'min': numpy.amin(values).item(),
 File "/usr/lib64/python2.7/site-packages/numpy/core/fromnumeric.py", line 1987, in amin
   out=out, keepdims=keepdims)
 File "/usr/lib64/python2.7/site-packages/numpy/core/_methods.py", line 14, in _amin
   out=out, keepdims=keepdims)
ValueError: zero-size array to reduction operation minimum which has no identity
will-moore commented 5 years ago

Also seen on demo (query: dataset=2568)

Internal Server Error: /parade/data/c2l6ZVQ=/
Traceback (most recent call last):
  File "/opt/omero/web/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/omero/web/OMERO.web/lib/python/omeroweb/decorators.py", line 486, in wrapped
    retval = f(request, *args, **kwargs)
  File "/opt/omero/web/venv/lib/python2.7/site-packages/omero_parade/views.py", line 180, in get_data
    'min': numpy.amin(values).item(),
  File "/usr/lib64/python2.7/site-packages/numpy/core/fromnumeric.py", line 1987, in amin
    out=out, keepdims=keepdims)
  File "/usr/lib64/python2.7/site-packages/numpy/core/_methods.py", line 14, in _amin
    out=out, keepdims=keepdims)
ValueError: zero-size array to reduction operation minimum which has no identity