Skip to content

Add structure_3d_plotly #214

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

Merged
merged 8 commits into from
Sep 29, 2024
Merged

Add structure_3d_plotly #214

merged 8 commits into from
Sep 29, 2024

Conversation

janosh
Copy link
Owner

@janosh janosh commented Sep 29, 2024

for quick and dirty yet interactive, pan and zoomable 3d structures that just get the job done when doing exploratory data analysis

SVG compression seems to have corrupted the example asset:

matbench-phonons-structures-3d-plotly

…site_label, generate_subplot_title, add_site_to_plot, get_structures for reuse in structure_2d and structure_(2d|3d)_plotly

maybe structure_2d (mpl version) too
…plotly.svg to readme

update matbench-phonons-structures-2d-plotly.svg with image atoms
FAILED tests/structure_viz/test_plotly.py::test_structure_2d_plotly[kwargs0] - AttributeError: attr='specie' not found on PeriodicSite. Did you mean...

        for idx, (_key, struct) in enumerate(struct_dict.items(), start=1):
>           assert fig.layout.annotations[idx - 1].text == f"{idx} - {struct.formula}"
E           AssertionError: assert 'struct1 - Fe1 O1' == '1 - Fe1 O1'
E
E             - 1 - Fe1 O1
E             + struct1 - Fe1 O1
E             ? ++++++

tests/structure_viz/test_plotly.py:190: Assertion
@janosh janosh added enhancement Improvement to existing features/functionality plotly Concerning plotly-powered functions structure Structure viz related labels Sep 29, 2024
@janosh janosh enabled auto-merge (squash) September 29, 2024 23:29
… of an array with more than one element is ambiguous. Use a.any() or a.all()
@janosh janosh merged commit 8437a9c into main Sep 29, 2024
22 of 23 checks passed
@janosh janosh deleted the plotly-structure-3d branch September 29, 2024 23:37
@janosh janosh added feature Entirely new features, not improvements to existing ones and removed enhancement Improvement to existing features/functionality labels Oct 7, 2024
janosh added a commit that referenced this pull request Mar 28, 2025
* 1st swing at structure_3d_plotly

* extract helper functions get_elem_colors, get_atomic_radii, generate_site_label, generate_subplot_title, add_site_to_plot, get_structures for reuse in structure_2d and structure_(2d|3d)_plotly

maybe structure_2d (mpl version) too

* split pymatviz/structure_viz.py module into plotly, mpl and helpers submodules

* split test_structure_viz.py into test_helpers.py, test_mpl.py, test_plotly.py

* add structure_3d_plotly example asset matbench-phonons-structures-3d-plotly.svg to readme

update matbench-phonons-structures-2d-plotly.svg with image atoms

* fix tests

* add tests for structure_3d_plotly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Entirely new features, not improvements to existing ones plotly Concerning plotly-powered functions structure Structure viz related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant