atomistic-machine-learning / schnetpack

SchNetPack - Deep Neural Networks for Atomistic Systems
Other
791 stars 215 forks source link

raise Exception if array is passed for energy in calculator + typehint #533

Closed stefaanhessmann closed 1 year ago

stefaanhessmann commented 1 year ago

Currently the SPKCalculator converts energy to float with .numpy()[0]. If by accident one passes an array for energy (this should not be done) the calculator uses the first element and runs fine. I changed this to raising an exception for that case.