Omit the traceback for evaluation errors
The traceback of evaluation errors should not be shown during the workflow evaluation (at least using the synchronous evaluation).
For example, the input a = 1 - 1 [m]; print(a)
(in file script.vm
) yields the following output on the screen with texts script -m workflow -f script.vm -r
:
(python-3.10.12) ubuntu@linux4work:~/work/vre-language/examples$ texts script -m workflow -f 12.vm -r
Traceback (most recent call last):
File "/mnt/data/ubuntu/work/python-3.10.12/lib/python3.10/site-packages/fireworks/core/rocket.py", line 262, in run
m_action = t.run_task(my_spec)
File "/mnt/data/ubuntu/work/vre-language/src/virtmat/language/utilities/firetasks.py", line 32, in run_task
raise err
File "/mnt/data/ubuntu/work/vre-language/src/virtmat/language/utilities/firetasks.py", line 24, in run_task
f_output = func(*params)
File "/mnt/data/ubuntu/work/vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 654, in <lambda>
lambda *args: operator(left_func(*args[0:left_pars_length]),
File "/mnt/data/ubuntu/work/vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 44, in <lambda>
'+': add, '-': lambda x, y: add(x, neg(y)), '*': mul, '/': truediv,
File "/mnt/data/ubuntu/work/python-3.10.12/lib/python3.10/site-packages/pint/facets/plain/quantity.py", line 849, in __add__
return self._add_sub(other, operator.add)
File "/mnt/data/ubuntu/work/python-3.10.12/lib/python3.10/site-packages/pint/facets/plain/quantity.py", line 101, in wrapped
return f(self, *args, **kwargs)
File "/mnt/data/ubuntu/work/python-3.10.12/lib/python3.10/site-packages/pint/facets/plain/quantity.py", line 751, in _add_sub
raise DimensionalityError(
pint.errors.DimensionalityError: Cannot convert from 'dimensionless' (dimensionless) to 'meter' ([length])
program UUID: ced033f416f44d30b0778cbc49880f53
Dimensionality error: /mnt/data/ubuntu/work/vre-language/examples/12.vm:1:1 --> a = 1 - 1 [m] <--
Cannot convert from 'dimensionless' (dimensionless) to 'meter' ([length])
program output: >>>
<<<
Edited by Ivan Kondov