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

Fpop support for CP2K #27

Merged
merged 14 commits into from
Jun 27, 2024
Merged

Conversation

Andy6M
Copy link
Contributor

@Andy6M Andy6M commented Jun 25, 2024

1.Description:
This Pull Request introduces CP2K support to the fpop framework, following the structure and conventions used for VASP and ABACUS integrations.

2.Changes:

2.1 Created a new folder cp2k under the examples directory.
Added necessary scripts and input files to support CP2K computations.
Code Implementation:

2.2 Developed the cp2k module with similar architecture to the existing vasp and abacus modules.

@Chengqian-Zhang
Copy link
Collaborator

Could you please add unittest(UT)? You can refer to the writeup of vasp and abacus in folder tests/

examples/cp2k/preprunvasp.py Outdated Show resolved Hide resolved
fpop/cp2k.py Outdated Show resolved Hide resolved
examples/cp2k/preprunvasp.py Outdated Show resolved Hide resolved
examples/cp2k/preprunvasp.py Outdated Show resolved Hide resolved
examples/cp2k/POSCAR-1 Outdated Show resolved Hide resolved
examples/cp2k/preprunvasp.py Outdated Show resolved Hide resolved
examples/cp2k/preprunvasp.py Outdated Show resolved Hide resolved
fpop/cp2k.py Outdated Show resolved Hide resolved
@Chengqian-Zhang
Copy link
Collaborator

I suggest changing the title from Fpop support for CP2K (Bohrium) to Fpop support for CP2K.

@Andy6M Andy6M changed the title Fpop support for CP2K (Bohrium) Fpop support for CP2K Jun 26, 2024
@Andy6M
Copy link
Contributor Author

Andy6M commented Jun 26, 2024

I suggest changing the title from Fpop support for CP2K (Bohrium) to Fpop support for CP2K.

I have updated the title as suggested. Thank you for your advice.

Andy6M and others added 3 commits June 26, 2024 13:55
Throw error if user does not specify command.
Remove the last blank line
@Andy6M
Copy link
Contributor Author

Andy6M commented Jun 26, 2024

Could you please add unittest(UT)? You can refer to the writeup of vasp and abacus in folder tests/

Thank you for your suggestion. 3 files have been added into 'test' folder.
tests/test_cp2k_inputs.py
tests/test_prep_cp2k.py
tests/test_run_cp2k.py
However, the first two python files run normally, but the last one seems to have issues running due to local dependency environment problems.

@Chengqian-Zhang Chengqian-Zhang self-requested a review June 27, 2024 07:03
fpop/cp2k.py Outdated
kwargs.pop("command", None)

# Execute command
ret, out, err = run_command(command, raise_error=False, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to ret, out, err = run_command(command, raise_error=False, **kwargs) # type: ignore can solve type checker error.

fpop/cp2k.py Outdated
def prep_task(
self,
conf_frame: dpdata.System,
cp2k_inputs: Cp2kInputs,
Copy link
Collaborator

Choose a reason for hiding this comment

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

change all cp2k_inputs in this function to inputs can solve this type check error.

if run_image_config:
command = run_image_config.get("command")
if not command:
raise ValueError("Command not specified in run_image_config")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we check this input before submission instead of runtime?

@Chengqian-Zhang Chengqian-Zhang merged commit 00d7497 into deepmodeling:master Jun 27, 2024
5 checks passed
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.

3 participants