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

scipy.misc #24

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pip install scipy-stubs
| `scipy.io.arff` | 2: partial |
| `scipy.io.matlab` | 2: partial |
| `scipy.linalg` | **4: done** |
| `scipy.misc` | 0: missing |
| ~`scipy.misc`~ | **4: done** |
| `scipy.ndimage` | 2: partial |
| `scipy.odr` | 1: skeleton |
| `scipy.optimize` | 2: partial |
Expand Down
39 changes: 28 additions & 11 deletions scipy-stubs/_lib/doccer.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
from scipy._typing import Untyped

def docformat(docstring, docdict: Untyped | None = None) -> Untyped: ...
def inherit_docstring_from(cls) -> Untyped: ...
def extend_notes_in_docstring(cls, notes) -> Untyped: ...
def replace_notes_in_docstring(cls, notes) -> Untyped: ...
def indentcount_lines(lines) -> Untyped: ...
def filldoc(docdict, unindent_params: bool = True) -> Untyped: ...
def unindent_dict(docdict) -> Untyped: ...
def unindent_string(docstring) -> Untyped: ...
def doc_replace(obj, oldval, newval) -> Untyped: ...
from collections.abc import Callable
from typing_extensions import TypeVar

import optype as op

__all__ = [
"doc_replace",
"docformat",
"extend_notes_in_docstring",
"filldoc",
"indentcount_lines",
"inherit_docstring_from",
"replace_notes_in_docstring",
"unindent_dict",
"unindent_string",
]

_F = TypeVar("_F", bound=Callable[..., object])

def docformat(docstring: str, docdict: dict[str, str] | None = None) -> str: ...
def inherit_docstring_from(cls: type | object) -> Callable[[_F], _F]: ...
def extend_notes_in_docstring(cls: type | object, notes: str) -> Callable[[_F], _F]: ...
def replace_notes_in_docstring(cls: type | object, notes: str) -> Callable[[_F], _F]: ...
def indentcount_lines(lines: op.CanIter[op.CanNext[str]]) -> int: ...
def filldoc(docdict: dict[str, str], unindent_params: bool = True) -> Callable[[_F], _F]: ...
def unindent_dict(docdict: dict[str, str]) -> dict[str, str]: ...
def unindent_string(docstring: str) -> str: ...
def doc_replace(obj: object, oldval: str, newval: str) -> Callable[[_F], _F]: ...
11 changes: 5 additions & 6 deletions scipy-stubs/misc/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from scipy._typing import Untyped
from . import common as common, doccer as doccer
from ._common import *
from typing import Literal

dataset_methods: Untyped
from . import common, doccer # pyright: ignore[reportUnusedImport]
from ._common import *

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
__all__ = ["ascent", "central_diff_weights", "derivative", "electrocardiogram", "face"]
dataset_methods: list[Literal["ascent", "face", "electrocardiogram"]]
35 changes: 29 additions & 6 deletions scipy-stubs/misc/_common.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
from scipy._typing import Untyped
from collections.abc import Callable
from typing import Concatenate, Literal
from typing_extensions import deprecated

def central_diff_weights(Np, ndiv: int = 1) -> Untyped: ...
def derivative(func, x0, dx: float = 1.0, n: int = 1, args=(), order: int = 3) -> Untyped: ...
def ascent() -> Untyped: ...
def face(gray: bool = False) -> Untyped: ...
def electrocardiogram() -> Untyped: ...
import numpy as np
import optype.numpy as onpt

__all__ = ["ascent", "central_diff_weights", "derivative", "electrocardiogram", "face"]

# this module proofs the existance of an afterlife, because we're currently on scipy 1.14.1 -_-

@deprecated("will be completely removed in SciPy 1.12.0")
def central_diff_weights(Np: int, ndiv: int = 1) -> onpt.Array[tuple[int], np.float64]: ...
@deprecated("will be completely removed in SciPy 1.12.0")
def derivative(
func: Callable[Concatenate[float, ...], float],
x0: float,
dx: float = 1.0,
n: int = 1,
args: tuple[object, ...] = (),
order: int = 3,
) -> float: ...
@deprecated("will be completely removed in SciPy 1.12.0")
def ascent() -> onpt.Array[tuple[Literal[512], Literal[512]], np.uint8]: ...
@deprecated("will be completely removed in SciPy 1.12.0")
def face(
gray: bool = False,
) -> onpt.Array[tuple[Literal[768], Literal[1024]] | tuple[Literal[768], Literal[1024], Literal[3]], np.uint8]: ...
@deprecated("will be completely removed in SciPy 1.12.0")
def electrocardiogram() -> onpt.Array[tuple[Literal[108_000]], np.float64]: ...
13 changes: 10 additions & 3 deletions scipy-stubs/misc/common.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from scipy._typing import Untyped
# This file is not meant for public use and will be removed in SciPy v2.0.0.

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
from ._common import *

__all__ = [
"ascent",
"central_diff_weights",
"derivative",
"electrocardiogram",
"face",
]
25 changes: 22 additions & 3 deletions scipy-stubs/misc/doccer.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
from scipy._typing import Untyped
# This file is not meant for public use and will be removed in SciPy v2.0.0.

def __dir__() -> Untyped: ...
def __getattr__(name) -> Untyped: ...
from scipy._lib.doccer import (
docformat,
extend_notes_in_docstring,
filldoc,
indentcount_lines,
inherit_docstring_from,
replace_notes_in_docstring,
unindent_dict,
unindent_string,
)

__all__ = [
"docformat",
"extend_notes_in_docstring",
"filldoc",
"indentcount_lines",
"inherit_docstring_from",
"replace_notes_in_docstring",
"unindent_dict",
"unindent_string",
]
Loading