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

Psi4 adapter #519

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

kfir4444
Copy link
Collaborator

A functioning Psi4 adapter.

@kfir4444 kfir4444 requested a review from alongd June 28, 2022 10:04
Copy link
Member

@alongd alongd left a 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

arc/job/adapters/psi_4.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4Test.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4.py Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Jun 28, 2022

This pull request introduces 1 alert and fixes 2 when merging 09ac7f5 into ef0d5c6 - view on LGTM.com

new alerts:

  • 1 for Unused import

fixed alerts:

  • 2 for Unused import

@alongd
Copy link
Member

alongd commented Jun 29, 2022

LGTM eventually completed after 12 hrs... It complains about unused imports

@lgtm-com
Copy link

lgtm-com bot commented Jul 6, 2022

This pull request introduces 2 alerts and fixes 4 when merging fe3ceb0 into 2661d86 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Duplicate key in dict literal

fixed alerts:

  • 4 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 6, 2022

This pull request fixes 4 alerts when merging ab998cf into 2661d86 - view on LGTM.com

fixed alerts:

  • 4 for Unused import

@kfir4444 kfir4444 requested a review from alongd July 6, 2022 12:12
@lgtm-com
Copy link

lgtm-com bot commented Jul 10, 2022

This pull request fixes 4 alerts when merging 9ea351a into 542528b - view on LGTM.com

fixed alerts:

  • 4 for Unused import

Copy link
Member

@alongd alongd left a 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 Show resolved Hide resolved
dft_spherical_points {dft_spherical_points}
dft_radial_points {dft_radial_points}
dft_basis_tolerance {dft_basis_tolerance}
dft_pruning_scheme robust
Copy link
Member

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_4.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4Test.py Outdated Show resolved Hide resolved


if __name__ == '__main__':
unittest.main(testRunner=unittest.TextTestRunner(verbosity=2))
Copy link
Member

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

self.execution_type = execution_type or 'queue'
self.command = 'psi4.py'
self.execution_type = execution_type or 'incore'
self.command = ['psi4']
Copy link
Member

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/job/adapters/psi_4Test.py Show resolved Hide resolved
arc/job/adapters/psi_4Test.py Show resolved Hide resolved
arc/scheduler.py Outdated
@@ -54,6 +54,7 @@
xyz_to_coords_list,
xyz_to_str,
)
from arc.settings.settings import default_incore_adapters
Copy link
Member

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

Copy link
Member

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

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

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

@lgtm-com
Copy link

lgtm-com bot commented Jul 31, 2022

This pull request introduces 2 alerts and fixes 4 when merging 5b04571 into 6dc1de3 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Unreachable code

fixed alerts:

  • 4 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 15, 2022

This pull request introduces 3 alerts and fixes 4 when merging 4f0e6a0 into 05e5ab6 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Unnecessary 'else' clause in loop
  • 1 for Variable defined multiple times

fixed alerts:

  • 4 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 15, 2022

This pull request introduces 1 alert and fixes 4 when merging 2b0588c into 05e5ab6 - view on LGTM.com

new alerts:

  • 1 for Unnecessary 'else' clause in loop

fixed alerts:

  • 4 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 15, 2022

This pull request introduces 1 alert and fixes 4 when merging 58380b4 into 05e5ab6 - view on LGTM.com

new alerts:

  • 1 for Unnecessary 'else' clause in loop

fixed alerts:

  • 4 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2022

This pull request introduces 1 alert and fixes 4 when merging dc41b2a into 58b5698 - view on LGTM.com

new alerts:

  • 1 for Unnecessary 'else' clause in loop

fixed alerts:

  • 4 for Unused import

@kfir4444 kfir4444 requested a review from alongd August 16, 2022 09:05
Copy link
Member

@alongd alongd left a 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?

@@ -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"]
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 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']

@@ -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:
Copy link
Member

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

elif self.job_type == 'freq':
func = 'frequency'
elif self.job_type == 'scan':
pass
Copy link
Member

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?

else:
raise NotImplementedError(f'Psi4 job type {self.job_type} is not implemented')

dft_spherical_points = 302 if self.fine else 590
Copy link
Member

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?

dft_basis_tolerance {dft_basis_tolerance}
}}
"""
# dft_pruning_scheme robust
Copy link
Member

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/job/adapters/psi_4Test.py Outdated Show resolved Hide resolved
arc/job/adapters/psi_4Test.py Show resolved Hide resolved
arc/scheduler.py Outdated
@@ -54,6 +54,7 @@
xyz_to_coords_list,
xyz_to_str,
)
from arc.settings.settings import default_incore_adapters
Copy link
Member

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

@lgtm-com
Copy link

lgtm-com bot commented Aug 23, 2022

This pull request introduces 1 alert and fixes 3 when merging c053c3c into 58b5698 - view on LGTM.com

new alerts:

  • 1 for Unnecessary 'else' clause in loop

fixed alerts:

  • 3 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 25, 2022

This pull request introduces 1 alert and fixes 3 when merging 07c3ce8 into d60a51d - view on LGTM.com

new alerts:

  • 1 for Unnecessary 'else' clause in loop

fixed alerts:

  • 3 for Unused import

@kfir4444 kfir4444 added Topic: ESS Electronic Structure Software Type: Feature labels Aug 25, 2022
@kfir4444 kfir4444 requested a review from alongd August 25, 2022 18:46
job_adapter = level.software
if level.software == None:

Check notice

Code scanning / CodeQL

Testing equality to None

Testing for None should use the 'is' operator.
Comment on lines +17 to +21
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

Import of 'check_argument_consistency' is not used. Import of 'set_job_args' is not used. Import of 'which' is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Job Topic: ESS Electronic Structure Software Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants