lab-cosmo / chemiscope

An interactive structure/property explorer for materials and molecules
http://chemiscope.org
BSD 3-Clause "New" or "Revised" License
119 stars 29 forks source link

Load function #309

Closed bananenpampe closed 8 months ago

bananenpampe commented 8 months ago

Adds a load function to load the .json or .json.gz file after saving a jupyter widget

ceriottm commented 8 months ago

Looks good but I fear the semantics is a bit confusing. save is a method associated with a chemiscope widget, that saves its status. load should be similarly a method that loads a ".json" into an existing chemiscope widget. IDK if this is something that makes sense, and/or something you want to implement in this PR but I would rename the current load method as something like read_input or probably show_input

bananenpampe commented 8 months ago

It makes sense, yet it would require first initializing an empty widget and then loading the saved widget into the empty one. I dont really see a usecase for it. I changed the names.

ceriottm commented 8 months ago

It makes sense, yet it would require first initializing an empty widget and then loading the saved widget into the empty one. I dont really see a usecase for it. I changed the names.

I am thinking of having a loaded CS, and then changing the file it has loaded. Might be interesting in interactive notebooks. I think however it's a corner case, and we could cover it in another PR if the need ever arises.