Lennard-Jones does not work when parameter list empty
Script:
calc = Calculator lj ()
struct = Structure ((atoms: ((symbols: 'H'), (x: 1.) [bohr], (y: 2.) [bohr], (z: 3.) [bohr])))
prop = Property energy ((calculator: calc), (structure: struct))
print(prop.energy)
Command: texts script -f script.vm
Output:
Traceback (most recent call last):
File "jupyter-tensorflow-2023-10-10/bin/texts", line 8, in <module>
sys.exit(texts())
File "vre-language/src/virtmat/language/cli/__init__.py", line 28, in texts
clargs.func(clargs)
File "vre-language/src/virtmat/language/cli/run_model.py", line 156, in main
evaluate_prog(prog)
File "vre-language/src/virtmat/language/utilities/errors.py", line 307, in wrapper
process_error(err)
File "vre-language/src/virtmat/language/utilities/errors.py", line 295, in process_error
raise err.__cause__
File "vre-language/src/virtmat/language/utilities/errors.py", line 208, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/utilities/typemap.py", line 117, in wrapper
return checktype_(func(obj), obj.type_)
File "vre-language/src/virtmat/language/interpreter/instant_executor.py", line 54, 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 54, in <listcomp>
vals = [p.value for p in get_children_of_type('Print', self) if p.value]
File "vre-language/src/virtmat/language/utilities/errors.py", line 307, in wrapper
process_error(err)
File "vre-language/src/virtmat/language/utilities/errors.py", line 295, in process_error
raise err.__cause__
File "vre-language/src/virtmat/language/utilities/errors.py", line 208, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/utilities/typemap.py", line 117, in wrapper
return checktype_(func(obj), obj.type_)
File "vre-language/src/virtmat/language/interpreter/instant_executor.py", line 559, in amml_property_value
return amml.Property(self.names, self.struct.value,
File "vre-language/src/virtmat/language/utilities/amml.py", line 502, in __init__
self.results = results if results is not None else self.get_results()
File "vre-language/src/virtmat/language/utilities/amml.py", line 625, in get_results
df['calc'] = df.apply(lambda x: apply_func(x, apply_calc), axis=1)
File "/opt/bwhpc/common/jupyter/tensorflow/2023-10-10/lib/python3.9/site-packages/pandas/core/frame.py", line 10037, in apply
return op.apply().__finalize__(self, method="apply")
File "/opt/bwhpc/common/jupyter/tensorflow/2023-10-10/lib/python3.9/site-packages/pandas/core/apply.py", line 837, in apply
return self.apply_standard()
File "/opt/bwhpc/common/jupyter/tensorflow/2023-10-10/lib/python3.9/site-packages/pandas/core/apply.py", line 963, in apply_standard
results, res_index = self.apply_series_generator()
File "/opt/bwhpc/common/jupyter/tensorflow/2023-10-10/lib/python3.9/site-packages/pandas/core/apply.py", line 979, in apply_series_generator
results[i] = self.func(v, *self.args, **self.kwargs)
File "vre-language/src/virtmat/language/utilities/amml.py", line 625, in <lambda>
df['calc'] = df.apply(lambda x: apply_func(x, apply_calc), axis=1)
File "vre-language/src/virtmat/language/utilities/amml.py", line 604, in apply_func
return func(df.structure, df.calculator, df.algorithm)
File "vre-language/src/virtmat/language/utilities/amml.py", line 601, in apply_calc
return calc.run(struct, constrs=constrs, properties=self.names)
File "vre-language/src/virtmat/language/utilities/amml.py", line 387, in run
calc_ase = self.to_ase()[0]
File "vre-language/src/virtmat/language/utilities/amml.py", line 370, in to_ase
calc_list.append(calc_class(**get_params_magnitudes(calc_params, self.name)))
File "jupyter-tensorflow-2023-10-10/lib64/python3.9/site-packages/ase/calculators/lj.py", line 160, in __init__
self.parameters.rc = 3 * self.parameters.sigma
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'