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
19 stars 3 forks source link

Use refactored weas #47

Closed superstar54 closed 5 months ago

superstar54 commented 5 months ago

This PR

Use WidgetWrapper to map the Python name to base the widget's traits.

For example

Atoms Viewer (avr)

viewer.avr.color_by = "Force"
viewer.avr.color_ramp = ["red", "yellow", "blue"]
viewer.avr.model_style = 1

# isosuface
viewer.avr.iso.volumetric_data = {"values": volume}
viewer.avr.iso.settings = [{"isovalue": 0.0001, "mode": 0}]

Camera

viewer.camera.zoom = 2
viewer.camera.position = [0, 0, 100]
viewer.camera.look_at = [0, 0, 0]

Use weas 0.1.1, and install it locally instead of importing from unpkg

fix #41 , fix #45

UI tests

add tests for

superstar54 commented 5 months ago

@ltalirz Could you review this PR when you have time? The main purpose is to fix #41, #42, #43. The PR refactors the original code a lot, so it could be difficult to review the details. :rofl: And some details could be improved in the future PRs.

ltalirz commented 5 months ago

thanks a lot @superstar54 - I think I can find some time over the easter holidays

superstar54 commented 5 months ago

@ltalirz Thanks! The Visual regression test, which uses playwright, failed because some cells in the jupyter notebooks didn't produce an output, and I haven't found the reason yet. But in my local test, all passed.