Skip to content

Commit abe0c2a

Browse files
fix false counting and numpy to int (#80)
* fix false counting and numpy to int * [pre-commit.ci] auto fixes from pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ee41be5 commit abe0c2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/diffpy/srmise/baselines/polynomial.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def estimate_parameters(self, r, y):
9090
# TODO: Make this more sophisticated.
9191
try:
9292
cut = np.max([len(y) / 10, 1])
93-
cut_idx = y.argsort()[:cut]
93+
cut_idx = y.argsort()[: int(cut)]
9494

9595
import numpy.linalg as la
9696

@@ -121,7 +121,7 @@ def _jacobianraw(self, pars, r, free):
121121
emsg = "Argument free must have " + str(self.npars) + " elements."
122122
raise ValueError(emsg)
123123
jacobian = [None for p in range(self.npars)]
124-
if (free is False).sum() == self.npars:
124+
if np.sum(np.logical_not(free)) == self.npars:
125125
return jacobian
126126

127127
# The partial derivative with respect to the nth coefficient of a

0 commit comments

Comments
 (0)