Skip to content
Snippets Groups Projects
Commit 23d7ee2a authored by Felix Fischer's avatar Felix Fischer :shrimp:
Browse files

Added additional typing stubs

parent 5690234c
No related branches found
No related tags found
1 merge request!55Preview
Pipeline #1377674 failed
......@@ -5,4 +5,4 @@ useful across several different projects and repositories. It also contains
stub-files with several data-type annotations for scipy and matplot-lib
functions."""
__version__ = "1.8.3"
__version__ = "1.8.4"
......@@ -536,7 +536,6 @@ def apply_styles(plot_function: Optional[PlotFunction] = None, *,
_plot_function(*args, **kwargs)
if PREVIEW:
# don't create the styled plots
return
errors = (OSError, FileNotFoundError, ThreeDPlotException,
......
......@@ -93,3 +93,10 @@ class CubicSpline:
def integrate(self,
a: float, b: float,
extrapolate: Optional[Union[str, bool]] = None) -> float: ...
def griddata(
points: Matrix, values: Union[Vector, float, complex],
xi: Union[Matrix, tuple[Vector, ...]], method: str = "linear",
fill_value: float = float("nan"), rescale: bool = False
) -> Matrix: ...
......@@ -25,8 +25,10 @@ def periodogram(
detrend: bool = False) -> Tuple[Vector, Vector]: ...
Single = Union[Vector, list[float]]
Double = Union[tuple[Vector, Vector], tuple[list[float], list[float]]]
Single = Union[Vector, list[float], tuple[float, ...]]
Double = Union[
tuple[Vector, Vector], tuple[list[float], list[float]],
tuple[tuple[float, ...], tuple[float, ...]]]
@overload
......@@ -45,13 +47,15 @@ def savgol_filter(
def sosfilt(
sos: Single, x: Single, axis: int = -1, zi: Optional[Single] = None,
sos: Single, x: Union[Single, Matrix],
axis: int = -1, zi: Optional[Single] = None,
padtype: Optional[str] = "odd", padlen: Optional[int] = None)\
-> Vector: ...
def sosfiltfilt(
sos: Single, x: Single, axis: int = -1, zi: Optional[Single] = None,
sos: Single, x: Union[Single, Matrix],
axis: int = -1, zi: Optional[Single] = None,
padtype: Optional[str] = "odd", padlen: Optional[int] = None)\
-> Vector: ...
......
#!/usr/bin/env python3
"""
Typing stubs for skimage.filters.
"""
from typing import Optional, Union, Any
from scientific_plots.types_ import Matrix
def butterworth(
image: Matrix,
cutoff_frequency_ratio: float,
order: int = 4,
high_pass: bool = False,
squared_butterworth: bool = False,
npad: Optional[int] = None) -> Matrix: ...
def sosfreqz(sos: Any,
worN: Optional[Union[int, Vector]] = 512,
whole: bool = False,
fs: Optional[float] = None)\
-> tuple[Vector, Vector]: ...
#!/usr/bin/env python3
"""
Typing stubs for sklearn.ensemble.
"""
from __future__ import annotations
from typing import Optional, Union, List, Tuple, Dict, TypeVar
from scientific_plots.types_ import Matrix, Vector as Vector_
from vector_type import Vector # Assuming Vector is defined in vector_type module
Vector = TypeVar("Vector", bound=Union[Vector_, Matrix])
class IsolationForest:
def __init__(self,
n_estimators: int = 100,
max_samples: Union[int, float, str] = 'auto',
contamination: Union[float, str] = 'auto',
max_features: float = 1.0,
bootstrap: bool = False,
n_jobs: Optional[int] = None,
behaviour: str = 'deprecated',
random_state: Optional[Union[int, np.random.RandomState]] = None,
verbose: int = 0,
warm_start: bool = False) -> None: ...
def fit(self,
X: Vector,
y: Optional[Vector] = None,
sample_weight: Optional[Vector] = None) -> 'IsolationForest': ...
def predict(self, X: Vector) -> Vector: ...
def fit_predict(self,
X: Vector,
y: Optional[Vector] = None,
sample_weight: Optional[Vector] = None) -> Vector: ...
def decision_function(self, X: Vector) -> Vector: ...
def score_samples(self, X: Vector) -> Vector: ...
def get_params(self,
deep: bool = True) -> Dict[str,
Union[int, float, str, bool, None]]: ...
def set_params(self, **params) -> IsolationForest: ...
# Additional methods for compatibility with BaseEstimator and OutlierMixin
def __getstate__(self) -> dict: ...
def __setstate__(self, state: dict) -> None: ...
# Properties
@property
def estimators_(self) -> List: ...
@property
def estimators_samples_(self) -> List: ...
@property
def max_samples_(self) -> int: ...
@property
def offset_(self) -> float: ...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment