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
Conversation
This pull request introduces 1 alert when merging 34aecc5 into bb1797e - view on LGTM.com new alerts:
|
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*' |
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 the findall --> search, (.*?)
--> cc_name
patterns like mbpt and (t) above would be better here.
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*'+ |
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.
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] |
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.
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( |
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.
The for cc_name in [
loop is taking the place of the re.findall
, so this should be ok as re.search
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.
lgtm! thanks for iterating.
Adding back capability of NWChem's harvester to pull TCE options that have been able to in QCDB.