Skip to content
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

Consistent indices for StructureStorage.get_structures #482

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

pmrv
Copy link
Contributor

@pmrv pmrv commented Dec 16, 2021

Previously the index<->chemical element mapping was unspecified for structures returned from a storage. This works ok for single calculations since our jobs remap the indices, but crucially they only do it once for the first structure set on a job. So if you have two structures with an inconsistent mapping and put them through the same interactive job great despair ensues. The structures are passed correctly to lammps, but since the index mapping changed they are incorrectly saved in the HDF and using get_structure on that job will give from structures (with elements swapped). More details in the commit messages.

When not specifying indices when creating an Atoms, the mapping between
chemical element and index is not unique and may change.  For
calculations on single structures this is no problem, but when iterating
over a StructureStorage in a single (e.g. interactive) calculation this
may cause confusion, since the atomistic jobs generally only save the
indices of atoms across multiple steps.
indices is ignored when symbols is given, so instead we provide indices
and species, where species is just the set of elements occuring in the
structure.
@pmrv pmrv added the bug Something isn't working label Dec 16, 2021
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1587559486

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.007%) to 70.092%

Totals Coverage Status
Change from base Build 1581509622: 0.007%
Covered Lines: 11575
Relevant Lines: 16514

💛 - Coveralls

@stale
Copy link

stale bot commented Dec 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 30, 2021
@pmrv pmrv merged commit 129c4bd into master Jan 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the consistent_indices branch January 12, 2022 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants