Skip to content

Commit

Permalink
Set common inputs to non_db
Browse files Browse the repository at this point in the history
Due to the updates in version 2.6 of `aiida-core`, the `to_aiida_type`
serializer is used as a default. Therefore, the validation fails for the
inputs defined in the common interfaces, as those are typically defined
as Python datatypes. Since these inputs are anyway not stored in the database, we fix it by explicitly setting `non_db = True` for those inputs.
  • Loading branch information
t-reents committed Nov 11, 2024
1 parent 24a1819 commit d3892d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/aiida_common_workflows/workflows/bands/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def define(cls, spec):
spec.input(
'engines.bands.options',
valid_type=dict,
non_db=True,
required=False,
help='Options for the bands calculation jobs.',
)
6 changes: 6 additions & 0 deletions src/aiida_common_workflows/workflows/relax/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def define(cls, spec):
'protocol',
valid_type=ChoiceType(('fast', 'moderate', 'precise')),
default='moderate',
non_db=True,
help='The protocol to use for the automated input generation. This value indicates the level of precision '
'of the results and computational cost that the input parameters will be selected for.',
)
Expand Down Expand Up @@ -61,6 +62,7 @@ def define(cls, spec):
'magnetization_per_site',
valid_type=list,
required=False,
non_db=True,
help='The initial magnetization of the system. Should be a list of floats, where each float represents the '
'spin polarization in units of electrons, meaning the difference between spin up and spin down '
'electrons, for the site. This also corresponds to the magnetization of the site in Bohr magnetons '
Expand All @@ -70,19 +72,22 @@ def define(cls, spec):
'threshold_forces',
valid_type=float,
required=False,
non_db=True,
help='A real positive number indicating the target threshold for the forces in eV/Å. If not specified, '
'the protocol specification will select an appropriate value.',
)
spec.input(
'threshold_stress',
valid_type=float,
required=False,
non_db=True,
help='A real positive number indicating the target threshold for the stress in eV/Å^3. If not specified, '
'the protocol specification will select an appropriate value.',
)
spec.input(
'reference_workchain',
valid_type=orm.WorkChainNode,
non_db=True,
required=False,
help='The node of a previously completed process of the same type whose inputs should be taken into '
'account when generating inputs. This is important for particular workflows where certain inputs have '
Expand All @@ -106,5 +111,6 @@ def define(cls, spec):
'engines.relax.options',
valid_type=dict,
required=False,
non_db=True,
help='Options for the geometry optimization calculation jobs.',
)

0 comments on commit d3892d7

Please sign in to comment.