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

Customize oxygen pseudo supported #234

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions aiida_sssp_workflow/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
@options.OverridableOption(
"--pw-code", "pw_code", type=types.CodeParamType(entry_point="quantumespresso.pw")
)(required=True)
@click.option(
"--oxygen-pseudo",
"oxygen_pseudo",
type=click.Path(exists=True),
help="Oxygen pseudo to use for oxides precision measure workflow.",
)
@options.OverridableOption(
"--pw-code-large-memory",
"pw_code_large_memory",
Expand Down Expand Up @@ -115,6 +121,7 @@ def launch(
walltime,
num_mpiprocs,
pseudo,
oxygen_pseudo,
clean_workdir,
daemon,
comment,
Expand Down Expand Up @@ -240,6 +247,12 @@ def launch(
if pw_code_large_memory:
inputs["pw_code_large_memory"] = pw_code_large_memory

if oxygen_pseudo:
with open(oxygen_pseudo, "rb") as stream:
oxygen_pseudo = UpfData(stream)

inputs["measure"]["oxygen_pseudo"] = oxygen_pseudo

if len(configuration) == 0:
pass
elif len(configuration) == 1:
Expand Down
1 change: 1 addition & 0 deletions aiida_sssp_workflow/workflows/measure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def define(cls, spec):
help='The `pw.x` code use for the `PwCalculation`.')
spec.input('pseudo', valid_type=UpfData, required=True,
help='Pseudopotential to be verified')
spec.input('oxygen_pseudo', valid_type=UpfData, required=False)
spec.input('protocol', valid_type=orm.Str, required=True,
help='The protocol which define input calculation parameters.')
spec.input('wavefunction_cutoff', valid_type=orm.Float, required=True, help='The wavefunction cutoff.')
Expand Down
5 changes: 4 additions & 1 deletion aiida_sssp_workflow/workflows/measure/precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def _setup_pseudo_and_configuration(self):
# for the oxide, need to pseudo of oxygen,
# the pseudo is the one select after the oxygen verification and
# store in the `statics/upf/O.**.upf`
pseudo_O = get_pseudo_O()
if "oxygen_pseudo" in self.inputs:
pseudo_O = self.inputs.oxygen_pseudo
else:
pseudo_O = get_pseudo_O()
self.ctx.pseudos_oxide = {
self.ctx.element: self.inputs.pseudo,
"O": pseudo_O,
Expand Down
Loading