Skip to content

check for disordered structure#578

Merged
CompRhys merged 2 commits into
TorchSim:mainfrom
thomasloux:feat/add-error-disordered-io
Jun 17, 2026
Merged

check for disordered structure#578
CompRhys merged 2 commits into
TorchSim:mainfrom
thomasloux:feat/add-error-disordered-io

Conversation

@thomasloux

@thomasloux thomasloux commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Added a check and error if an input pymatgen structure is disordered.
Context is that otherwise the reported error when providing a structure with site defects is quite unclear.

"torch_sim/io.py", line 367, in structures_to_state
np.concatenate([[site.specie.atomic_mass for site in s] for s in struct_list]),
AttributeError: attr='specie' not found on PeriodicSite. Did you mean: 'species'?

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.

@CompRhys CompRhys merged commit 87dad4d into TorchSim:main Jun 17, 2026
60 of 64 checks passed
@CompRhys

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants