add kwarg to MoleculeGraph method and fix PackmolSet bug#2927
Merged
janosh merged 8 commits intomaterialsproject:masterfrom Apr 4, 2023
Merged
add kwarg to MoleculeGraph method and fix PackmolSet bug#2927janosh merged 8 commits intomaterialsproject:masterfrom
janosh merged 8 commits intomaterialsproject:masterfrom
Conversation
Member
|
Thanks @orionarcher! 👍 |
Contributor
Author
|
Thank you @janosh! |
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
The get_disconnected_fragments method returns a new graph with reordered indices but provides no way to get the mapping from new to original indices. This PR reconstructs that map and adds an optional keyword argument to return it. This will not affect current functionality.
Additionally, I found an error in the
pymatgen.io.packmolcode where a non-abstract class had an abstract method, preventing it from being instantiated. This slipped under the radar because the tests are skipped due to a difficult dependency (packmol). The tests are now passing locally for me.A downstream code I am working on requires this addition.
return_index_mapkwarg for MoleculeGraph.get_disconnected_fragmentsabc.abstractmethoddecorator fromPackmolBoxGen.get_input_set()Checklist
mypy path/to/file.pyto type check your code.