66from aiida .engine import WorkChain , append_
77from aiida .plugins import WorkflowFactory
88
9- from aiida_common_workflows .workflows .relax .generator import ElectronicType , RelaxType , SpinType
9+ from aiida_common_workflows .workflows .relax .generator import ElectronicType , OptionalRelaxFeatures , RelaxType , SpinType
1010from aiida_common_workflows .workflows .relax .workchain import CommonRelaxWorkChain
1111
1212
@@ -17,6 +17,12 @@ def validate_inputs(value, _):
1717 process_class = WorkflowFactory (value ['sub_process_class' ])
1818 generator = process_class .get_input_generator ()
1919
20+ if not generator .supports_feature (OptionalRelaxFeatures .FIXED_MAGNETIZATION ):
21+ return (
22+ f'The `{ value ["sub_process_class" ]} ` plugin does not support the '
23+ f'`{ OptionalRelaxFeatures .FIXED_MAGNETIZATION } ` optional feature required for this workflow.'
24+ )
25+
2026 try :
2127 generator .get_builder (structure = value ['structure' ], ** value ['generator_inputs' ])
2228 except Exception as exc :
@@ -74,18 +80,14 @@ def define(cls, spec):
7480 help = 'The type of spin for the calculation.' )
7581 spec .input ('generator_inputs.electronic_type' , valid_type = (ElectronicType , str ), required = False , non_db = True ,
7682 help = 'The type of electronics (insulator/metal) for the calculation.' )
77- spec .input (
78- 'generator_inputs.fixed_total_cell_magnetization' , valid_type = (list , tuple ),
79- required = False , non_db = True ,
80- help = 'List containing the total magnetizations per cell to be calculated.'
81- )
8283 spec .input ('generator_inputs.threshold_forces' , valid_type = float , required = False , non_db = True ,
8384 help = 'Target threshold for the forces in eV/Å.' )
8485 spec .input ('generator_inputs.threshold_stress' , valid_type = float , required = False , non_db = True ,
8586 help = 'Target threshold for the stress in eV/Å^3.' )
8687 spec .input_namespace ('sub_process' , dynamic = True , populate_defaults = False )
8788 spec .input ('sub_process_class' , non_db = True , validator = validate_sub_process_class )
8889 spec .inputs .validator = validate_inputs
90+
8991 spec .outline (
9092 cls .run_em ,
9193 cls .inspect_em ,
0 commit comments