Call to a calculator imported from file in Property object yields error
Employing an imported calculator from either a json
, or yaml
file in the Property object will cause the script to crash and no properties will be computed.
The failed run will produce a Type error
message:
to_dict() got an unexpected keyword argument 'orient'
The problem is independent of whether the calculator was exported and imported in the same run of the script, or if was done separate runs. The issue was identified for both ase's emt, and vasp calculators.
A minimum working sample script to reproduce the issue is provided below. It employs the emt calculator.
H2 = Structure h2 from (
(atoms: ((symbols: 'H', 'H'),
(x: 0.0, 0.0) [angstrom],
(y: 0.0, 0.0) [angstrom],
(z: 0.0, 0.9999599999999998) [angstrom],
(masses: 1.008, 1.008) [unified_atomic_mass_unit]
)
),
(cell: [[12.0, 0.0, 0.0], [0.0, 12.0, 0.0], [0.0, 0.0, 12.0]] [angstrom]),
(pbc: [true, true, true])
)
H2_line = FixedLine collinear to [0, 0, 1] where (fixed: true, true)
calc = Calculator emt ((restart: default), (fixed_cutoff: default))
calc to file 'calculator.json'
new_calc = Calculator from file 'calculator.json'
#MyCalc = calc
MyCalc = new_calc
props_H2 = Property energy for H2 with MyCalc with constraints (H2_line),
task: single point
# Test calculator setup
print('Calculator is:', MyCalc)
#
# Test property calculation
print('Structure name:', props_H2.struct.name)
print('Single point energy:', props_H2.energy)