Error with property when using a structure from file
When loading a structure from file and initializing a property:
H2O = Structure from file 'h2o.cif'
calc = Calculator emt()
props_H2O = Property energy for H2O with calc
the following error occurs:
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 91, in wrapper
return func(*args, **kwargs)
File "../../scripts/run_model.py", line 54, in run_instant_deferred
return meta.model_from_file(clargs.model_file, deferred_mode=deferred,
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/textx/metamodel.py", line 658, in model_from_file
return self.internal_model_from_file(
File "jupyter-tensorflow-2023-01-02/lib64/python3.8/site-packages/textx/metamodel.py", line 712, in internal_model_from_file
p(model, self)
File "vre-language/src/virtmat/language/constraints/typechecks.py", line 59, in check_types_processor
_ = obj.type_
File "/usr/lib64/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/constraints/typechecks.py", line 105, in variable_type
return self.parameter.type_
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/test/test_issue1.vm:3:13: 'NoneType' object has no attribute 'get_column' => 'Property energy for H2O with calc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../../scripts/run_model.py", line 96, in <module>
main()
File "../../scripts/run_model.py", line 86, in main
prog = run_instant_deferred(clargs, deferred=False)
File "vre-language/src/virtmat/language/utilities/errors.py", line 93, in wrapper
process_error(err)
File "vre-language/src/virtmat/language/utilities/errors.py", line 76, in process_error
raise err.__cause__
File "vre-language/src/virtmat/language/utilities/errors.py", line 34, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/constraints/typechecks.py", line 877, in amml_property_type
atoms = self.struct.parameter.tab.get_column('atoms')
AttributeError: 'NoneType' object has no attribute 'get_column'
If the structure is defined as literal the error does not occur.