Repository navigation
feat: preserve constituent data in magnetic CIF exports - #20
Merged
Merged
Conversation
…orts Co-Authored-By: Codex <noreply@openai.com>
lan496
marked this pull request as ready for review
October 12, 2026 11:45
Co-Authored-By: Codex <noreply@openai.com>
Replace parallel chemistry arguments with Structure metadata, preserve reader rows, and honor caller tolerances through symmetry and serialization. Co-Authored-By: Codex <noreply@openai.com>
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
Mixed magnetic sites could not be exported faithfully. Both writers now consume
ordinary pymatgen
Structuredata with complete constituent chemistry,Cartesian
magmom, and an optional booleanmagneticproperty. Use coincidentrows for partial magnetic selection.
SpinCifWriter.from_structurematchesthese rows to the SSA model and accepts proper or improper spin frames;
from_orientedpreserves the supplied chemistry. Published array and occupancyinterfaces remain supported.
The reader preserves constituent rows, including unequal coincident moments and
explicit magnetic zeros. Writers group equivalent rows for their symmetry
backends and require a shared selected vector. Typed species identities and
lossless decimal output preserve fractional oxidation states, occupancies, weak
moments, and general-origin translations. Caller tolerances control position,
moment, and frame checks. Malformed loops and loss during pymatgen conversion
raise explicit errors.
Test plan
python -O.read/write preservation, equivalent constituent partitions, trace occupancy
loss, reordered SSA matching, legacy occupancy overrides, nonzero-k
antitranslations, and proper/improper frames.
symprec=1e-11, versus4e-9before replacement. Weak1e-10componentssurvive serialization.