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

First pass on dealing with public private modules: Re-export attributes of public private modules through __all__ #54

Merged
merged 22 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca5b42c
`odr`: Add re-exported functions to `__all__` for public private subm…
pavyamsiri Oct 5, 2024
d2410fb
`fftpack`: Add re-exported functions to `__all__` for public private …
pavyamsiri Oct 5, 2024
1d5cd4d
`ndimage`: Add re-exported functions to `__all__` for public private …
pavyamsiri Oct 5, 2024
5fb3835
`stats`: Add re-exported functions to `__all__` for public private su…
pavyamsiri Oct 5, 2024
0e4a2be
`interpolate`: Add re-exported functions to `__all__` for public priv…
pavyamsiri Oct 5, 2024
f994bfa
`io`: Add re-exported functions to `__all__` for public private submo…
pavyamsiri Oct 5, 2024
e105065
`signal`: Add re-exported functions to `__all__` for public private s…
pavyamsiri Oct 5, 2024
060db27
`sparse`: Add re-exported functions to `__all__` for public private s…
pavyamsiri Oct 5, 2024
9198b8e
bug_fix: Add type annotations to empty `__all__`
pavyamsiri Oct 7, 2024
909a1bc
bug_fix: Add a dummy version of `convolve`
pavyamsiri Oct 7, 2024
c0a6651
`io`: Add dummy functions and classes instead of re-exporting
pavyamsiri Oct 7, 2024
b8ca1c2
`io.arff`: Do an explicit re-export of _arffread symbols.
pavyamsiri Oct 7, 2024
b55d23c
`fftpack`: Add deprecated dummy function/class stubs
pavyamsiri Oct 7, 2024
fdf4aba
`ndimage`: Add deprecated dummy functions
pavyamsiri Oct 7, 2024
34435fd
`stats`: Add deprecated dummy functions
pavyamsiri Oct 7, 2024
be8a8fd
`interpolate`: Add deprecated dummy functions/classes
pavyamsiri Oct 7, 2024
ef98ebd
`signal`: Add dummy deprecated functions/classes
pavyamsiri Oct 7, 2024
911867e
`sparse`: Add dummy deprecated functions/classes
pavyamsiri Oct 7, 2024
6eb2c41
`sparse.linalg`: Add dummy deprecated functions/classes
pavyamsiri Oct 7, 2024
55e9f3b
MAINT: Use `poe format` to format text
pavyamsiri Oct 7, 2024
cdb7dd8
`io.netcdf`: Use explicit `@override`
pavyamsiri Oct 7, 2024
1757d19
`io.matlab`: Remove redundant `cls` type annotation
pavyamsiri Oct 7, 2024
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
23 changes: 20 additions & 3 deletions scipy-stubs/fftpack/basic.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
from scipy._typing import Untyped
# This module is not meant for public use and will be removed in SciPy v2.0.0.
from typing_extensions import deprecated

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
__all__ = ["fft", "fft2", "fftn", "ifft", "ifft2", "ifftn", "irfft", "rfft"]

