-
Notifications
You must be signed in to change notification settings - Fork 78
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
Update for upcoming OpenFF Toolkit API breaks #191
Conversation
- pip: | ||
- git+https://github.com/openforcefield/openff-toolkit.git@topology-biopolymer-refactor |
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.
If you don't want to shoulder the complexity of testing against an unreleased version, you can grab it with a similar command locally (pip install git+https://github.com/openforcefield/openff-toolkit.git@topology-biopolymer-refactor
) and have a look around for yourself.
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.
And for the record: I'm not suggesting this change be merged in; I want to show in the context of this PR that it should pass with the new API. I will revert this before merging if approved.
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.
Thanks for this! We should test against both the current and preview versions, ideally. But to do that, we can't just eliminate testing the current version---I'll have to rework the test matrix.
element_counts = defaultdict(int) | ||
for atom in molecule.atoms: | ||
symbol = atom.element.symbol | ||
symbol = atom.element.symbol if uses_old_api else atom.symbol |
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.
Oh, that's an unexpected change.
@mattwthompson, can you point to some information about the motivation for this? Is the idea that Atom
objects don't have to be physical elements anymore?
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.
And if symbol
supports non-physical elements or made-up symbols now, is there an API for telling whether the element is a real element or not?
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 is the PR where the change happened: openforcefield/openff-toolkit#1182
It comes from switching to a different package.
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.
@jchodera this is the only modification needed to get openmmforcefields working with the changes in the openff-toolkit/openff-element and given they are done in a backwards compatible way, I am happy with them. If you are happy with it, I can make a new PR add this changes + tests the latest version of the openff-toolkit.
Thanks for this, @mattwthompson! I'll need to finish up #182 first, but then will tackle integrating this PR. |
It would be great if this could get merged, this is breaking stuff for openfe currently |
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.
Thanks!
Thanks! |
Unfortunately our tests are still failing; I think L966 in this loop needs a similar change: openmmforcefields/openmmforcefields/generators/template_generators.py Lines 960 to 967 in a59b144
if I had to guess, I didn't notice this previous because I was grepping around for |
* Ensure 0.11.0 RC version of toolkit is installed * Possible fix to finish #191 * Try to ensure bash args thing is passed through * Naive unit refactor * Work through tests * Update CI matrix * Use mamba for development * Debug, add boilerplate .gitignore * Fix syntax * make sure the package didn't get installed before we install it * Do not install Espaloma * Fix some unit registries in tests * install espaloma, but remove openmmforcefields * add back in espaloma * switch to micromamba * Explicitly move ffxml sources into entry point * Remove symlinking * Add boilerplate `.gitignore` * Update package installation in CI * Fix finding Amber files in test * Soft import whatever units module is used by the toolkit * Switch to micromamba for setting up conda environment Add boilerplate `.gitignore` file Do not pull from non-standard labels Install instead of update Try to figure out why if: {{ false }} still triggers Syntax? Tinker Bring in (full) mamba Bash thing everywhere Bring down old toolkit Do not present un-loadable ff14SB port as available More pins * Fix YAML syntax * Use pip * More fixes * No particles * Fix unit serialization * Fix Atom.element calls * Update some tests * Clean up un-used imports * Fix more tests * Fix more tests * Exclude Python 3.10 on macOS * Skip ff14SB being treated as a small molecule * Fix test * Track duration of longest 20 tests * Update action versions * Try to fix exclusions in CI matrix * Fix pathing in Amber conversion * Run `pyupgrade --py38-plus` * Try directly uploading coverage report * Fix syntax * Add back some tests * Debug * Drop `pytest-xdist` arg * Fiddle with path * Just try to get stuff passing * Try uploading again * Switch back to codecov * Simply coverage reporting * Allow 0 coverage * Simplify coverage arguments * Add `__init__.py` in `/tests/` submodule https://stackoverflow.com/a/60579142 * Add `__init__.py` in `/tests/` submodule https://stackoverflow.com/a/60579142 * Simplify coverage arguments * Add back durations argument * Apply suggestions from code review * only upload report if it is not scheduled Co-authored-by: Matthew W. Thompson <mattwthompson@protonmail.com>
Hi OpenMM developers,
I'm seeing some test failures in our example that uses
openmmforcefields
with our big biopolymer feature branch, probably due toAtom.element
being removed in our upcoming API break. This change should fix that and be backwards-compatible.