-
Notifications
You must be signed in to change notification settings - Fork 81
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
updating open babel energy minimization to no longer use temp file #1078
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1078 +/- ##
=======================================
Coverage 90.54% 90.54%
=======================================
Files 61 61
Lines 6186 6190 +4
=======================================
+ Hits 5601 5605 +4
Misses 585 585 ☔ View full report in Codecov by Sentry. |
linux tests are failing...appears related to try to access atomic number. I think I need to check to make sure element is properly set. The bit of code in the energy_minimize function that tries to infer atom type from name, never actually set the element field with the atom info that was inferred. Not sure how the tests were every passing before. |
All tests are now passing after a quick change of the test_energy_minimize_non_element function to reflect the changes in the code itself. Interestingly, the incorrectly written test passed on macOS (both my local machine running pytest and CI), but appropriately failed on linux. The incorrectly written test did not raise an MBuildError like it should, but pytest didn't consider that a failure for some reason. I'm not seeing anything wrong in the syntax...maybe just a weird bug and I guess good that linux caught it.
|
I found a minor bug in the to_gmso function in the compound class. kwargs are not passed to the function conversion.to_gmso. This is detailed in #1081 |
… feature; changed function call and added todo for when feature is implemented
Tests were failing when I had to_gmso() properly pass kwargs, because tests were set up to handle the yet to be implemented infer_hierarchy (without passing kwargs infer_hierarchy would be ignored). I added in a TODO note to change the function call of the tests back when this is implemented. |
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.
I think a good chunk of conversion stuff already existed in the to_pybel
method, which I think should be used as the base here (fix/add new features as needed). The conversion back looks good.
I forget to delete this when I modified it. Co-authored-by: Co Quach <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
I think this is looking pretty much done.
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!
…e now called via functions in the Compound class
…e now called via functions in the Compound class
…e now called via functions in the Compound class
…e now called via functions in the Compound class
…e now called via functions in the Compound class
Read the docs is failing, but that can be addressed separately. |
PR Summary:
This is related to issue #1077. Rather that relying on a temporary .mol2 file to perform open babel energy minimization, this PR will directly set the relevant parameters in the open babel OBMol class, and extract energy minimized coordinates from this class for updating of the positions in the Compound.
My initial plan was to simply store Compound.name information, overwrite it with Compound.element before generating the .mol2 file, and then revert Compound.name parameters to the original entries. However, using the API directly to set the info seems like it would be better with less overhead.
PR Checklist