@deprecated("will be removed in SciPy v2.0.0")
def fft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def ifft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def rfft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def irfft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def fftn(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def ifftn(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def fft2(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def ifft2(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ...
10 changes: 10 additions & 0 deletions scipy-stubs/fftpack/convolve.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from scipy._typing import Untyped

__all__ = ["convolve", "convolve_z", "destroy_convolve_cache", "init_convolution_kernel"]

def convolve(inout: Untyped, omega: Untyped, swap_real_imag: bool = False, overwrite_x: bool = False) -> Untyped: ...
def convolve_z(inout: Untyped, omega_real: Untyped, omega_imag: Untyped, overwrite_x: bool = False) -> Untyped: ...
def init_convolution_kernel(
n: int, kernel_func: Untyped, d: int = 0, zero_nyquist: int | None = None, kernel_func_extra_args: Untyped = ()
) -> Untyped: ...
def destroy_convolve_cache() -> None: ...
21 changes: 18 additions & 3 deletions scipy-stubs/fftpack/helper.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
from scipy._typing import Untyped
# This module is not meant for public use and will be removed in SciPy v2.0.0.
from typing_extensions import deprecated

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
__all__ = ["fftfreq", "fftshift", "ifftshift", "next_fast_len", "rfftfreq"]

@deprecated("will be removed in SciPy v2.0.0")
def fftfreq(
n: object,
d: object = ...,
device: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def fftshift(x: object, axes: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def ifftshift(x: object, axes: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def next_fast_len(target: object) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def rfftfreq(n: object, d: object = ...) -> object: ...
29 changes: 26 additions & 3 deletions scipy-stubs/fftpack/pseudo_diffs.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
from scipy._typing import Untyped
# This module is not meant for public use and will be removed in SciPy v2.0.0.
from typing_extensions import deprecated

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
from . import convolve as convolve

__all__ = ["cc_diff", "convolve", "cs_diff", "diff", "hilbert", "ihilbert", "itilbert", "sc_diff", "shift", "ss_diff", "tilbert"]

@deprecated("will be removed in SciPy v2.0.0")
def diff(x: object, order: object = 1, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def tilbert(x: object, h: object, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def itilbert(x: object, h: object, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def hilbert(x: object, _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def ihilbert(x: object) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def cs_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def sc_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def ss_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def cc_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def shift(x: object, a: object, period: object = ..., _cache: object = ...) -> object: ...
59 changes: 56 additions & 3 deletions scipy-stubs/fftpack/realtransforms.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,57 @@
from scipy._typing import Untyped
# This module is not meant for public use and will be removed in SciPy v2.0.0.
from typing_extensions import deprecated

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
__all__ = ["dct", "dctn", "dst", "dstn", "idct", "idctn", "idst", "idstn"]

@deprecated("will be removed in SciPy v2.0.0")
def dctn(
x: object,
type: object = ...,
shape: object = ...,
axes: object = ...,
norm: object = ...,
overwrite_x: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def idctn(
x: object,
type: object = ...,
shape: object = ...,
axes: object = ...,
norm: object = ...,
overwrite_x: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def dstn(
x: object,
type: object = ...,
shape: object = ...,
axes: object = ...,
norm: object = ...,
overwrite_x: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def idstn(
x: object,
type: object = ...,
shape: object = ...,
axes: object = ...,
norm: object = ...,
overwrite_x: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def dct(
x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ...
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def idct(
x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ...
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def dst(
x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ...
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def idst(
x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ...
) -> object: ...
1 change: 1 addition & 0 deletions scipy-stubs/integrate/_quad_vec.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def quad_vec(
*,
args: tuple[Unpack[_Ts]],
) -> tuple[_NDT_f, float]: ...

# false positive (basedmypy==1.6.0 / mypy==1.11.1)
@overload
def quad_vec( # type: ignore[overload-overlap]
Expand Down
1 change: 0 additions & 1 deletion scipy-stubs/integrate/_quadrature.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def fixed_quad(
args: tuple[()] = (),
n: op.CanIndex = 5,
) -> _NDT_f: ...

def qmc_quad(
func: Callable[[onpt.Array[tuple[int, int], np.float64]], npt.NDArray[np.floating[Any]]],
a: Sequence[spt.AnyReal] | onpt.AnyFloatingArray,
Expand Down
58 changes: 55 additions & 3 deletions scipy-stubs/interpolate/dfitpack.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
from scipy._typing import Untyped
# This module is not meant for public use and will be removed in SciPy v2.0.0.
from typing import Final

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
__all__ = [
"bispeu",
"bispev",
"curfit",
"dblint",
"fpchec",
"fpcurf0",
"fpcurf1",
"fpcurfm1",
"parcur",
"parder",
"pardeu",
"pardtc",
"percur",
"regrid_smth",
"regrid_smth_spher",
"spalde",
"spherfit_lsq",
"spherfit_smth",
"splder",
"splev",
"splint",
"sproot",
"surfit_lsq",
"surfit_smth",
"types",
]

bispeu: Final[object]
bispev: Final[object]
curfit: Final[object]
dblint: Final[object]
fpchec: Final[object]
fpcurf0: Final[object]
fpcurf1: Final[object]
fpcurfm1: Final[object]
parcur: Final[object]
parder: Final[object]
pardeu: Final[object]
pardtc: Final[object]
percur: Final[object]
regrid_smth: Final[object]
regrid_smth_spher: Final[object]
spalde: Final[object]
spherfit_lsq: Final[object]
spherfit_smth: Final[object]
splder: Final[object]
splev: Final[object]
splint: Final[object]
sproot: Final[object]
surfit_lsq: Final[object]
surfit_smth: Final[object]
types: Final[object]
110 changes: 107 additions & 3 deletions scipy-stubs/interpolate/fitpack.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,108 @@
from scipy._typing import Untyped
# This module is not meant for public use and will be removed in SciPy v2.0.0.
from typing_extensions import deprecated

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
__all__ = [
"BSpline",
"bisplev",
"bisplrep",
"insert",
"spalde",
"splantider",
"splder",
"splev",
"splint",
"splprep",
"splrep",
"sproot",
]

@deprecated("will be removed in SciPy v2.0.0")
def splprep(
x: object,
w: object = ...,
u: object = ...,
ub: object = ...,
ue: object = ...,
k: object = ...,
task: object = ...,
s: object = ...,
t: object = ...,
full_output: object = ...,
nest: object = ...,
per: object = ...,
quiet: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def splrep(
x: object,
y: object,
w: object = ...,
xb: object = ...,
xe: object = ...,
k: object = ...,
task: object = ...,
s: object = ...,
t: object = ...,
full_output: object = ...,
per: object = ...,
quiet: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def splev(x: object, tck: object, der: object = ..., ext: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def splint(a: object, b: object, tck: object, full_output: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def sproot(tck: object, mest: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def spalde(x: object, tck: object) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def insert(x: object, tck: object, m: object = ..., per: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def splder(tck: object, n: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def splantider(tck: object, n: object = ...) -> object: ...

# bsplines
@deprecated("will be removed in SciPy v2.0.0")
class BSpline:
def __init__(self, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> None: ...
@classmethod
def construct_fast(cls, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> object: ...
@property
def tck(self) -> object: ...
@classmethod
def basis_element(cls, t: object, extrapolate: object = ...) -> object: ...
@classmethod
def design_matrix(cls, x: object, t: object, k: object, extrapolate: object = ...) -> object: ...
def __call__(self, x: object, nu: object = ..., extrapolate: object = ...) -> object: ...
def derivative(self, nu: object = ...) -> object: ...
def antiderivative(self, nu: object = ...) -> object: ...
def integrate(self, a: object, b: object, extrapolate: object = ...) -> object: ...
@classmethod
def from_power_basis(cls, pp: object, bc_type: object = ...) -> object: ...
def insert_knot(self, x: object, m: object = ...) -> object: ...

# fitpack_impl
@deprecated("will be removed in SciPy v2.0.0")
def bisplrep(
x: object,
y: object,
z: object,
w: object = ...,
xb: object = ...,
xe: object = ...,
yb: object = ...,
ye: object = ...,
kx: object = ...,
ky: object = ...,
task: object = ...,
s: object = ...,
eps: object = ...,
tx: object = ...,
ty: object = ...,
full_output: object = ...,
nxest: object = ...,
nyest: object = ...,
quiet: object = ...,
) -> object: ...
def bisplev(x: object, y: object, tck: object, dx: object = ..., dy: object = ...) -> object: ...
Loading
Loading