-
Notifications
You must be signed in to change notification settings - Fork 174
QCSchema: add output writer #798
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
base: master
Are you sure you want to change the base?
Conversation
cclib/io/qcjsonwriter.py
Outdated
qcschema_dict["molecule"]["schema_version"] = 2 | ||
|
||
# FIXME hack | ||
qcschema_dict["driver"] = "energy" |
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.
Is the thought here to populate based on optdone
and the presence of certain attributes or by parsing metadata->input_file_contents
or something else?
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 we need to parse based on what's happened in the output file, rather than what's specified in the input file if possible, since programs can have a complex "path" through them when you specify even simple stuff. For example, if you say "I want a CCSD relaxed dipole moment", which is an "energy" calculation, you'll get the gradient, since calculating the coupled cluster density is expensive compared to calculating the integral derivatives, so your energy calculation has automatically turned into a gradient calculation even though it wasn't explicitly requested.
Looks like we will need to do extra work to keep the 2.x branch up to date, or only make PRs from the head of 2.x rather than master. |
cclib/io/qcjsonwriter.py
Outdated
qcschema_dict["provenance"]["creator"] = metadata["package"] | ||
qcschema_dict["provenance"]["version"] = metadata["package_version"] | ||
# FIXME | ||
qcschema_dict["provenance"]["routine"] = "" |
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.
Would we want something to indicate that this was created through cclib rather than by the metadata['package']
directly?
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.
In an ideal world, that's extra information that goes in the provenance in addition to the package. I can upload the provenance notes I took at the meeting, but I don't think the provenance substructure requires it right now.
I can try adding fields to the output that aren't part of the schema and see if it passes validation, I don't know if the validator ignores extra fields.
Also, this is a reminder that if we think something is missing from the schema, we (cclib) can request it to be added.
cclib/io/qcjsonwriter.py
Outdated
qcschema_dict["properties"]["scf_total_energy"] = convertor( | ||
self.ccdata.scfenergies[-1], "eV", "hartree" | ||
) | ||
|
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.
TODO mpenergies and mpenergy for return_result
(You might have planned to do this, just adding a note!)
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.
Problem: untangling correlation level for Moller-Plesset and coupled cluster energies within cclib...
@berquist - I don't know if you have thoughts about the QCSchema. I mentioned this work over at MolSSI/QCSchema#77 (e.g., how much do you care if it's a community-led schema vs. one pushed by MolSSI) |
552aa7a
to
88fa7e7
Compare
This is on hold until MolSSI/QCSchema#81 or a variation of it is merged. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #798 +/- ##
==========================================
- Coverage 87.79% 87.64% -0.15%
==========================================
Files 64 71 +7
Lines 13435 13414 -21
==========================================
- Hits 11795 11757 -38
- Misses 1640 1657 +17 ☔ 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.
Good fix for testing. Thanks. LGTM
|
||
scf_dipole_moment = None | ||
if hasattr(self.ccdata, "moments"): | ||
# FIXME We currently have no easy way to tell if the moments from |
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.
We should open an issue about this. I don't this there is an easy way to fix this. If we move to class based properties maybe we could fix this?
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.
Yes. Under the current idea, we would have all the different moments grouped together, but in a true provenance model, we would have all properties associated with an (un)relaxed density as children of said density.
"return_energy": return_energy, | ||
"scf_iterations": self.ccdata.scfvalues[-1].shape[0], | ||
"scf_total_energy": scf_total_energy, | ||
# TODO These properties aren't parsed yet. |
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.
Same here. Maybe an issue with a check list.
This will be reworked to use the https://github.com/openqcschema/openqcschema (QCElemental) schema. |
for more information, see https://pre-commit.ci
This is just a proof-of-concept to show in #643.Not a proof-of-concept, rather the first implementation.