BCDA-APS / gemviz

Data visualization for tiled
https://bcda-aps.github.io/gemviz/
Other
4 stars 0 forks source link

BUG: error getting start time of first run from empty catalog #68

Closed prjemian closed 1 year ago

prjemian commented 1 year ago

Browsing a catalog and got an error where there were no runs but at least one was expected:

catalogSelected: args = ('30id-nrs30',)  kwargs = {}
Traceback (most recent call last):
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/iterviews.py", line 60, in __getitem__
    (key,) = keys
ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/filterpanel.py", line 53, in catalogSelected
    getStartTime(cat.keys().first()),
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/iterviews.py", line 18, in first
    return self[0]
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/iterviews.py", line 62, in __getitem__
    raise IndexError("Index out of range")
IndexError: Index out of range

The application quit completely.

prjemian commented 1 year ago

Need to verify that len(cat) > 0. Disable the slider if there are no runs. Enable the slider if there are runs.

prjemian commented 1 year ago

See #77