From d3892d7e575e47876b2e7d2f0b15d2714d5acfc2 Mon Sep 17 00:00:00 2001 From: t-reents Date: Mon, 11 Nov 2024 15:14:48 +0100 Subject: [PATCH] Set common inputs to `non_db` 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. --- src/aiida_common_workflows/workflows/bands/generator.py | 1 + src/aiida_common_workflows/workflows/relax/generator.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/aiida_common_workflows/workflows/bands/generator.py b/src/aiida_common_workflows/workflows/bands/generator.py index 1e4ee5e6..16c44d78 100644 --- a/src/aiida_common_workflows/workflows/bands/generator.py +++ b/src/aiida_common_workflows/workflows/bands/generator.py @@ -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.', ) diff --git a/src/aiida_common_workflows/workflows/relax/generator.py b/src/aiida_common_workflows/workflows/relax/generator.py index ab4c1d9e..d7cc5907 100644 --- a/src/aiida_common_workflows/workflows/relax/generator.py +++ b/src/aiida_common_workflows/workflows/relax/generator.py @@ -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.', ) @@ -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 ' @@ -70,6 +72,7 @@ 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.', ) @@ -77,12 +80,14 @@ def define(cls, spec): '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 ' @@ -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.', )