We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4efe7da commit 14559fbCopy full SHA for 14559fb
1 file changed
examples/basic/ex05_run_predictions.py
@@ -1,4 +1,5 @@
1
import os
2
+from importlib.util import find_spec
3
4
from ase.io import read
5
import mala
@@ -39,7 +40,11 @@
39
40
ldos_calculator: mala.LDOS = predictor.target_calculator
41
ldos_calculator.read_from_array(ldos)
42
printout("Predicted band energy: ", ldos_calculator.band_energy)
43
+
44
# If the total energy module is installed, the total energy can also be
45
# calculated.
-# parameters.targets.pseudopotential_path = data_path
-# printout("Predicted total energy", ldos_calculator.total_energy)
46
+if find_spec("total_energy"):
47
+ parameters.targets.pseudopotential_path = data_path
48
+ printout("Predicted total energy", ldos_calculator.total_energy)
49
+else:
50
+ print("total_energy module not found, skipping total energy calculation")
0 commit comments