-
Notifications
You must be signed in to change notification settings - Fork 92
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 missing sigma/rmin_half attrs #750
Conversation
Unfortunately, I think we're in a tough spot, since the most fundamental thing the toolkit should support is faithful round-tripping of OFFXML files. So I don't think a solution that converts The only solution I can think of is a hidden attribute that records "which representation was most recently set" for each |
I can't say I find it to be a satisfying solution, but I also can't think of anything better, and this requires the least sweeping changes to the codebase as is.
Could you expand on the details a little bit? What are the exact requirements for this condition to be satisfied? This appears to currently be be tested, although I'd add that a naive check (below) and the existing serialization tests in
is a requirement that's explicitly checked in the tests. I did one test by hand (with recent changes) and the mainline files are exported with In [1]: from openforcefield.typing.engines.smirnoff import ForceField
In [2]: parsley = ForceField('openff-1.3.0.offxml')
In [3]: parsley.to_file('out.offxml')
In [4]: round_trip = ForceField('out.offxml')
In [5]: parsley == round_trip # this checks id(obj) so it should never pass
Out[5]: False
In [6]: hash(parsley) == hash(round_trip)
Out[6]: True |
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.
This looks good, and I couldn't find a way to confuse this system while playing around locally. Good work implementing a significant new behavior into the existing codebase in like, 30 lines. That's really impressive.
I've added a suggestion that should bring your line count down lower. Can't let you pad those github stats :-P
Be sure to update the releasenotes before you merge!
Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>
#537
TODO:
sigma
, despite our force fields being shipped withrmin_half
Boilerplate: