v1.8.0: TransitionTable display, pymatgen-core, Python 3.11+#70
Merged
v1.8.0: TransitionTable display, pymatgen-core, Python 3.11+#70
Conversation
TransitionTable previously had no useful string representation, requiring custom helpers or pandas to display transition data. Add formatted text output via __str__ and HTML table output via _repr_html_ for Jupyter notebooks. Format auto-detects from the matrix dtype: integer for counts, 3 decimal places for probabilities.
- Add circumradii example to comparing_site_definitions tutorial, demonstrating sphere overlap and the persistence rule - Define inradius and circumradius terms on first use - Clean up argyrodite tutorial: use dict+loop for site types, fix prerequisites text, add sub/superscripts for chemical formulae, remove speculative mechanism discussion - Simplify residence_times_and_transitions tutorial code - Fix tutorials.md to use HTML sub/superscripts for Li6PS5Cl
Annotate the return type of structure.copy() explicitly, as pymatgen-core 2026.3.9 does not expose a typed return on all platforms.
The library only uses pymatgen.core directly. The full pymatgen package (needed for io.vasp and symmetry in tests/benchmarks) moves to a dev dependency.
Required by pymatgen-core, which only supports 3.11+.
- Fix "unambigious" typo in comparing_site_definitions tutorial - Remove empty trailing code cell from the same notebook - Add Displaying Tables section to the transition tables guide
Remove pandas DataFrame wrapping now that TransitionTable has __str__ and _repr_html_ methods.
…ites - Escape user-provided keys in _repr_html_ to prevent HTML injection - List pymatgen in prerequisites for tutorials that import pymatgen.io.vasp
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reject non-numeric dtypes at construction time rather than relying on formatting to catch them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__str__and_repr_html_toTransitionTablefor readable output in terminals and Jupyter notebooksTransitionTablematrix has numeric dtype at construction time_repr_html_keys to prevent injectionTransitionTabledisplay directly in tutorials instead of wrapping inpd.DataFramepymatgentopymatgen-core; fullpymatgenmoved to dev dependenciesno-any-returnforStructure.copy()on LinuxCloses #43