-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proof of Concept: Save and reload Glue-related states and data. #2552
base: main
Are you sure you want to change the base?
Conversation
for layer_id, layer_dict in saved_viewer_state['layers'].items(): | ||
data_label = layer_id.split(" ")[0] | ||
if data_label not in self.data_collection.labels: | ||
print(f"Couldn't find or load {data_label}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is just POC, but hopefully you do not plan to keep this print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had hoped that would be obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The continue
threw me off. I am not sure if you want some sort of logging here permanently or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably would make this a snackbar message, assuming restore_state
gets a button in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I am so glad it is not pickle.
I am curious if this would work for downstream stuff like lcviz.
Do we also need to store things like jdaviz version?
That's a good idea. Plenty of other stuff that still could/needs to go in this. |
Lots of to-do's left, but this shows off a proof of concept for saving and restoring state, including automatically loading the same data as long as it's on disk (currently just prints a warning if objects had been loaded and weren't reloaded prior to restoring state). Demo video attached, I've only tested with Imviz so far.
Screen.Recording.2023-11-03.at.11.31.00.AM.mov