Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
82 changes: 65 additions & 17 deletions scipy-stubs/integrate/_odepack.pyi
Original file line number Diff line number Diff line change
@@ -1,29 +1,77 @@
from _typeshed import Incomplete
# defined in scipy/integrate/_odepackmodule.c

from collections.abc import Callable
from typing import Literal, TypedDict, overload, type_check_only

import numpy as np
import optype.numpy as onp

class error(Exception): ...

@type_check_only
class _InfoDict(TypedDict):
hu: onp.Array1D[np.float64]
tcur: onp.Array1D[np.float64]
tolsf: onp.Array1D[np.float64]
tsw: onp.Array1D[np.float64]
nst: onp.Array1D[np.int32]
nfe: onp.Array1D[np.int32]
nje: onp.Array1D[np.int32]
nqu: onp.Array1D[np.int32]
imxer: int
lenrw: int
leniw: int
mused: onp.Array1D[np.int32]

###

# NOTE: This (private) `odeint` differs from the one in `_odepack_py` because it
# doesn't have a `printmessg` kwarg, and has a different return type.
@overload
def odeint(
fun: Callable[..., Incomplete],
y0: onp.ToFloat | onp.ToFloatND,
t: float,
fun: Callable[..., onp.ToFloat1D | float],
y0: onp.ToFloatND | float,
t: onp.ToFloat1D,
args: tuple[object, ...] = (),
Dfun: Callable[..., Incomplete] | None = None,
col_deriv: int = 0,
ml: int = ...,
mu: int = ...,
full_output: onp.ToBool = 0,
rtol: float = ...,
atol: float = ...,
tcrit: float = ...,
Dfun: Callable[..., onp.ToFloat2D] | None = None,
col_deriv: onp.ToBool = 0,
ml: int = -1,
mu: int = -1,
full_output: Literal[0, False] = 0,
rtol: float | None = None,
atol: float | None = None,
tcrit: onp.ToFloat1D | None = None,
h0: float = 0.0,
hmax: float = 0.0,
hmin: float = 0.0,
ixpr: onp.ToBool = 0,
mxstep: int = 0,
mxhnil: int = 0,
mxordn: int = 12,
mxords: int = 5,
tfirst: int = 0,
) -> tuple[onp.Array2D[np.float64], int]: ...
@overload
def odeint(
fun: Callable[..., onp.ToFloat1D | float],
y0: onp.ToFloatND | float,
t: onp.ToFloat1D,
args: tuple[object, ...],
Dfun: Callable[..., onp.ToFloat2D] | None,
col_deriv: onp.ToBool,
ml: int,
mu: int,
full_output: Literal[True, 1],
rtol: float | None = None,
atol: float | None = None,
tcrit: onp.ToFloat1D | None = None,
h0: float = 0.0,
hmax: float = 0.0,
hmin: float = 0.0,
ixpr: float = 0.0,
mxstep: float = 0.0,
ixpr: onp.ToBool = 0,
mxstep: int = 0,
mxhnil: int = 0,
mxordn: int = 0,
mxords: int = 0,
) -> tuple[Incomplete, ...]: ...
mxordn: int = 12,
mxords: int = 5,
tfirst: int = 0,
) -> tuple[onp.Array2D[np.float64], _InfoDict, int]: ...
Loading