Skip to content
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

Merged
merged 36 commits into from
Jan 24, 2024
Merged

Update Molecule.from_qcschema, notebook #1763

merged 36 commits into from
Jan 24, 2024

Conversation

mattwthompson
Copy link
Member

@mattwthompson mattwthompson commented Nov 8, 2023

Copy link

Check out this pull request on  ReviewNB

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]
Copy link
Member Author

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.

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Merging #1763 (d0bb1f5) into main (9b23790) will increase coverage by 0.03%.
Report is 8 commits behind head on main.
The diff coverage is 98.07%.

Additional details and impacted files

Comment on lines 4686 to 4699
"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
Copy link
Member Author

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.

@mattwthompson mattwthompson marked this pull request as ready for review November 16, 2023 17:37
@@ -6,7 +6,7 @@
"source": [
Copy link
Member

@j-wags j-wags Dec 2, 2023

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

Copy link
Member Author

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

client : optional, default=None,
A qcportal.FractalClient instance to use for fetching an initial geometry.
Only used if ``qca_record`` is a dataset entry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming back to this... yup, this changed in QCFractal. It's a good change, but I'll need to update the from_qcschema method.

Old QCF (naively fetched entries DON'T have geometry):
Screen Shot 2023-12-04 at 8 01 53 AM

New QCF (naively fetched entries DO have geometry):
Screen Shot 2023-12-04 at 8 02 05 AM

@j-wags j-wags changed the title Update Molecule.from_qcshema, notebook Update Molecule.from_qcschema, notebook Dec 11, 2023
docs/releasehistory.md Outdated Show resolved Hide resolved
Copy link
Member Author

@mattwthompson mattwthompson left a 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

openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Show resolved Hide resolved
Copy link
Member

@j-wags j-wags left a 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!

openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
openff/toolkit/topology/molecule.py Outdated Show resolved Hide resolved
j-wags and others added 2 commits January 18, 2024 10:48
Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>
@j-wags
Copy link
Member

j-wags commented Jan 18, 2024

And so they're not lost to history - I took a few notes on this refactor here

@j-wags j-wags merged commit b479325 into main Jan 24, 2024
18 checks passed
@j-wags j-wags deleted the new-qcarchive branch January 24, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants