Skip to content

Commit 0323343

Browse files
committed
Fixing pre-commit issues
1 parent 82f77d9 commit 0323343

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/aiida_common_workflows/workflows/relax/abinit/generator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def define(cls, spec):
5151
(ElectronicType.METAL, ElectronicType.INSULATOR, ElectronicType.UNKNOWN)
5252
)
5353
spec.inputs['engines']['relax']['code'].valid_type = CodeType('abinit')
54-
spec.inputs['protocol'].valid_type = ChoiceType(('fast', 'moderate', 'precise', 'verification-PBE-v1', 'custom'))
54+
spec.inputs['protocol'].valid_type = ChoiceType(
55+
('fast', 'moderate', 'precise', 'verification-PBE-v1', 'custom')
56+
)
5557

5658
def _construct_builder(self, **kwargs) -> engine.ProcessBuilder: # noqa: PLR0912,PLR0915
5759
"""Construct a process builder based on the provided keyword arguments.
@@ -73,7 +75,9 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder: # noqa: PLR091
7375

7476
if protocol == 'custom':
7577
if custom_protocol is None:
76-
raise ValueError('the `custom_protocol` input must be provided when the `protocol` input is set to `custom`.')
78+
raise ValueError(
79+
'the `custom_protocol` input must be provided when the `protocol` input is set to `custom`.'
80+
)
7781
protocol = copy.deepcopy(custom_protocol)
7882
else:
7983
protocol = copy.deepcopy(self.get_protocol(protocol))

src/aiida_common_workflows/workflows/relax/generator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ def validate_inputs(value, _):
1818
return 'the inputs `magnetization_per_site` and ' '`fixed_total_cell_magnetization` are mutually exclusive.'
1919

2020
if value.get('protocol') == 'custom' and value.get('custom_protocol') is None:
21-
return 'the `custom_protocol` input must be provided when the `protocol` input is set to `custom`.'
21+
return 'the `custom_protocol` input must be provided when the `protocol` input is set to `custom`.'
2222

2323
if value.get('protocol') != 'custom' and value.get('custom_protocol') is not None:
24-
return 'the `custom_protocol` input can only be provided when the `protocol` input is set to `custom`.'
24+
return 'the `custom_protocol` input can only be provided when the `protocol` input is set to `custom`.'
2525

2626
# TODO: ensure all plugins actually honor this new custom_protocol input! (only QE implemented for now)
2727

28+
2829
class OptionalRelaxFeatures(OptionalFeature):
2930
FIXED_MAGNETIZATION = 'fixed_total_cell_magnetization'
3031

0 commit comments

Comments
 (0)