diff --git a/nanoqm/workflows/input_validation.py b/nanoqm/workflows/input_validation.py index c3341458..dc2e17b7 100644 --- a/nanoqm/workflows/input_validation.py +++ b/nanoqm/workflows/input_validation.py @@ -241,10 +241,10 @@ def add_cell_parameters(self) -> None: for s in (self.general.cp2k_settings_main, self.general.cp2k_settings_guess): if self.general.file_cell_parameters is None: s.cell_parameters = self.general.cell_parameters - s.cell_angles = None + s.cell_angles = self.general.cell_angles else: s.cell_parameters = None - s.cell_angles = None + s.cell_angles = None def add_periodic(self) -> None: """Add the keyword for the periodicity of the system.""" diff --git a/nanoqm/workflows/schemas.py b/nanoqm/workflows/schemas.py index 65f51451..9022eb87 100644 --- a/nanoqm/workflows/schemas.py +++ b/nanoqm/workflows/schemas.py @@ -114,7 +114,10 @@ def validate(self, data: Any, **kwargs: Any) -> Any: "periodic": any_lambda(("none", "x", "y", "z", "xy", "xy", "yz", "xyz")), # Specify the angles between the vectors defining the unit cell - Optional("cell_angles", default=None): list, + Optional("cell_angles", default=None): Or( + None, + lambda xs: isinstance(xs, list) and len(xs) == 3 and all(isinstance(i, Real) for i in xs), + ), # Path to the folder containing the basis set specifications Optional( diff --git a/test/test_files/input_fast_test_derivative_couplings.yml b/test/test_files/input_fast_test_derivative_couplings.yml index c4906469..2dc4971f 100644 --- a/test/test_files/input_fast_test_derivative_couplings.yml +++ b/test/test_files/input_fast_test_derivative_couplings.yml @@ -36,7 +36,7 @@ cp2k_general_settings: potential: "GTH-PBE" basis: "DZVP-MOLOPT-SR-GTH" cell_parameters: 10.0 - cell_angles: [90.0, 90.0, 90.0] + cell_angles: null periodic: none executable: cp2k.ssmp diff --git a/test/test_files/input_test_distribute_absorption_spectrum.yml b/test/test_files/input_test_distribute_absorption_spectrum.yml index 1d2c6c62..ef17f9fd 100644 --- a/test/test_files/input_test_distribute_absorption_spectrum.yml +++ b/test/test_files/input_test_distribute_absorption_spectrum.yml @@ -30,7 +30,6 @@ cp2k_general_settings: basis: "DZVP-MOLOPT-SR-GTH" potential: "GTH-PBE" cell_parameters: 28.0 - cell_angles: [90.0, 90.0, 90.0] periodic: xyz executable: cp2k.ssmp