You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, jdaviz application stores its viewers within app._viewer_store dictionary and the data is not human-readable. As a result, we are unable to programmatically access the viewer using a human-readable identifier unless it is the default viewer already defined in a pre-configured YAML file.
fromjdaviz.imvizimportImvizimviz=Imviz()
# Interactively load some data, create some tiles..# Now we want to know what are the viewers available.# We do not know these names beforehand because some of them# were created interactively.available_viewer_names=imviz.app.get_viewer_names() # ['viewer-1', 'viewer-2', ...]desired_viewer=imviz.app.get_viewer('viewer-2')
# Now we can programmatically control desired_viewer
The text was updated successfully, but these errors were encountered:
But it cannot be done in a predictable way unless it knows what prefix to apply based on which viztool is calling it and what is the next sequence number to attach to that prefix. Let's not randomize the sequence number here with uuid and such for readability.
I like your API as presented, @pllim, but with one addition/clairification: for the initial configuration (before more viewers are added), the name should be the name that comes from the configuration file. Digging into things a bit it looks like the current get_viewers gets it's names from here:
- one could imagine taking the logic from that method, and just returning all the keys that correspond to items that are viewer subclasses.
TBH, I don't understand why _viewer_store's keys are UUIDs anyway - it seems more logical to me to just use human-readable names instead of UUIDs and dispense completely with the IDs separate from the references. But someone else (@nmearl, @astrofrog , @maartenbreddels ? ) might have insight that I'm missing. Regardless, I agree we want a get_viewer_names that tells you what get_viewer would accept.
Currently,
jdaviz
application stores its viewers withinapp._viewer_store
dictionary and the data is not human-readable. As a result, we are unable to programmatically access the viewer using a human-readable identifier unless it is the default viewer already defined in a pre-configured YAML file.https://jira.stsci.edu/browse/JDAT-1491
Also see: #175, #372
Blocks
Example workflow (exact API negotiable)
The text was updated successfully, but these errors were encountered: