-
Notifications
You must be signed in to change notification settings - Fork 850
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
Prefer pymatviz
interactive plotly version of periodic table heatmap if available
#3180
Conversation
Why keep both, if we’re referring people to functionality in pymatviz? We should probably have a strategy here. Similar issue with plotting functionality in crystal toolkit; generally, plotting changes there have been upstreamed to pymatgen, but only for plotters that already existed within pymatgen, because I didn’t want two variants of, say, PDPlotter in existence. Not all functionality has been moved yet, there are still Pourbaix plotting enhancements for example. |
@mkhorton That's the long-term plan. This is meant as the 1st step in a deprecation/migration phase. But happy to discuss other options. |
I would just note this - there will always be newer better packages coming up. There are two outcomes: 1. pymatgen depends on the new package for some functionality. or 2. that new package gets merged into pymatgen. For (1) to be accepted by me, the package has to deliver major functionality, have reasonable long-term maintenance, and does not depend on pymatgen itself. Something like numpy satisfies all three criteria. mp-api fails the last criterion. Right now, pymatviz fails at least one, if not all three criteria (it depends on pymatgen, and while I have confidence in Janosh's coding, pymatviz is not part of some long-term funded infrastructure). If (1) or (2) are not acceptable to either pymatgen maintainers or the author of the package in question, then the only other outcome is that it is an optional functionality that is used when present. That is what this PR is. |
@mkhorton Should I leave this PR open until further brainstorming? |
You can merge. |
This PR changes
periodic_table_heatmap()
which now tries to importptable_heatmap_plotly
frompymatviz
. If successful, all arguments are passed to that function along with deprecation messages for args that have different names inpymatviz.ptable_heatmap_plotly
vspymatgen.util.plotting.periodic_table_heatmap
.It does not add
pymatviz
as a new dependency ofpymatgen
to avoid circularity.Before
After
![ptable-heatmap-plotly-more-hover-data](https://private-user-images.githubusercontent.com/30958850/255689220-765286dd-f4d6-4e01-9822-88fa78065968.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2MzU4NTMsIm5iZiI6MTcyNTYzNTU1MywicGF0aCI6Ii8zMDk1ODg1MC8yNTU2ODkyMjAtNzY1Mjg2ZGQtZjRkNi00ZTAxLTk4MjItODhmYTc4MDY1OTY4LnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDE1MTIzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRlZjdiMWIxYWE3ODRhZGZlNWM0MmY1ZWMwOWFhMzQyOWNlMGQ1ZjA4YzgzYzNhNjMyNWRmMzNlNjcxNDZiMWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.P0kRc7_yX-UxQKNnuKsP_3tX-WFA41_bLL2E2RjlRpU)
Code