diff --git a/calphy/integrators.py b/calphy/integrators.py index e51e722..5649c85 100644 --- a/calphy/integrators.py +++ b/calphy/integrators.py @@ -40,6 +40,13 @@ from scipy.integrate import cumtrapz except ImportError: from scipy.integrate import cumulative_trapezoid as cumtrapz + +npversion = int(np.__version__.split('.')[0]) +if npversion <= 1: + from numpy import trapz +else: + from numpy import trapezoid as trapz + from tqdm import tqdm import pyscal3.core as pc from ase.io import read @@ -122,8 +129,8 @@ def integrate_path( fdu = fdui - fdur bdu = bdui - bdur - fw = np.trapz(fdu, flambda) - bw = np.trapz(bdu, blambda) + fw = trapz(fdu, flambda) + bw = trapz(bdu, blambda) w = 0.5 * (fw - bw) q = 0.5 * (fw + bw)