Crash with invalid calculator parameters
Input file text.vm
:
calc = Calculator vasp (
(kpts: [3, 3, 3]),
(prec: 'Normal'),
(encut: 300., 350., 400.) [electron_volt])
print(calc)
How to run: Run with texts script -m workflow -f test.vm -r
Observed behavior:
Traceback (most recent call last):
File "jupyter-tensorflow_2023-09-12/lib64/python3.9/site-packages/fireworks/core/rocket.py", line 263, in run
m_action = t.run_task(my_spec)
File "vre-language/src/virtmat/language/utilities/firetasks.py", line 32, in run_task
raise err
File "vre-language/src/virtmat/language/utilities/firetasks.py", line 24, in run_task
f_output = func(*params)
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 815, in <lambda>
return lambda *x: amml.Calculator(name, func(*x), pinning, version, task), pars
File "vre-language/src/virtmat/language/utilities/amml.py", line 313, in __init__
super().__init__(name, parameters)
File "vre-language/src/virtmat/language/utilities/amml.py", line 296, in __init__
check_params_types(self.name, self.parameters)
File "vre-language/src/virtmat/language/utilities/ase_params.py", line 967, in check_params_types
(is_numeric(val) and isinstance(val.magnitude, ptype))):
AttributeError: 'float' object has no attribute 'magnitude'
program UUID: 077796827525475393a673213c3401b6
Evaluation error: test.vm:1:1 --> calc = Calculator vasp (
(kpts: [3, 3, 3]),
(prec: 'Normal'),
(encut: 300., 350., 400.) [electron_volt]) <--
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/firetasks.py", line 24, in run_task
f_output = func(*params)
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 815, in <lambda>
return lambda *x: amml.Calculator(name, func(*x), pinning, version, task), pars
File "vre-language/src/virtmat/language/utilities/amml.py", line 313, in __init__
super().__init__(name, parameters)
File "vre-language/src/virtmat/language/utilities/amml.py", line 296, in __init__
check_params_types(self.name, self.parameters)
File "vre-language/src/virtmat/language/utilities/ase_params.py", line 967, in check_params_types
(is_numeric(val) and isinstance(val.magnitude, ptype))):
AttributeError: 'float' object has no attribute 'magnitude'
program output: >>>
<<<
Expected bahavior:
- There should be more graceful error message -> RuntimeValueError
- There should be some static parameters check to avoid the crash (StaticValueError). Indeed if we run with
texts script -m workflow -f test.vm
, i.e. without-r
the model is persisted without errors but there should be an error.