Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/diffpy/srmise/baselines/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def estimate_parameters(self, r, y):
# TODO: Make this more sophisticated.
try:
cut = np.max([len(y) / 10, 1])
cut_idx = y.argsort()[:cut]
cut_idx = y.argsort()[: int(cut)]

import numpy.linalg as la

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

# The partial derivative with respect to the nth coefficient of a
Expand Down
Loading