Skip to content
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

Utility functions to draw shapes that visualise tensors and vectors #289

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

ceriottm
Copy link
Contributor

Added utility functions to visualize positive-definite tensors (polarizability, thermal ellipsoids, ...) as well as vectors (forces, dipoles, ....). The latter required changing (switching off) the centering of the shapes. I think this is better, because you can always center (and add a utility function for that) a custom shape, but you can't draw an off-center shape if vertices get centered automatically.

Also fixed chemiscope.show so it takes a shapes argument.

@ceriottm ceriottm requested a review from rosecers August 23, 2023 20:30
python/chemiscope/structures/_shapes.py Outdated Show resolved Hide resolved
python/chemiscope/structures/_shapes.py Outdated Show resolved Hide resolved
python/chemiscope/structures/_shapes.py Show resolved Hide resolved
python/chemiscope/structures/_shapes.py Outdated Show resolved Hide resolved
python/chemiscope/structures/_shapes.py Outdated Show resolved Hide resolved
python/chemiscope/structures/_shapes.py Show resolved Hide resolved
python/jupyter/src/widget.ts Outdated Show resolved Hide resolved
@ceriottm
Copy link
Contributor Author

@rosecers I think I addressed all your comments. Nod if you're OK with merging now so we can move on to the next PR!

@Luthaf
Copy link
Contributor

Luthaf commented Aug 28, 2023

Regarding arrows: should we have these as predefined shape type inside chemiscope? This will save a lot of space by not requiring to store all the vertices/simplices in the file, but instead generate them on the JS side like we do for ellispoids.

python/chemiscope/structures/_ase.py Outdated Show resolved Hide resolved
python/chemiscope/structures/_ase.py Outdated Show resolved Hide resolved
python/chemiscope/structures/_shapes.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@rosecers rosecers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like @Luthaf's suggestion of an arrow as, essentially, a primitive type!

@ceriottm
Copy link
Contributor Author

Regarding arrows: should we have these as predefined shape type inside chemiscope? This will save a lot of space by not requiring to store all the vertices/simplices in the file, but instead generate them on the JS side like we do for ellispoids.

I agree, but I would like to do this as part of a separate PR in which we address the input format too. In the spirit of doing small incremental PRs.

@ceriottm ceriottm requested review from rosecers and Luthaf and removed request for rosecers August 28, 2023 18:03
python/chemiscope/structures/_shapes.py Outdated Show resolved Hide resolved
This allows to visualize vectorial and tensorial properties for each atom.
@Luthaf
Copy link
Contributor

Luthaf commented Aug 29, 2023

I agree, but I would like to do this as part of a separate PR in which we address the input format too. In the spirit of doing small incremental PRs.

This is tracked in #291!

@Luthaf Luthaf merged commit 87f9ff6 into master Aug 29, 2023
9 checks passed
@Luthaf Luthaf deleted the feat/shapes_jupyter branch August 29, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants