Skip to content

Commit

Permalink
Merge pull request #54 from pavyamsiri/public-private-submodules
Browse files Browse the repository at this point in the history
First pass on dealing with public private modules: Re-export attributes of public private modules through `__all__`
  • Loading branch information
jorenham authored Oct 7, 2024
2 parents a8eda1b + 1757d19 commit ce78eb0
Show file tree
Hide file tree
Showing 78 changed files with 4,316 additions and 231 deletions.
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

0 comments on commit ce78eb0

Please sign in to comment.