Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

berquist
Copy link
Member

@berquist berquist commented Feb 17, 2020

This is just a proof-of-concept to show in #643. Not a proof-of-concept, rather the first implementation.

qcschema_dict["molecule"]["schema_version"] = 2

# FIXME hack
qcschema_dict["driver"] = "energy"
Copy link
Member

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?

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 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.

@berquist berquist changed the title QCSchema: add stubs QCSchema: add output writer Jul 23, 2020
@berquist berquist modified the milestones: v1.6.4, v2.x Jul 23, 2020
@berquist berquist changed the base branch from master to 2.x July 23, 2020 14:55
@berquist berquist changed the base branch from 2.x to master July 23, 2020 14:55
@berquist
Copy link
Member Author

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.

qcschema_dict["provenance"]["creator"] = metadata["package"]
qcschema_dict["provenance"]["version"] = metadata["package_version"]
# FIXME
qcschema_dict["provenance"]["routine"] = ""
Copy link
Member

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?

Copy link
Member Author

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.

qcschema_dict["properties"]["scf_total_energy"] = convertor(
self.ccdata.scfenergies[-1], "eV", "hartree"
)

Copy link
Member

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!)

Copy link
Member Author

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...

@ghutchis
Copy link
Contributor

@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)

@berquist
Copy link
Member Author

This is on hold until MolSSI/QCSchema#81 or a variation of it is merged.

@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (d533158) 87.79% compared to head (274b985) 87.64%.
Report is 659 commits behind head on master.

❗ Current head 274b985 differs from pull request most recent head ff6e4ac. Consider uploading reports for the commit ff6e4ac to get more accurate results

Files Patch % Lines
cclib/io/qcschemawriter.py 74.15% 23 Missing ⚠️
cclib/io/cjsonwriter.py 0.00% 1 Missing ⚠️
cclib/io/qcschemareader.py 80.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@berquist berquist marked this pull request as ready for review January 10, 2022 14:34
Copy link
Member

@shivupa shivupa left a 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
Copy link
Member

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?

Copy link
Member Author

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.
Copy link
Member

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.

@berquist
Copy link
Member Author

This will be reworked to use the https://github.com/openqcschema/openqcschema (QCElemental) schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan building out support for QCSchema JSON

4 participants