-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix mass type in convert_parmed #754
Conversation
@CalCraven I noticed that in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good, yeah it seems the .value() function is returning a numpy array since unyt always treats it's elements as unyt_array objects. Since mass should always be a singular value, I think this should work fine.
It's also nice to know things are lossless to and from parmed. Would it be worthwhile to add a single test for a typed molecule with impropers to make sure those are handled correctly? I think there's a typed_dimethylnitroaniline molecule in base_tests that could be used.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #754 +/- ##
==========================================
- Coverage 91.95% 91.94% -0.02%
==========================================
Files 67 67
Lines 6815 6814 -1
==========================================
- Hits 6267 6265 -2
- Misses 548 549 +1
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @marjanAlbouye
I think you're right, structure can be removed from that function. My guess is it's leftover code from something that did need it at some point. the pmd_atom isn't made in that function though, it's the Because those objects are still in memory when the function is called, and after it's finished, essentially the attribute is saved as soon as they're assigned, and don't need to [get passed back to the top level function](_atom_types_from_gmso(top, structure, atom_map)) and assigned there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I found the following error in a test script where a GMSO topology is first converted to a Parmed structure using
to_parmed
and then the same structure is converted back to GMSO topology usingfrom_parmed
.Here's the test script:
error:
The source of error is the incorrect type of
atype_mass
in_atom_types_from_gmso
method, which should be float rather than numpy array.