Conversation
|
hi @berquist , hope everything is going well! I'd like to include similar data for ORCA and NWChem (I only added the GoodVibes parameters for Gaussian). Did you start working on this pull request or I can make a couple more changes to my local cclib code? Thanks! |
berquist
left a comment
There was a problem hiding this comment.
The most important comment I can give is the one about breaking up this PR into smaller ones based on bug fixes and feature additions.
For the new attributes, #1093 (comment) and the documentation were not clear enough about
- what should be placed as attributes on
ccData, - what should be a calculation method (under
cclib/methods), and - what should be placed in metadata (
ccData.metadata, a string to any type dict, https://cclib.readthedocs.io/en/latest/data_notes.html#metadata).
I see you put a bunch of stuff under the JSON path for metadata. This is good, but makes me realize that there is no guiding documentation about what to put there, and also that metadata is actually an attribute itself (the one linked above). Rather than let this review sit even longer, though we'll want to change a bunch of locations of things, can you split this PR apart first?
| break | ||
| lines.append(line[line.find('> ')+2:]) | ||
| if 'printlevel mini' in line or 'miniprint' in line: | ||
| print("WARNING: print level is set to mini, which might cause the loss of relevant information") |
There was a problem hiding this comment.
Can you use a logger warning instead?
| if "Zero-point correction" in line: | ||
| self.set_attribute('zpve', float(line.split()[2])) | ||
| zpve = utils.convertor(utils.float(line.split()[2]), "hartree", "eV") | ||
| self.set_attribute('zpve', zpve) |
| charges.append(float(nline.split()[2])) | ||
| spins.append(float(nline.split()[-1])) | ||
| self.atomcharges["natural"] = charges | ||
| try: |
There was a problem hiding this comment.
I think could lead to not saving the spins if they've been parsed but the attribute isn't there, so it should be something like
if spins:
if not hasattr(self, "atomspins"):
self.set_attribute("atomspins", {})
self.atomspins["natural"] = spinsThere was a problem hiding this comment.
Also, could you refactor this and the line that gets the atomic charges so that there's only one nline.split() call and the tokens are reused?
There was a problem hiding this comment.
I refactored it, however, this code comes from a previous version that doesn't separate Mulliken & NBO charges and spins (i.e. NBO charges and spins just override Mulliken values). Should I separate charges and spins into charges Mulliken, charges NBO, spins Mulliken and spins NBO?
There was a problem hiding this comment.
Should I separate charges and spins into charges Mulliken, charges NBO, spins Mulliken and spins NBO?
Yes please! This must have been an oversight and I can definitely see people would want clearly identified NBO properties. This means parsed output of any NBO calculation right now is incorrect.
There was a problem hiding this comment.
it's ready in PR #1141 - good thing is that this issue only caused problems in open-shell systems (i.e. wrong NBO charges and missing NBO spins). For closed-shell systems, older versions of cclib got the charges right and separated Mulliken from NBO
|
|
||
| line = next(inputfile) | ||
| while len(line) > 20: # restricted calcs are terminated by ------ | ||
| while len(line) > 20 and not 'Total SCF time' in line: # restricted calcs are terminated by ------ |
There was a problem hiding this comment.
Can you break up this and the other fixes into separate PRs from the attribute and metadata additions? I will give an initial review for all of them in one pass right now, but it will be easier to have discussions with multiple things on multiple PRs.
Pull request related to issue #1092. The code broke due to a problem related to the mini print level of ORCA.
Changes:
I'm attaching the output files from ORCA and the json files generated with ccwrite, please let me know if you need more information!
TESTS.zip
Pull request related to issue #1093. There was a bug when retrieving the NBO (natural) charges for open-shell systems, since the code retrieved only the charges from the b-density rather than the total density. The code also includes new parameters in the json files generated with ccwrite from Gaussian calculations that GoodVibes and AQME use (already commented to @berquist):
Parameters from NMR calcs

Metadata

Symmetry point group, rotational constants and T

Information about <S**2> before and after spin annihilation

Corrected natural (NBO) charges and spins

Wiberg bond order matrix (from NBO)

Other fixes and additions: