Error when using the structure from a property slice
When running this example in instant mode the following error occurs:
textx.exceptions.TextXError: vre-language/examples/property.vm:51:7: type must be <class 'virtmat.language.utilities.amml.AMMLStructure'> but is <class 'pandas.core.series.Series'> => 'props_01.struct'
This is within this code part:
props_01 = props[0:1]
print(props_01.struct)
The error does not occur in deferred mode. In workflow mode this error occurs (this time with the slicing of props
itself):
ERROR:root:variable_value:<Variable:props_01> evaluation error
Traceback (most recent call last):
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/core/rocket.py", line 358, in run
lp.complete_launch(launch_id, m_action, final_state)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/core/launchpad.py", line 1537, in complete_launch
self.launches.find_one_and_replace({"launch_id": m_launch.launch_id}, m_launch.to_db_dict(), upsert=True)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 144, in _decorator
m_dict = func(self, *args, **kwargs)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/core/firework.py", line 619, in to_db_dict
m_d = self.to_dict()
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 145, in _decorator
m_dict = recursive_dict(m_dict)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 85, in recursive_dict
return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode) for k, v in obj.items()}
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 85, in <dictcomp>
return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode) for k, v in obj.items()}
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 79, in recursive_dict
return recursive_dict(obj.as_dict(), preserve_unicode)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 216, in as_dict
return self.to_dict()
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 145, in _decorator
m_dict = recursive_dict(m_dict)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 85, in recursive_dict
return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode) for k, v in obj.items()}
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 85, in <dictcomp>
return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode) for k, v in obj.items()}
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 85, in recursive_dict
return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode) for k, v in obj.items()}
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 85, in <dictcomp>
return {recursive_dict(k, preserve_unicode): recursive_dict(v, preserve_unicode) for k, v in obj.items()}
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 79, in recursive_dict
return recursive_dict(obj.as_dict(), preserve_unicode)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 216, in as_dict
return self.to_dict()
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 173, in _decorator
m_dict = func(self, *args, **kwargs)
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/fireworks/utilities/fw_serializers.py", line 144, in _decorator
m_dict = func(self, *args, **kwargs)
File "vre-language/src/virtmat/language/utilities/serializable.py", line 309, in to_dict
'calc': FWCalculator.from_base(self.calc),
File "vre-language/src/virtmat/language/utilities/serializable.py", line 298, in from_base
return cls(obj.name, obj.parameters, pinning=obj.pinning, version=obj.version)
File "/opt/bwhpc/common/jupyter/tensorflow/2023-01-02/lib/python3.8/site-packages/pandas/core/generic.py", line 5902, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'parameters'
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 34, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/utilities/types.py", line 90, in wrapper
return checktype_(func(obj), obj.type_)
File "vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 197, in variable_value
raise RuntimeError('no _details in _exception found')
RuntimeError: no _details in _exception found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "../scripts/run_model.py", line 91, in <module>
main()
File "../scripts/run_model.py", line 81, in main
print(f'program output: >>>\n{prog.value}\n<<<')
File "vre-language/src/virtmat/language/interpreter/instant_executor.py", line 49, in program_value
vals = [p.value for p in get_children_of_type('Print', self) if p.value]
File "vre-language/src/virtmat/language/interpreter/instant_executor.py", line 49, in <listcomp>
vals = [p.value for p in get_children_of_type('Print', self) if p.value]
File "vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 236, in print_value
raise err
File "vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 231, in print_value
val = par.value
File "/usr/lib64/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/utilities/errors.py", line 34, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/utilities/types.py", line 90, in wrapper
return checktype_(func(obj), obj.type_)
File "vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 249, in func_value
vals = [p.value for p in pars]
File "vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 249, in <listcomp>
vals = [p.value for p in pars]
File "/usr/lib64/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/utilities/errors.py", line 41, in wrapper
raise TextXError(str(err), **loc, context=con) from err
textx.exceptions.TextXError: vre-language/examples/property.vm:50:1: no _details in _exception found => 'props_01 = props[0:1]'
Edited by Ivan Kondov