-
Notifications
You must be signed in to change notification settings - Fork 93
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 Molecule.from_qcschema
, notebook
#1763
Conversation
mattwthompson
commented
Nov 8, 2023
•
edited by j-wags
Loading
edited by j-wags
- Tag issue being addressed
- Add tests
- Update docstrings/documentation, if applicable
- Lint codebase
- Update changelog
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
||
client = qcportal.PortalClient("https://api.qcarchive.molssi.org:443") | ||
|
||
record = [*client.query_molecules(molecular_formula="C16H20N3O5")][-1] |
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 was previously [0]
, which regularly grabbed a record that did not have CMILES. There's probably a different index that's safer, since this assumes that all future records will have CMILES that the underlying toolkits can assign stereochemistry to, but that assumption seems relatively safe.
openff/toolkit/topology/molecule.py
Outdated
"The provided client can not query molecules, make sure it is an instance of" | ||
"qcportal.client.FractalClient() with the correct address." | ||
) | ||
"The provided client failed to query molecules, make sure it is an instance of" | ||
"`qcportal.PortalClient` and pointed to the correct address." | ||
) from error |
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 tried a bit to cover this in a test, but had difficulties getting a bad client that would fail in this particular way.
@@ -6,7 +6,7 @@ | |||
"source": [ |
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.
Entries store much information about the molecule, but not the geometry.
This doesn't appear to be true. Did this change in 0.50? entry.initial_molecule
is a 3D QC mol with coordinates and everything. Maybe 0.50 will require changes to Molecule.from_qcschema
, or maybe there was a reason we didn't take coords from entries? I need to come back to this when I continue this review.
Reply via ReviewNB
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.
No clue, I'm going off of this docstring which implies an initial geometry cannot be fetched when client=None
openff-toolkit/openff/toolkit/topology/molecule.py
Lines 4603 to 4605 in 9b23790
client : optional, default=None, | |
A qcportal.FractalClient instance to use for fetching an initial geometry. | |
Only used if ``qca_record`` is a dataset entry. |
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.
Molecule.from_qcshema
, notebookMolecule.from_qcschema
, notebook
for more information, see https://pre-commit.ci
Co-authored-by: Jeff Wagner <jeffrey.wagner+github@openforcefield.org>
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 looked through the source code (did not deeply pass over the QCSchema notebook or unit tests) and have non-blocking comments/suggestions
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.
Excellent. Thanks for the second set of eyes - You caught a lot of stuff that could be improved!
Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>
And so they're not lost to history - I took a few notes on this refactor here |