superstar54 / weas-widget

A widget to visualize and edit atomic structures in Jupyter Notebook
https://weas-widget.readthedocs.io/en/latest/index.html
MIT License
22 stars 3 forks source link

Use ChangeTrackingDict #68

Closed superstar54 closed 2 weeks ago

superstar54 commented 2 weeks ago

This PR introduces a ChangeTrackingDict, which detects the change of the dict, and automatically run (deepcopy - edit - assign back) for a traitlet.

This make the following codes possible:

viewer.avr.species.settings['C']["color"]="blue"
viewer.avr.species.settings['C']["radius"]=0.6