-
Notifications
You must be signed in to change notification settings - Fork 9
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
Globally set RDKit to include all properties when pickling an RDKit Mol #344
Conversation
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 would like to see more tests on this please - it's not immediately clear to me that this doesn't change the behaviour and I would like to be sure it doesn't.
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.
Meant this as a request changes.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #344 +/- ##
=======================================
Coverage 98.50% 98.50%
=======================================
Files 37 37
Lines 2143 2147 +4
=======================================
+ Hits 2111 2115 +4
Misses 32 32 ☔ 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.
@dotsdl I think we can go with this one, but it would be good to a) make sure we aren't creating big file (especially with ProteinComponents) - I could see this becoming an issue when you have large PDBs (maybe a fully solvated system?), b) it doesn't break any backwards compatibility.
I'm not 100% sure on the latter, it shouldn't have an impact, but we'd need some kind of migration test (maybe something you already do in alchemiscale?). The former should be easy, we can take a big PDB file, serialize it, and see what breaks?
@IAlibay thanks for this! This should have no impact on files, since we don't/can't support pickle files as a stable form of serialization written to disk. It is important, however, when using tools like |
As an alternative, we could switch See this comment for explanation: rdkit/rdkit#6573 (comment) |
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.
Probably needs a test.
@@ -9,6 +9,10 @@ | |||
# typing | |||
from ..custom_typing import RDKitMol | |||
|
|||
# globally set RDKit to include all properties when pickling an RDKit Mol | |||
# see issue #322: https://github.com/OpenFreeEnergy/gufe/issues/322 |
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.
Can you add a pickle test please? If that's the use case we're targeting then we should have a test for it.
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.
Will do! Good call.
I will add a test and a logger warning to the global settings change, and draft a follow-up issue proposing the use of |
Not finished with this; just quickly getting idea down
@IAlibay this is ready for another review. Instead of setting global state, we decided to only issue a warning when pickling is attempted on an |
…state__ warning condition
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.
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Closes #322.