-
Notifications
You must be signed in to change notification settings - Fork 22
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
Psi4 adapter #519
base: main
Are you sure you want to change the base?
Psi4 adapter #519
Conversation
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.
Looking good, thanks! Please see some comments and questions
This pull request introduces 1 alert and fixes 2 when merging 09ac7f5 into ef0d5c6 - view on LGTM.com new alerts:
fixed alerts:
|
LGTM eventually completed after 12 hrs... It complains about unused imports |
This pull request introduces 2 alerts and fixes 4 when merging fe3ceb0 into 2661d86 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request fixes 4 alerts when merging ab998cf into 2661d86 - view on LGTM.com fixed alerts:
|
This pull request fixes 4 alerts when merging 9ea351a into 542528b - view on LGTM.com fixed alerts:
|
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.
Thanks! Please see some comments below
arc/job/adapters/psi_4.py
Outdated
dft_spherical_points {dft_spherical_points} | ||
dft_radial_points {dft_radial_points} | ||
dft_basis_tolerance {dft_basis_tolerance} | ||
dft_pruning_scheme robust |
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.
Does this line work, or is it problematic as we saw?
arc/job/adapters/psi_4Test.py
Outdated
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(testRunner=unittest.TextTestRunner(verbosity=2)) |
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.
please add an empty line at the end of the file
arc/job/adapters/psi_4.py
Outdated
self.execution_type = execution_type or 'queue' | ||
self.command = 'psi4.py' | ||
self.execution_type = execution_type or 'incore' | ||
self.command = ['psi4'] |
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.
Should this be imported from the incore commands in submit.py?
arc/scheduler.py
Outdated
@@ -54,6 +54,7 @@ | |||
xyz_to_coords_list, | |||
xyz_to_str, | |||
) | |||
from arc.settings.settings import default_incore_adapters |
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.
important: we don't import directly from settings.py
. Instead, we have from arc.imports import settings
on line 34, and we use this settings dict as in lines 67-70 below. Please modify this import as well. Let's talk about this more
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 above import comment is critical, please take a look
arc/job/adapters/psi_4.py
Outdated
@@ -18,7 +18,7 @@ | |||
set_job_args, | |||
which) | |||
from arc.job.factory import register_job_adapter | |||
from arc.job.local import execute_command, submit_job | |||
from arc.job.local import execute_command, rename_output, submit_job |
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.
please squash this commit into the Psi4 adapter commit
This pull request introduces 2 alerts and fixes 4 when merging 5b04571 into 6dc1de3 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 3 alerts and fixes 4 when merging 4f0e6a0 into 05e5ab6 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 4 when merging 2b0588c into 05e5ab6 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 4 when merging 58380b4 into 05e5ab6 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 4 when merging dc41b2a into 58b5698 - view on LGTM.com new alerts:
fixed alerts:
|
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.
Thanks, @kfir4444 !
Please see some comments. Also, I'm not sure I saw a in the commits a deletion of the incore_adapters_dict when it got relocated to settings. Could you check?
arc/job/adapters/psi_4.py
Outdated
@@ -194,7 +140,7 @@ def __init__(self, | |||
|
|||
self.job_adapter = 'psi4' | |||
self.execution_type = execution_type or 'incore' | |||
self.command = 'psi4.py' | |||
self.command = ["psi4", "-i", "input.dat, -o", "output.dat"] |
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 make this a single entry list, otherwise it might be confusing, e.g., this instance is missing "
between input.dat
and -o
.
Try: ['psi4 -i input.dat -o output.dat']
arc/job/adapters/psi_4.py
Outdated
@@ -263,7 +209,7 @@ def __init__(self, | |||
self.server = self.args['trsh']['server'] if 'server' in self.args['trsh'].keys() \ | |||
else self.ess_settings[self.job_adapter][0] if isinstance(self.ess_settings[self.job_adapter], list) \ | |||
else self.ess_settings[self.job_adapter] | |||
self.label = self.species[0].label | |||
self.species_label = self.species[0].label | |||
if len(self.species) > 1: |
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 __init__
should be cleaned very aggressively. It should call the _initialize_adapter function, and only add minor additions to it. Please see the implementation in the other adapters
arc/job/adapters/psi_4.py
Outdated
elif self.job_type == 'freq': | ||
func = 'frequency' | ||
elif self.job_type == 'scan': | ||
pass |
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.
if scans are not implemented yet, then shouldn't we raise the NotImplementedError as below?
arc/job/adapters/psi_4.py
Outdated
else: | ||
raise NotImplementedError(f'Psi4 job type {self.job_type} is not implemented') | ||
|
||
dft_spherical_points = 302 if self.fine else 590 |
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 may have got these three lines in reverse. It looks like dft_spherical_points
should be 590 if a fine
grid is desired, otherwise use 302.
Can you double check in the Psi4 manual that this is indeed the desired behavior for a fine grid, and correct these three lines accordingly?
arc/job/adapters/psi_4.py
Outdated
dft_basis_tolerance {dft_basis_tolerance} | ||
}} | ||
""" | ||
# dft_pruning_scheme robust |
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 this a leftover? Should this be deleted or put in actual code?
arc/scheduler.py
Outdated
@@ -54,6 +54,7 @@ | |||
xyz_to_coords_list, | |||
xyz_to_str, | |||
) | |||
from arc.settings.settings import default_incore_adapters |
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 above import comment is critical, please take a look
This pull request introduces 1 alert and fixes 3 when merging c053c3c into 58b5698 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 3 when merging 07c3ce8 into d60a51d - view on LGTM.com new alerts:
fixed alerts:
|
Default as incore adapter.
59752c2
to
ee00e38
Compare
job_adapter = level.software | ||
if level.software == None: |
Check notice
Code scanning / CodeQL
Testing equality to None
from arc.job.adapters.common import (_initialize_adapter, | ||
check_argument_consistency, | ||
set_job_args, | ||
update_input_dict_with_args, | ||
which) | ||
which, | ||
) |
Check notice
Code scanning / CodeQL
Unused import
A functioning Psi4 adapter.