Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: standardizes check_finite behavior re optional weights, fixes #6296 #6301

Merged
merged 1 commit into from Jun 25, 2016

Conversation

@nedlrichards
Copy link
Contributor

nedlrichards commented Jun 22, 2016

Changes behaviour of UnivariateSpline, InterpolatedUnivariteSpline and
LSQUnivariateSpline. Any not finite value in optional weight vector
will raise a ValueError. Added tests for all 3 interpolators, for cases
when w is unspecified, and when w is specified.

@ev-br

This comment has been minimized.

Copy link
Member

ev-br commented Jun 22, 2016

CI fails because np.full_like not being available in numpy 1.7.2 which we need to support.
Other than that, looks good to me.



Changes behvior of UnivariateSpline, InterpolatedUnivariteSpline and
LSQUnivariateSpline. Any not finite value in optional weight vector
will raise a ValueError. Added tests for all 3 interpolators, for cases
when w is unspecified, and when w is specified.
@nedlrichards nedlrichards force-pushed the nedlrichards:check_finite_interp branch from 901ea97 to addbba1 Jun 22, 2016
w = np.ones_like(x)
# also test LSQUnivariateSpline [which needs explicit knots]
spl = UnivariateSpline(x, y, check_finite=True)
t = spl.get_knots()[3:4] # interior knots w/ default k=3

This comment has been minimized.

Copy link
@ev-br

ev-br Jun 25, 2016

Member

[3:4] and the comment is somewhat misleading, given that

In [7]: spl = UnivariateSpline(x, y, check_finite=True)

In [8]: spl.get_knots()
Out[8]: array([ 0.,  9.])

(So the idea is to have empty interior knots for the call to LSQUnivariateSpline. Apparently, this works.)

Could be nice to clarify the intent, but this can be made in a separate PR.

@ev-br

This comment has been minimized.

Copy link
Member

ev-br commented Jun 25, 2016

LGTM modulo a nitpick which can be taken care of in a sequel. Merging. Thank you @nedlrichards

@ev-br ev-br merged commit ca7e537 into scipy:master Jun 25, 2016
3 checks passed
3 checks passed
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 78.46% (target 1.00%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ev-br ev-br added this to the 0.19.0 milestone Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.