Skip to content

Commit

Permalink
fix FutureWarning& make todo for future pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhua0320 committed Sep 16, 2024
1 parent f330de1 commit 657017f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/diffpy/srmise/baselines/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def estimate_parameters(self, r, y):
import numpy.linalg as la

a = np.array([r[cut_idx]]).T
slope = la.lstsq(a, y[cut_idx])[0][0]
slope = la.lstsq(a, y[cut_idx], rcond=-1)[0][0]
return np.array([slope, 0.0])
except Exception as e:
emsg = "Error during estimation -- " + str(e)
Expand Down Expand Up @@ -256,4 +256,5 @@ def getmodule(self):
y = -r + 10 * np.exp(-((r - 5) ** 2)) + np.random.rand(len(r))
est = f.estimate_parameters(r, y)
print("Actual baseline: ", np.array([-1, 0.0]))
# TODO: Make test est baseline in ways of tolerance function
print("Estimated baseline: ", est)

0 comments on commit 657017f

Please sign in to comment.