Skip to content

Enhance pymatgen io functions to support system and atom extras - #605

Open
akwarii wants to merge 4 commits into
TorchSim:mainfrom
akwarii:main
Open

Enhance pymatgen io functions to support system and atom extras#605
akwarii wants to merge 4 commits into
TorchSim:mainfrom
akwarii:main

Conversation

@akwarii

@akwarii akwarii commented Sep 10, 2026

Copy link
Copy Markdown

Summary

Extends pymatgen related functions in torch_sim/io.py with system_extras_map/atom_extras_map keyword arguments, matching the API already available for ASE.

Right now this mimics the ASE implementation, i.e. the user must manually pass the fields (s)he want to copy. Would you consider making automatic copying of all fields the default behavior instead? It would be very valuable in high-throughput workflows such as atomate2, where the conversion is often called by an internal wrapper the end user has no way to pass a map through to.

Checklist

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format.
  • Run ruff on your code.
  • Tests have been added for any new functionality or bug fixes.

Updated state_to_structures and structures_to_state functions to accept optional extras maps for systems and atoms.

Signed-off-by: Gael Huynh <gael.huynh@gmail.com>
Add tests for system and atom extras mapping with pymatgen.

Signed-off-by: Gael Huynh <gael.huynh@gmail.com>
Signed-off-by: Gael Huynh <gael.huynh@gmail.com>
@akwarii

akwarii commented Sep 10, 2026

Copy link
Copy Markdown
Author

The tests errors seems unrelated to my PR

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.

1 participant