Skip to content

Commit

Permalink
scipy.interpolate
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Oct 9, 2024
1 parent 3a48c7e commit e24628f
Show file tree
Hide file tree
Showing 19 changed files with 458 additions and 343 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
"constants"
"datasets"
"integrate"
"interpolate"
"io"
"linalg"
"misc"
Expand Down Expand Up @@ -82,7 +83,7 @@ jobs:
"scipy.fft",
"scipy.fftpack",
"scipy.integrate",
# "scipy.interpolate",
"scipy.interpolate",
"scipy.io",
"scipy.linalg",
"scipy.misc",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ The exact version requirements are specified in the [`pyproject.toml`](pyproject

| Package or module | Stubs status |
|---------------------------------- |---------------- |
| `scipy.__init__` | 3: ready |
| `scipy.__init__` | **4: done** |
| `scipy._lib` | 2: partial |
| `scipy.cluster` | **4: done** |
| `scipy.constants` | **4: done** |
| `scipy.datasets` | **4: done** |
| `scipy.fft` | 3: ready |
| `scipy.fftpack` | 3: ready |
| `scipy.integrate` | **4: done** |
| `scipy.interpolate` | 2: partial |
| `scipy.interpolate` | **4: done** |
| `scipy.io` | **4: done** |
| `scipy.linalg` | **4: done** |
| ~`scipy.misc`~ | **4: done** |
Expand Down
79 changes: 65 additions & 14 deletions scipy-stubs/interpolate/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,23 +1,74 @@
from . import (
fitpack as fitpack,
fitpack2 as fitpack2,
interpolate as interpolate,
ndgriddata as ndgriddata,
polyint as polyint,
rbf as rbf,
)
from ._aaa import *
from . import fitpack, fitpack2, interpnd, interpolate, ndgriddata, polyint, rbf # deprecated
from ._bsplines import *
from ._cubic import *
from ._fitpack2 import *
from ._fitpack_py import *
from ._interpolate import *
from ._ndbspline import NdBSpline as NdBSpline
from ._ndbspline import NdBSpline
from ._ndgriddata import *
from ._pade import *
from ._polyint import *
from ._rbf import Rbf as Rbf
from ._rbfinterp import *
from ._rgi import *
from ._rbf import Rbf
from ._rbfinterp import RBFInterpolator
from ._rgi import RegularGridInterpolator, interpn

pchip = PchipInterpolator
__all__ = [
"Akima1DInterpolator",
"BPoly",
"BSpline",
"BarycentricInterpolator",
"BivariateSpline",
"CloughTocher2DInterpolator",
"CubicHermiteSpline",
"CubicSpline",
"InterpolatedUnivariateSpline",
"KroghInterpolator",
"LSQBivariateSpline",
"LSQSphereBivariateSpline",
"LSQUnivariateSpline",
"LinearNDInterpolator",
"NdBSpline",
"NdPPoly",
"NearestNDInterpolator",
"PPoly",
"PchipInterpolator",
"RBFInterpolator",
"Rbf",
"RectBivariateSpline",
"RectSphereBivariateSpline",
"RegularGridInterpolator",
"SmoothBivariateSpline",
"SmoothSphereBivariateSpline",
"UnivariateSpline",
"approximate_taylor_polynomial",
"barycentric_interpolate",
"bisplev",
"bisplrep",
"fitpack",
"fitpack2",
"griddata",
"insert",
"interp1d",
"interp2d",
"interpn",
"interpnd",
"interpolate",
"krogh_interpolate",
"lagrange",
"make_interp_spline",
"make_lsq_spline",
"make_smoothing_spline",
"ndgriddata",
"pade",
"pchip_interpolate",
"polyint",
"rbf",
"spalde",
"splantider",
"splder",
"splev",
"splint",
"splprep",
"splrep",
"sproot",
]
8 changes: 0 additions & 8 deletions scipy-stubs/interpolate/_aaa.pyi

This file was deleted.

63 changes: 36 additions & 27 deletions scipy-stubs/interpolate/_bsplines.pyi
Original file line number Diff line number Diff line change
@@ -1,43 +1,52 @@
from scipy._lib._util import normalize_axis_index as normalize_axis_index
from scipy._typing import Untyped
from scipy.linalg import (
LinAlgError as LinAlgError,
cho_solve_banded as cho_solve_banded,
cholesky_banded as cholesky_banded,
get_lapack_funcs as get_lapack_funcs,
solve as solve,
solve_banded as solve_banded,
)
from scipy.optimize import minimize_scalar as minimize_scalar
from scipy.sparse import csr_array as csr_array
from scipy.special import poch as poch

__all__ = ["BSpline", "make_interp_spline", "make_lsq_spline", "make_smoothing_spline"]

class BSpline:
k: Untyped
c: Untyped
t: Untyped
extrapolate: Untyped
axis: Untyped
def __init__(self, t, c, k, extrapolate: bool = True, axis: int = 0): ...
@classmethod
def construct_fast(cls, t, c, k, extrapolate: bool = True, axis: int = 0) -> Untyped: ...
@property
def tck(self) -> Untyped: ...
@classmethod
def basis_element(cls, t, extrapolate: bool = True) -> Untyped: ...
@classmethod
def design_matrix(cls, x, t, k, extrapolate: bool = False) -> Untyped: ...
def __call__(self, x, nu: int = 0, extrapolate: Untyped | None = None) -> Untyped: ...
def __init__(self, t: Untyped, c: Untyped, k: Untyped, extrapolate: bool = True, axis: int = 0) -> None: ...
def __call__(self, x: Untyped, nu: int = 0, extrapolate: Untyped | None = None) -> Untyped: ...
def derivative(self, nu: int = 1) -> Untyped: ...
def antiderivative(self, nu: int = 1) -> Untyped: ...
def integrate(self, a, b, extrapolate: Untyped | None = None) -> Untyped: ...
def integrate(self, a: Untyped, b: Untyped, extrapolate: Untyped | None = None) -> Untyped: ...
def insert_knot(self, x: Untyped, m: int = 1) -> Untyped: ...
@classmethod
def basis_element(cls, t: Untyped, extrapolate: bool = True) -> Untyped: ...
@classmethod
def from_power_basis(cls, pp, bc_type: str = "not-a-knot") -> Untyped: ...
def insert_knot(self, x, m: int = 1) -> Untyped: ...
def design_matrix(cls, x: Untyped, t: Untyped, k: Untyped, extrapolate: bool = False) -> Untyped: ...
@classmethod
def from_power_basis(cls, pp: Untyped, bc_type: str = "not-a-knot") -> Untyped: ...
@classmethod
def construct_fast(cls, t: Untyped, c: Untyped, k: Untyped, extrapolate: bool = True, axis: int = 0) -> Untyped: ...

def make_interp_spline(
x, y, k: int = 3, t: Untyped | None = None, bc_type: Untyped | None = None, axis: int = 0, check_finite: bool = True
x: Untyped,
y: Untyped,
k: int = 3,
t: Untyped | None = None,
bc_type: Untyped | None = None,
axis: int = 0,
check_finite: bool = True,
) -> Untyped: ...
def make_lsq_spline(
x: Untyped,
y: Untyped,
t: Untyped,
k: int = 3,
w: Untyped | None = None,
axis: int = 0,
check_finite: bool = True,
) -> Untyped: ...
def make_smoothing_spline(
x: Untyped,
y: Untyped,
w: Untyped | None = None,
lam: Untyped | None = None,
) -> Untyped: ...
def make_lsq_spline(x, y, t, k: int = 3, w: Untyped | None = None, axis: int = 0, check_finite: bool = True) -> Untyped: ...
def make_smoothing_spline(x, y, w: Untyped | None = None, lam: Untyped | None = None) -> Untyped: ...
def fpcheck(x, t, k): ...
def fpcheck(x: Untyped, t: Untyped, k: Untyped) -> None: ... # undocumented
45 changes: 27 additions & 18 deletions scipy-stubs/interpolate/_cubic.pyi
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
from typing import Literal
from typing_extensions import override

from scipy._typing import Untyped
from scipy.linalg import solve as solve, solve_banded as solve_banded
from . import PPoly as PPoly
from ._interpolate import PPoly

def prepare_input(x, y, axis, dydx: Untyped | None = None) -> Untyped: ...
__all__ = ["Akima1DInterpolator", "CubicHermiteSpline", "CubicSpline", "PchipInterpolator", "pchip_interpolate"]

class CubicHermiteSpline(PPoly):
axis: Untyped
def __init__(self, x, y, dydx, axis: int = 0, extrapolate: Untyped | None = None): ...
def __init__(self, x: Untyped, y: Untyped, dydx: Untyped, axis: int = 0, extrapolate: Untyped | None = None) -> None: ...

class PchipInterpolator(CubicHermiteSpline):
axis: Untyped
def __init__(self, x, y, axis: int = 0, extrapolate: Untyped | None = None): ...

def pchip_interpolate(xi, yi, x, der: int = 0, axis: int = 0) -> Untyped: ...
def __init__(self, x: Untyped, y: Untyped, axis: int = 0, extrapolate: Untyped | None = None) -> None: ...

class Akima1DInterpolator(CubicHermiteSpline):
axis: Untyped
def __init__(self, x, y, axis: int = 0, *, method: Literal["akima", "makima"] = "akima", extrapolate: bool | None = None): ...
def extend(self, c, x, right: bool = True): ...
@classmethod
def from_spline(cls, tck, extrapolate: Untyped | None = None): ...
@classmethod
def from_bernstein_basis(cls, bp, extrapolate: Untyped | None = None): ...
def __init__(
self,
x: Untyped,
y: Untyped,
axis: int = 0,
*,
method: Literal["akima", "makima"] = "akima",
extrapolate: bool | None = None,
) -> None: ...
@override
def extend(self, c: Untyped, x: Untyped, right: bool = True) -> None: ...

class CubicSpline(CubicHermiteSpline):
axis: Untyped
def __init__(self, x, y, axis: int = 0, bc_type: str = "not-a-knot", extrapolate: Untyped | None = None): ...
def __init__(
self,
x: Untyped,
y: Untyped,
axis: int = 0,
bc_type: str = "not-a-knot",
extrapolate: Untyped | None = None,
) -> None: ...

def prepare_input(x: Untyped, y: Untyped, axis: Untyped, dydx: Untyped | None = None) -> Untyped: ... # undocumented
def pchip_interpolate(xi: Untyped, yi: Untyped, x: Untyped, der: int = 0, axis: int = 0) -> Untyped: ...
Loading

0 comments on commit e24628f

Please sign in to comment.