Skip to content

Fix Molecule.get_boxed_structure when reorder=False #4419

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

Merged
merged 1 commit into from
May 28, 2025

Conversation

gpetretto
Copy link
Contributor

@gpetretto gpetretto commented May 27, 2025

Summary

In Molecule.get_boxed_structure, when reorder=False, in the current version of the code does not use the processed new coordinates, but the initial ones of the Molecule. This usually results for example in a Molecule not being centered in the box.
Unless I am missing something there should be no reason not to use the modified coordinates in the case of reorder=False. This PR switches to use the same coordinates independently of the final sorting.

I added a test based on the coordinates that would have failed in the previous implementation due to the molecule not being centered in the box.

@gpetretto gpetretto requested review from shyuep and mkhorton as code owners May 27, 2025 09:09
@shyuep shyuep merged commit c6031ff into materialsproject:master May 28, 2025
43 checks passed
@shyuep
Copy link
Member

shyuep commented May 28, 2025

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