Fix a bug in converting units for List[System]#174
Open
GardevoirX wants to merge 1 commit intometatensor:mainfrom
Open
Fix a bug in converting units for List[System]#174GardevoirX wants to merge 1 commit intometatensor:mainfrom
List[System]#174GardevoirX wants to merge 1 commit intometatensor:mainfrom
Conversation
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.
In
_convert_systems_units, we calculate the unit conversion factor,conversion, for length, and then we enter a for-loop, to apply the conversion to systems:metatomic/python/metatomic_torch/metatomic/torch/model.py
Lines 933 to 949 in 475fab2
However, when there are additional inputs attached to a system, to convert them to our requested unit, we calculate the conversion factor, and also store it in
conversion:metatomic/python/metatomic_torch/metatomic/torch/model.py
Lines 976 to 983 in 475fab2
This covers the original conversion factor, and in the next round of for-loop, we are using a wrong length conversion factor.
This is fixed by renaming the conversion factor used for length to
length_conversion, but I am not sure if it's the best solution, and if we need to add some tests to prevent this from happening again in futureContributor (creator of pull-request) checklist
Reviewer checklist