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

nwc: tce general cases fix #98

Merged
merged 3 commits into from Jun 30, 2019
Merged

nwc: tce general cases fix #98

merged 3 commits into from Jun 30, 2019

Conversation

vivacebelles
Copy link
Contributor

Adding back capability of NWChem's harvester to pull TCE options that have been able to in QCDB.

@codecov
Copy link

codecov bot commented Jun 28, 2019

Codecov Report

Merging #98 into master will not change coverage.
The diff coverage is n/a.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 28, 2019

This pull request introduces 1 alert when merging 34aecc5 into bb1797e - view on LGTM.com

new alerts:

  • 1 for Suspicious unused loop iteration variable

for cc_name in [r'CCSD', r'CI', r'LCC']:
mobj = re.findall(
r'^\s+' + r'Iterations converged' + r'\s*' +
r'^\s+' + r'(.*?)' + r' correlation energy / hartree' + r'\s+=\s*' + NUMBER + r'\s*'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the findall --> search, (.*?) --> cc_name patterns like mbpt and (t) above would be better here.

@vivacebelles
Copy link
Contributor Author

Spoke too soon! Need to adjust, so doesn't interfere with special TCE test cases.

for cc_name in [r'CISD', r'CISDT', r'CISDTQ', r'CCD', r'CCSD', r'CCSDT', r'CCSDTQ', r'LCCSD', r'LCCD']:
mobj = re.findall(
r'^\s+' + r'Iterations converged' + r'\s*' +
r'^\s+' + cc_name + r' correlation energy / hartree' + r'\s+=\s*' + NUMBER + r'\s*'+
Copy link
Collaborator

Choose a reason for hiding this comment

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

this preferred because it doesn't hardcode the spaces before correlation energy / the way the above does.

for mobj_list in mobj:
print('matched %s'% cc_name)
print(mobj)
psivar[f'%s CORRELATION ENERGY' % cc_name] = mobj_list[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

can use f-strings like the blocks above. and just if mobj when back to re.search

# outtext, re.MULTILINE | re. DOTALL)
#Process other TCE cases
for cc_name in [r'CISD', r'CISDT', r'CISDTQ', r'CCD', r'CCSD', r'CCSDT', r'CCSDTQ', r'LCCSD', r'LCCD']:
mobj = re.findall(
Copy link
Collaborator

Choose a reason for hiding this comment

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

The for cc_name in [ loop is taking the place of the re.findall, so this should be ok as re.search

Copy link
Collaborator

@loriab loriab left a comment

Choose a reason for hiding this comment

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

lgtm! thanks for iterating.

@loriab loriab merged commit 21a0d6b into MolSSI:master Jun 30, 2019
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.

None yet

2 participants