BCDA-APS / gemviz

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

BUG: some runs do not have a stop document #52

Closed prjemian closed 1 year ago

prjemian commented 1 year ago

While browsing a catalog, the app crashed with this exception trace:

Traceback (most recent call last):
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/resultwindow.py", line 51, in data
    return run.metadata.get("stop", {}).get("exit_status", "")
AttributeError: 'NoneType' object has no attribute 'get'

This particular run did not have a stop document.

prjemian commented 1 year ago

Since the data in our table comes from this pattern: run.metadata[document_name][key], we should create a method that cautiously returns the value of the desired key, yet returns a default value if the key, or its parent, are not available.

This can lead to some generalized specification of each of the data table items. A few items (time, detectors, motors) would need special handling. There's a pattern here...

prjemian commented 1 year ago

The new _getKey() method ...

can lead to some generalized specification of each of the data table items. A few items (time, detectors, motors) would need special handling. There's a pattern here...