diff --git a/.gitignore b/.gitignore index 033c77a..ecef278 100644 --- a/.gitignore +++ b/.gitignore @@ -147,7 +147,7 @@ cython_debug/ .vscode/ # Raw data files -atomdb/datasets/*/raw/ +atomdb/datasets/*/db/ # Generated documentation docs/source/api/ diff --git a/atomdb/species.py b/atomdb/species.py index deacf4d..23ef017 100644 --- a/atomdb/species.py +++ b/atomdb/species.py @@ -154,9 +154,9 @@ def __init__(self, x, y, log=False): self._log = log self._obj = CubicSpline( x, - # Clip y values to >=ε^2 if using log because they have to be above 0; - # having them be at least ε^2 seems to work based on my testing - np.log(y.clip(min=np.finfo(float).eps ** 2)) if log else y, + # Clip y values to >= ε if using log because they have to be above 0; + # having them be at least ε seems to work based on my testing + np.log(y.clip(min=np.finfo(float).eps)) if log else y, axis=0, bc_type="not-a-knot", extrapolate=True, @@ -198,8 +198,8 @@ def __call__(self, x, deriv=0): y = self._obj(x, nu=deriv) # Handle errors from the y = exp(log y) operation -- set NaN to zero np.nan_to_num(y, nan=0., copy=False) - # Cutoff value: assume y(x) is zero where x >= 2 times final given point x_n - y[x > 2 * self._obj.x[-1]] = 0 + # Cutoff value: assume y(x) is zero where x > final given point x_n + y[x > self._obj.x[-1]] = 0 return y