Skip to content

Commit

Permalink
PwCalculation: Fix calling input validation of base class
Browse files Browse the repository at this point in the history
The `PwCalculation` overrides the top-level input namespace validator
with the `validate_inputs` classmethod. It properly calls the super to
call the validation of the `CalcJob` base class, however, that class
doesn't use that class method for the validation, but rather uses the
`validate_calc_job` function.
  • Loading branch information
sphuber committed Sep 3, 2023
1 parent d4e6681 commit 17e173f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/aiida_quantumespresso/calculations/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,15 @@ def validate_inputs(cls, value, port_namespace):
the ``parent_folder`` input at a later step in the outline. To avoid raising any warnings, such a work chain
must exclude the ``parent_folder`` port when exposing the inputs of the ``PwCalculation``.
"""
from aiida.engine.processes.calcjobs.calcjob import validate_calc_job

result = super().validate_inputs(value, port_namespace)

if result is not None:
return result

result = validate_calc_job(value, port_namespace)

if result is not None:
return result

Expand Down
3 changes: 3 additions & 0 deletions tests/workflows/protocols/pw/test_bands/test_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bands:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down Expand Up @@ -45,6 +46,7 @@ relax:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CELL:
Expand Down Expand Up @@ -82,6 +84,7 @@ scf:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down
2 changes: 2 additions & 0 deletions tests/workflows/protocols/pw/test_relax/test_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ base:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CELL:
Expand Down Expand Up @@ -42,6 +43,7 @@ base_final_scf:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down
2 changes: 2 additions & 0 deletions tests/workflows/protocols/test_pdos/test_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ nscf:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down Expand Up @@ -61,6 +62,7 @@ scf:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ scf:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ core:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CONTROL:
Expand Down Expand Up @@ -85,6 +86,7 @@ relax:
max_wallclock_seconds: 43200
resources:
num_machines: 1
num_mpiprocs_per_machine: 1
withmpi: true
parameters:
CELL:
Expand Down

0 comments on commit 17e173f

Please sign in to comment.