BCDA-APS / gemviz

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

add exception for text in scan_id #145

Closed rodolakis closed 1 year ago

rodolakis commented 1 year ago

The behavior that would make the most sense to me if some text is entered would be to return an empty catalog (anything else triggers a lot of error since a catalog is expected to be returned). That would clear the tableview, clearly showing that the user did something wrong. I found this:

from tiled.catalogs import Catalog
empty_catalog = Catalog.from_dict({})

but I think our version of tiled is too old:

In [1]: import tiled

In [2]: print(tiled.__version__)
0.1.0a89

In [3]: import tiled.catalogs
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 1
----> 1 import tiled.catalogs

ModuleNotFoundError: No module named 'tiled.catalogs'
prjemian commented 1 year ago

I agree that once tiled is updated (#53), this code should be adjusted per the TODO comment.

prjemian commented 1 year ago

Add that issue number to the comment on line 81.

rodolakis commented 1 year ago

This fails silently. It could report the exception to the statusbar. That would coach the user about why this query failed.

The problem I encountered several times yesterday is that the status bar tends to be overwritten but other messages. I don't have specific examples though, I will try to document this.

rodolakis commented 1 year ago

I added the reference to both this PR and issue #53. I also added an update to the status bar: https://github.com/BCDA-APS/gemviz/blob/47c27e232e9dffc4de2056ebee33d71ada052064/gemviz/bluesky_runs_catalog_search.py#L80

However like I said earlier, the status bar is overwritten by the displayTable call. We need to somehow pass that information to the slot?

https://github.com/BCDA-APS/gemviz/blob/ebe1e926761e86c75e768266572dc1e36a455a47/gemviz/bluesky_runs_catalog.py#L56C1-L66C77

prjemian commented 1 year ago

This fails silently. It could report the exception to the statusbar. That would coach the user about why this query failed.

The problem I encountered several times yesterday is that the status bar tends to be overwritten but other messages. I don't have specific examples though, I will try to document this.

A history (or logging) window might be an addition. In a new issue.