Skip to content

Commit 3eb9263

Browse files
authored
Merge pull request scipy#21849 from ev-br/fitpack_declare_legacy
2 parents 187d6b6 + f5ec62e commit 3eb9263

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

scipy/interpolate/_fitpack2.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ class UnivariateSpline:
7272
"""
7373
1-D smoothing spline fit to a given set of data points.
7474
75+
.. legacy:: class
76+
77+
Specifically, we recommend using `make_splrep` instead.
78+
7579
Fits a spline y = spl(x) of degree `k` to the provided `x`, `y` data. `s`
7680
specifies the number of knots by specifying a smoothing condition.
7781
@@ -644,6 +648,10 @@ class InterpolatedUnivariateSpline(UnivariateSpline):
644648
"""
645649
1-D interpolating spline for a given set of data points.
646650
651+
.. legacy:: class
652+
653+
Specifically, we recommend using `make_interp_spline` instead.
654+
647655
Fits a spline y = spl(x) of degree `k` to the provided `x`, `y` data.
648656
Spline function passes through all provided points. Equivalent to
649657
`UnivariateSpline` with `s` = 0.
@@ -761,6 +769,11 @@ class LSQUnivariateSpline(UnivariateSpline):
761769
"""
762770
1-D spline with explicit internal knots.
763771
772+
.. legacy:: class
773+
774+
Specifically, we recommend using `make_lsq_spline` instead.
775+
776+
764777
Fits a spline y = spl(x) of degree `k` to the provided `x`, `y` data. `t`
765778
specifies the internal knots of the spline
766779

scipy/interpolate/_fitpack_py.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def splprep(x, w=None, u=None, ub=None, ue=None, k=3, task=0, s=None, t=None,
1515
"""
1616
Find the B-spline representation of an N-D curve.
1717
18+
.. legacy:: function
19+
20+
Specifically, we recommend using `make_splprep` in new code.
21+
1822
Given a list of N rank-1 arrays, `x`, which represent a curve in
1923
N-dimensional space parametrized by `u`, find a smooth approximating
2024
spline curve g(`u`). Uses the FORTRAN routine parcur from FITPACK.
@@ -162,6 +166,11 @@ def splrep(x, y, w=None, xb=None, xe=None, k=3, task=0, s=None, t=None,
162166
"""
163167
Find the B-spline representation of a 1-D curve.
164168
169+
.. legacy:: function
170+
171+
Specifically, we recommend using `make_splrep` in new code.
172+
173+
165174
Given the set of data points ``(x[i], y[i])`` determine a smooth spline
166175
approximation of degree k on the interval ``xb <= x <= xe``.
167176
@@ -300,6 +309,11 @@ def splev(x, tck, der=0, ext=0):
300309
"""
301310
Evaluate a B-spline or its derivatives.
302311
312+
.. legacy:: function
313+
314+
Specifically, we recommend constructing a `BSpline` object and using
315+
its ``__call__`` method.
316+
303317
Given the knots and coefficients of a B-spline representation, evaluate
304318
the value of the smoothing polynomial and its derivatives. This is a
305319
wrapper around the FORTRAN routines splev and splder of FITPACK.
@@ -385,6 +399,11 @@ def splint(a, b, tck, full_output=0):
385399
"""
386400
Evaluate the definite integral of a B-spline between two given points.
387401
402+
.. legacy:: function
403+
404+
Specifically, we recommend constructing a `BSpline` object and using its
405+
``integrate`` method.
406+
388407
Parameters
389408
----------
390409
a, b : float
@@ -450,6 +469,11 @@ def sproot(tck, mest=10):
450469
"""
451470
Find the roots of a cubic B-spline.
452471
472+
.. legacy:: function
473+
474+
Specifically, we recommend constructing a `BSpline` object and using the
475+
following pattern: `PPoly.from_spline(spl).roots()`.
476+
453477
Given the knots (>=8) and coefficients of a cubic B-spline return the
454478
roots of the spline.
455479
@@ -541,6 +565,11 @@ def spalde(x, tck):
541565
Evaluate a B-spline and all its derivatives at one point (or set of points) up
542566
to order k (the degree of the spline), being 0 the spline itself.
543567
568+
.. legacy:: function
569+
570+
Specifically, we recommend constructing a `BSpline` object and evaluate
571+
its derivative in a loop or a list comprehension.
572+
544573
Parameters
545574
----------
546575
x : array_like
@@ -633,6 +662,11 @@ def insert(x, tck, m=1, per=0):
633662
"""
634663
Insert knots into a B-spline.
635664
665+
.. legacy:: function
666+
667+
Specifically, we recommend constructing a `BSpline` object and using
668+
its ``insert_knot`` method.
669+
636670
Given the knots and coefficients of a B-spline representation, create a
637671
new B-spline with a knot inserted `m` times at point `x`.
638672
This is a wrapper around the FORTRAN routine insert of FITPACK.
@@ -729,6 +763,11 @@ def splder(tck, n=1):
729763
"""
730764
Compute the spline representation of the derivative of a given spline
731765
766+
.. legacy:: function
767+
768+
Specifically, we recommend constructing a `BSpline` object and using its
769+
``derivative`` method.
770+
732771
Parameters
733772
----------
734773
tck : BSpline instance or tuple
@@ -791,6 +830,11 @@ def splantider(tck, n=1):
791830
"""
792831
Compute the spline for the antiderivative (integral) of a given spline.
793832
833+
.. legacy:: function
834+
835+
Specifically, we recommend constructing a `BSpline` object and using its
836+
``antiderivative`` method.
837+
794838
Parameters
795839
----------
796840
tck : BSpline instance or a tuple of (t, c, k)

0 commit comments

Comments
 (0)