diff --git a/pyproject.toml b/pyproject.toml index 3cad230b..f373ca25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,8 +27,33 @@ line-length = 130 target-version = "py39" [tool.ruff.lint] +# TODO: Use extend-select instead to get base E and F rules that don't conflict with the formatter select = [ + "FA", # flake8-future-annotations "I", # isort + "PYI", # flake8-pyi +] +ignore = [ + ### + # Rules we don't want or don't agree with + ### + # Typeshed doesn't want complex or non-literal defaults for maintenance and testing reasons. + # This doesn't affect us, let's have more complete stubs. + "PYI011", + "PYI014", + + # TODO: Investigate and fix or configure + "PYI001", + "PYI002", + "PYI017", + "PYI019", # Request for autofix: https://github.com/astral-sh/ruff/issues/14183 + "PYI021", # Request for autofix: https://github.com/astral-sh/ruff/issues/14123 + "PYI024", + "PYI034", # Request for autofix: https://github.com/astral-sh/ruff/issues/14184 + "PYI041", # Request for autofix: https://github.com/astral-sh/ruff/issues/14185 + "PYI048", + "PYI051", # Request for autofix: https://github.com/astral-sh/ruff/issues/14185 + "PYI052", ] [tool.ruff.lint.isort] @@ -84,7 +109,6 @@ extra-standard-library = [ [tool.pyright] exclude = ["build", ".git"] -stubPath = "./stubs" # Target oldest supported Python version pythonversion = "3.9" typeCheckingMode = "standard" diff --git a/stubs/matplotlib/__init__.pyi b/stubs/matplotlib/__init__.pyi index f62904be..95af35ee 100644 --- a/stubs/matplotlib/__init__.pyi +++ b/stubs/matplotlib/__init__.pyi @@ -48,4 +48,4 @@ def is_interactive() -> bool: ... default_test_modules: list[str] = ... def test(verbosity=..., coverage=..., **kwargs): - int: ... + ... diff --git a/stubs/matplotlib/_layoutgrid.pyi b/stubs/matplotlib/_layoutgrid.pyi index c8b9374a..28463639 100644 --- a/stubs/matplotlib/_layoutgrid.pyi +++ b/stubs/matplotlib/_layoutgrid.pyi @@ -18,7 +18,6 @@ class LayoutGrid: width_ratios: None | list[float] = None, height_ratios: None | list[float] = None, ) -> None: ... - def __repr__(self) -> str: ... def reset_margins(self) -> None: ... def add_constraints(self) -> None: ... def hard_constraints(self) -> None: ... diff --git a/stubs/matplotlib/_mathtext.pyi b/stubs/matplotlib/_mathtext.pyi index 6ef81f3d..f2c2c8b7 100644 --- a/stubs/matplotlib/_mathtext.pyi +++ b/stubs/matplotlib/_mathtext.pyi @@ -111,7 +111,6 @@ class DejaVuSansFontConstants(FontConstantsBase): ... class Node: def __init__(self) -> None: ... - def __repr__(self) -> str: ... def get_kerning(self, next) -> float: ... def shrink(self) -> None: ... def render(self, x: float, y: float) -> None: ... @@ -129,7 +128,6 @@ class Hbox(Box): class Char(Node): def __init__(self, c, state) -> None: ... - def __repr__(self) -> str: ... def is_slanted(self) -> bool: ... def get_kerning(self, next) -> float: ... def render(self, x: float, y: float) -> None: ... @@ -141,7 +139,6 @@ class Accent(Char): class List(Box): def __init__(self, elements) -> None: ... - def __repr__(self) -> str: ... def shrink(self) -> None: ... class Hlist(List): @@ -179,7 +176,6 @@ class Kern(Node): height: float = ... depth: float = ... def __init__(self, width: float) -> None: ... - def __repr__(self) -> str: ... def shrink(self) -> None: ... class AutoHeightChar(Hlist): diff --git a/stubs/matplotlib/_typing.pyi b/stubs/matplotlib/_typing.pyi index efac7656..48eb475c 100644 --- a/stubs/matplotlib/_typing.pyi +++ b/stubs/matplotlib/_typing.pyi @@ -1,20 +1,21 @@ import decimal import io +import typing_extensions import numpy.typing import pandas as pd Decimal = decimal.Decimal -PythonScalar = str | int | float | bool +PythonScalar: typing_extensions.TypeAlias = str | int | float | bool ArrayLike = numpy.typing.ArrayLike FileLike = io.IOBase PathLike = str -PandasScalar = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval -Scalar = PythonScalar | PandasScalar +PandasScalar: typing_extensions.TypeAlias = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval +Scalar: typing_extensions.TypeAlias = PythonScalar | PandasScalar -Color = tuple[float, float, float] | str +Color: typing_extensions.TypeAlias = tuple[float, float, float] | str __all__ = [ "ArrayLike", diff --git a/stubs/matplotlib/animation.pyi b/stubs/matplotlib/animation.pyi index 18869545..1da46a16 100644 --- a/stubs/matplotlib/animation.pyi +++ b/stubs/matplotlib/animation.pyi @@ -15,7 +15,7 @@ class MovieWriterRegistry: def __init__(self) -> None: ... def register(self, name: str) -> Callable: ... def is_available(self, name: str) -> bool: ... - def __iter__(self) -> Generator: ... + def __iter__(self) -> Iterator: ... def list(self) -> list[MovieWriter]: ... def __getitem__(self, name) -> MovieWriter: ... diff --git a/stubs/matplotlib/artist.pyi b/stubs/matplotlib/artist.pyi index a2e16729..2a998c7e 100644 --- a/stubs/matplotlib/artist.pyi +++ b/stubs/matplotlib/artist.pyi @@ -14,7 +14,7 @@ def allow_rasterization( ) -> Callable: ... class _Unset: - def __repr__(self) -> str: ... + ... class Artist: zorder: int = ... diff --git a/stubs/matplotlib/axes/_base.pyi b/stubs/matplotlib/axes/_base.pyi index 1ce94841..fdc0fb97 100644 --- a/stubs/matplotlib/axes/_base.pyi +++ b/stubs/matplotlib/axes/_base.pyi @@ -25,7 +25,6 @@ class _axis_method_wrapper: class _AxesBase(Artist): name: str = ... - def __str__(self) -> str: ... def __init__( self, fig: Figure, @@ -43,7 +42,6 @@ class _AxesBase(Artist): ) -> None: ... def __getstate__(self) -> dict[str, Any]: ... def __setstate__(self, state) -> None: ... - def __repr__(self) -> str: ... def get_window_extent(self, renderer=..., *args, **kwargs) -> TransformedBbox: ... def set_figure(self, fig: Figure) -> None: ... @property diff --git a/stubs/matplotlib/axis.pyi b/stubs/matplotlib/axis.pyi index 5202a0f7..cf4b1afc 100644 --- a/stubs/matplotlib/axis.pyi +++ b/stubs/matplotlib/axis.pyi @@ -109,7 +109,6 @@ class Axis(Artist): OFFSETTEXTPAD: int = ... - def __str__(self) -> str: ... def __init__(self, axes: Axes, pickradius: float = ...) -> None: ... @property def isDefault_majloc(self) -> bool: ... diff --git a/stubs/matplotlib/backend_bases.pyi b/stubs/matplotlib/backend_bases.pyi index c7877b5a..41ba8568 100644 --- a/stubs/matplotlib/backend_bases.pyi +++ b/stubs/matplotlib/backend_bases.pyi @@ -220,7 +220,6 @@ class MouseEvent(LocationEvent): dblclick: bool = ..., guiEvent=..., ) -> None: ... - def __str__(self) -> str: ... class PickEvent(Event): mouseevent: MouseEvent @@ -343,7 +342,6 @@ class _Mode(str, Enum): NONE: _Mode PAN: _Mode ZOOM: _Mode - def __str__(self) -> str: ... class NavigationToolbar2: toolitems = ... diff --git a/stubs/matplotlib/backends/backend_gtk3.pyi b/stubs/matplotlib/backends/backend_gtk3.pyi index bc067614..70f36944 100644 --- a/stubs/matplotlib/backends/backend_gtk3.pyi +++ b/stubs/matplotlib/backends/backend_gtk3.pyi @@ -17,7 +17,7 @@ class __getattr__: class FigureCanvasGTK3(Gtk.DrawingArea, FigureCanvasBase): required_interactive_framework: str = ... - _timer_cls: Type[TimerGTK3] = TimerGTK3 + _timer_cls: Type[TimerGTK3] = ... manager_class: classproperty = ... event_mask: int = ... @@ -66,10 +66,10 @@ class ToolCopyToClipboardGTK3(backend_tools.ToolCopyToClipboardBase): def error_msg_gtk(msg, parent=...) -> None: ... -Toolbar: Type[ToolbarGTK3] = ToolbarGTK3 +Toolbar: Type[ToolbarGTK3] = ... class FigureManagerGTK3(_FigureManagerGTK): ... class _BackendGTK3(_BackendGTK): - FigureCanvas: Type[FigureCanvasGTK3] = FigureCanvasGTK3 - FigureManager: Type[FigureManagerGTK3] = FigureManagerGTK3 + FigureCanvas: Type[FigureCanvasGTK3] = ... + FigureManager: Type[FigureManagerGTK3] = ... diff --git a/stubs/matplotlib/backends/backend_pdf.pyi b/stubs/matplotlib/backends/backend_pdf.pyi index c614b640..b757692a 100644 --- a/stubs/matplotlib/backends/backend_pdf.pyi +++ b/stubs/matplotlib/backends/backend_pdf.pyi @@ -19,15 +19,12 @@ def pdfRepr(obj) -> bytes: ... class Reference: def __init__(self, id: int) -> None: ... - def __repr__(self) -> str: ... def pdfRepr(self) -> bytes: ... - def write(self, contentsy, file: "PdfFile") -> None: ... + def write(self, contentsy, file: PdfFile) -> None: ... @total_ordering class Name: def __init__(self, name: bytes | Name | str) -> None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __eq__(self, other) -> bool: ... def __lt__(self, other) -> bool: ... def __hash__(self) -> int: ... @@ -37,7 +34,6 @@ class Name: class Operator: def __init__(self, op) -> None: ... - def __repr__(self) -> str: ... def pdfRepr(self) -> bytes: ... class Verbatim: @@ -154,7 +150,7 @@ class RendererPdf(_backend_pdf_ps.RendererPDFPSBase): def finalize(self) -> None: ... def check_gc( self, - gc: "GraphicsContextPdf", + gc: GraphicsContextPdf, fillcolor: None | tuple[float, float, float, float] = ..., ) -> None: ... def get_image_magnification(self) -> float: ... @@ -212,7 +208,6 @@ class RendererPdf(_backend_pdf_ps.RendererPDFPSBase): class GraphicsContextPdf(GraphicsContextBase): def __init__(self, file: PdfFile) -> None: ... - def __repr__(self) -> str: ... def stroke(self) -> bool: ... def fill(self, *args) -> bool: ... def paint( @@ -238,7 +233,7 @@ class GraphicsContextPdf(GraphicsContextBase): def pop(self) -> list[Op]: ... def clip_cmd(self, cliprect, clippath) -> list[Op]: ... commands: tuple = ... - def delta(self, other: "GraphicsContextPdf") -> list[Op | Name | float]: ... + def delta(self, other: GraphicsContextPdf) -> list[Op | Name | float]: ... def copy_properties(self, other: GraphicsContextPdf) -> None: ... def finalize(self) -> list[Op]: ... diff --git a/stubs/matplotlib/backends/backend_pgf.pyi b/stubs/matplotlib/backends/backend_pgf.pyi index 43e4bcfc..9c706dcc 100644 --- a/stubs/matplotlib/backends/backend_pgf.pyi +++ b/stubs/matplotlib/backends/backend_pgf.pyi @@ -27,7 +27,6 @@ def make_pdf_to_png_converter() -> Callable: ... class LatexError(Exception): def __init__(self, message, latex_output=...) -> None: ... - def __str__(self) -> str: ... class LatexManager: def __init__(self) -> None: ... diff --git a/stubs/matplotlib/backends/backend_qt.pyi b/stubs/matplotlib/backends/backend_qt.pyi index 39038e08..078dd3c4 100644 --- a/stubs/matplotlib/backends/backend_qt.pyi +++ b/stubs/matplotlib/backends/backend_qt.pyi @@ -29,7 +29,7 @@ class TimerQT(TimerBase): class FigureCanvasQT(QtWidgets.QWidget, FigureCanvasBase): required_interactive_framework: str = ... - _timer_cls: Type[TimerQT] = TimerQT + _timer_cls: Type[TimerQT] = ... manager_class: classproperty = ... buttond: dict[str, MouseButton] = ... diff --git a/stubs/matplotlib/backends/backend_tkagg.pyi b/stubs/matplotlib/backends/backend_tkagg.pyi index 48a1222f..cb5663ff 100644 --- a/stubs/matplotlib/backends/backend_tkagg.pyi +++ b/stubs/matplotlib/backends/backend_tkagg.pyi @@ -10,4 +10,4 @@ class FigureCanvasTkAgg(FigureCanvasAgg, FigureCanvasTk): def blit(self, bbox: Bbox = ...) -> None: ... class _BackendTkAgg(_BackendTk): - FigureCanvas: Type[FigureCanvasAgg] = FigureCanvasTkAgg + FigureCanvas: Type[FigureCanvasAgg] = ... diff --git a/stubs/matplotlib/cbook/__init__.pyi b/stubs/matplotlib/cbook/__init__.pyi index ef790a60..69162240 100644 --- a/stubs/matplotlib/cbook/__init__.pyi +++ b/stubs/matplotlib/cbook/__init__.pyi @@ -25,7 +25,6 @@ class CallbackRegistry: class silent_list(list): def __init__(self, type, seq=...) -> None: ... - def __repr__(self) -> str: ... def strip_math(s: str) -> str: ... def is_writable_file_like(obj) -> bool: ... @@ -65,7 +64,7 @@ class Stack: def remove(self, o) -> None: ... def report_memory(i=...): - int: ... + ... def safe_masked_invalid(x, copy=...) -> np.ndarray: ... def print_cycles(objects, outstream=..., show_progress: bool = ...) -> None: ... @@ -77,7 +76,7 @@ class Grouper: def join(self, a, *args) -> bool: ... def joined(self, a, b) -> bool: ... def remove(self, a) -> None: ... - def __iter__(self) -> Generator: ... + def __iter__(self) -> Iterator: ... def get_siblings(self, a) -> list: ... class GrouperView: diff --git a/stubs/matplotlib/cm.pyi b/stubs/matplotlib/cm.pyi index b4f0a308..1b340d81 100644 --- a/stubs/matplotlib/cm.pyi +++ b/stubs/matplotlib/cm.pyi @@ -11,7 +11,6 @@ class ColormapRegistry(Mapping): def __getitem__(self, item: str): ... def __iter__(self): ... def __len__(self) -> int: ... - def __str__(self) -> str: ... def __call__(self): ... def register(self, cmap: Colormap, *, name: str = ..., force: bool = ...) -> None: ... def unregister(self, name: str) -> None: ... diff --git a/stubs/matplotlib/colorbar.pyi b/stubs/matplotlib/colorbar.pyi index b3628419..747987e6 100644 --- a/stubs/matplotlib/colorbar.pyi +++ b/stubs/matplotlib/colorbar.pyi @@ -82,7 +82,7 @@ class Colorbar: def remove(self) -> None: ... def drag_pan(self, button, key, x, y) -> None: ... -ColorbarBase: Type[Colorbar] = Colorbar +ColorbarBase: Type[Colorbar] = ... def make_axes( parents: Axes | list[Axes], diff --git a/stubs/matplotlib/colors.pyi b/stubs/matplotlib/colors.pyi index dbc3160e..4706a07e 100644 --- a/stubs/matplotlib/colors.pyi +++ b/stubs/matplotlib/colors.pyi @@ -21,7 +21,6 @@ class ColorSequenceRegistry(Mapping): def __getitem__(self, item) -> list[Color]: ... def __iter__(self) -> Iterator[Color]: ... def __len__(self) -> int: ... - def __str__(self) -> str: ... def register(self, name: str, color_list: list[Color]) -> None: ... def unregister(self, name) -> None: ... diff --git a/stubs/matplotlib/container.pyi b/stubs/matplotlib/container.pyi index 7bcae2dc..efed7b6e 100644 --- a/stubs/matplotlib/container.pyi +++ b/stubs/matplotlib/container.pyi @@ -8,7 +8,6 @@ from .lines import Line2D from .patches import Rectangle class Container(tuple): - def __repr__(self) -> str: ... def __new__(cls: Type[Container], *args, **kwargs) -> Container: ... def __init__(self, kl: list[Rectangle], label: str = ...) -> None: ... def remove(self) -> None: ... diff --git a/stubs/matplotlib/dviread.pyi b/stubs/matplotlib/dviread.pyi index f7f96fee..6a7a8890 100644 --- a/stubs/matplotlib/dviread.pyi +++ b/stubs/matplotlib/dviread.pyi @@ -29,7 +29,6 @@ class DviFont: def __init__(self, scale: float, tfm: Tfm, texname: bytes, vf: Vf) -> None: ... def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... - def __repr__(self) -> str: ... class Vf(Dvi): def __init__(self, filename: str | PathLike) -> None: ... diff --git a/stubs/matplotlib/figure.pyi b/stubs/matplotlib/figure.pyi index cc86d406..8df95221 100644 --- a/stubs/matplotlib/figure.pyi +++ b/stubs/matplotlib/figure.pyi @@ -189,7 +189,6 @@ class FigureBase(Artist): class Figure(FigureBase): callbacks = ... - def __str__(self) -> str: ... def __repr__(self): ... def __init__( self, diff --git a/stubs/matplotlib/font_manager.pyi b/stubs/matplotlib/font_manager.pyi index c3804ac3..a084353b 100644 --- a/stubs/matplotlib/font_manager.pyi +++ b/stubs/matplotlib/font_manager.pyi @@ -85,8 +85,7 @@ class FontProperties: math_fontfamily: Literal["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"] = ..., ) -> None: ... def __hash__(self) -> int: ... - def __eq__(self, other: "FontProperties") -> bool: ... - def __str__(self) -> str: ... + def __eq__(self, other: FontProperties) -> bool: ... def get_family(self) -> list[str]: ... def get_name(self) -> str: ... def get_style(self) -> str: ... @@ -152,7 +151,7 @@ class FontProperties: self, fontfamily: Literal["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], ) -> None: ... - def copy(self) -> "FontProperties": ... + def copy(self) -> FontProperties: ... set_name = ... get_slant = ... set_slant = ... diff --git a/stubs/matplotlib/gridspec.pyi b/stubs/matplotlib/gridspec.pyi index db64bff5..8a6cccbd 100644 --- a/stubs/matplotlib/gridspec.pyi +++ b/stubs/matplotlib/gridspec.pyi @@ -12,7 +12,6 @@ class GridSpecBase: height_ratios: ArrayLike = ..., width_ratios: ArrayLike = ..., ) -> None: ... - def __repr__(self) -> str: ... nrows = ... ncols = ... @@ -76,7 +75,6 @@ class SubplotSpec: num1: int, num2: int = ..., ) -> None: ... - def __repr__(self) -> str: ... @property def num2(self): ... @num2.setter diff --git a/stubs/matplotlib/image.pyi b/stubs/matplotlib/image.pyi index c88015bc..48bae13d 100644 --- a/stubs/matplotlib/image.pyi +++ b/stubs/matplotlib/image.pyi @@ -34,7 +34,6 @@ class _ImageBase(Artist, ScalarMappable): interpolation_stage=..., **kwargs, ) -> None: ... - def __str__(self) -> str: ... def __getstate__(self): ... def get_size(self): ... def set_alpha(self, alpha: float | ArrayLike | None) -> None: ... diff --git a/stubs/matplotlib/legend.pyi b/stubs/matplotlib/legend.pyi index 78651aff..e8e55bd0 100644 --- a/stubs/matplotlib/legend.pyi +++ b/stubs/matplotlib/legend.pyi @@ -18,7 +18,6 @@ class DraggableLegend(DraggableOffsetBox): class Legend(Artist): codes = ... zorder = ... - def __str__(self) -> str: ... def __init__( self, parent: Axes | Figure, diff --git a/stubs/matplotlib/lines.pyi b/stubs/matplotlib/lines.pyi index e70e91ef..b3122a4e 100644 --- a/stubs/matplotlib/lines.pyi +++ b/stubs/matplotlib/lines.pyi @@ -22,7 +22,6 @@ class Line2D(Artist): filled_markers = ... fillStyles = ... zorder = ... - def __str__(self) -> str: ... def __init__( self, xdata: Sequence[float], diff --git a/stubs/matplotlib/offsetbox.pyi b/stubs/matplotlib/offsetbox.pyi index 1050ff02..d058d9b5 100644 --- a/stubs/matplotlib/offsetbox.pyi +++ b/stubs/matplotlib/offsetbox.pyi @@ -165,7 +165,6 @@ class OffsetImage(OffsetBox): class AnnotationBbox(Artist, _AnnotationBase): zorder = ... - def __str__(self) -> str: ... def __init__( self, offsetbox, diff --git a/stubs/matplotlib/patches.pyi b/stubs/matplotlib/patches.pyi index 85c1fed4..76423e00 100644 --- a/stubs/matplotlib/patches.pyi +++ b/stubs/matplotlib/patches.pyi @@ -79,14 +79,12 @@ class Patch(Artist): def get_window_extent(self, renderer: RendererBase = ...): ... class Shadow(Patch): - def __str__(self) -> str: ... def __init__(self, patch: Patch, ox: float, oy: float, **kwargs) -> None: ... def get_path(self) -> Path: ... def get_patch_transform(self) -> Transform: ... def draw(self, renderer: RendererBase): ... class Rectangle(Patch): - def __str__(self) -> str: ... def __init__( self, xy: Sequence[float], @@ -122,7 +120,6 @@ class Rectangle(Patch): xy: tuple[float, float] = ... class RegularPolygon(Patch): - def __str__(self) -> str: ... def __init__( self, xy: Sequence[float], numVertices: int, radius: float = ..., orientation: float = ..., **kwargs ) -> None: ... @@ -130,7 +127,6 @@ class RegularPolygon(Patch): def get_patch_transform(self) -> Transform: ... class PathPatch(Patch): - def __str__(self) -> str: ... def __init__(self, path: Path, **kwargs) -> None: ... def get_path(self) -> Path: ... def set_path(self, path: Path): ... @@ -154,7 +150,6 @@ class StepPatch(PathPatch): ): ... class Polygon(Patch): - def __str__(self) -> str: ... def __init__(self, xy: Sequence[float], closed: bool = ..., **kwargs) -> None: ... def get_path(self) -> Path: ... def get_closed(self) -> bool: ... @@ -164,7 +159,6 @@ class Polygon(Patch): xy = ... class Wedge(Patch): - def __str__(self) -> str: ... def __init__(self, center: Sequence[float], r: float, theta1: float, theta2: float, width: float = ..., **kwargs) -> None: ... def set_center(self, center: Sequence[float]): ... def set_radius(self, radius: float): ... @@ -174,13 +168,11 @@ class Wedge(Patch): def get_path(self) -> Path: ... class Arrow(Patch): - def __str__(self) -> str: ... def __init__(self, x: float, y: float, dx: float, dy: float, width: float = ..., **kwargs) -> None: ... def get_path(self) -> Path: ... def get_patch_transform(self) -> Transform: ... class FancyArrow(Polygon): - def __str__(self) -> str: ... def __init__( self, x: float, @@ -209,11 +201,9 @@ class FancyArrow(Polygon): ): ... class CirclePolygon(RegularPolygon): - def __str__(self) -> str: ... def __init__(self, xy: Sequence[float], radius: float = ..., resolution=..., **kwargs) -> None: ... class Ellipse(Patch): - def __str__(self) -> str: ... def __init__(self, xy: Sequence[float], width: float, height: float, angle: float = 0, **kwargs) -> None: ... def get_path(self) -> Path: ... def get_patch_transform(self) -> Transform: ... @@ -233,7 +223,6 @@ class Ellipse(Patch): class Annulus(Patch): def __init__(self, xy: Sequence[float], r: float | Sequence[float], width: float, angle: float = 0, **kwargs) -> None: ... - def __str__(self) -> str: ... def set_center(self, xy: Sequence[float]): ... def get_center(self) -> tuple[float, float]: ... center = ... @@ -251,14 +240,12 @@ class Annulus(Patch): def get_path(self) -> Path: ... class Circle(Ellipse): - def __str__(self) -> str: ... def __init__(self, xy: Sequence[float], radius: float = ..., **kwargs) -> None: ... def set_radius(self, radius: float): ... def get_radius(self) -> float: ... radius: float = ... class Arc(Ellipse): - def __str__(self) -> str: ... def __init__( self, xy: Sequence[float], width: float, height: float, angle: float = 0, theta1: float = 0, theta2: float = 360, **kwargs ) -> None: ... @@ -460,7 +447,6 @@ class ArrowStyle(_Style): def transmute(self, path: Path, mutation_size, linewidth: float): ... class FancyBboxPatch(Patch): - def __str__(self) -> str: ... def __init__( self, xy: Sequence[float], @@ -491,7 +477,6 @@ class FancyBboxPatch(Patch): def get_bbox(self) -> Bbox: ... class FancyArrowPatch(Patch): - def __str__(self) -> str: ... def __init__( self, posA: Sequence[float] = ..., @@ -523,7 +508,6 @@ class FancyArrowPatch(Patch): def draw(self, renderer: RendererBase): ... class ConnectionPatch(FancyArrowPatch): - def __str__(self) -> str: ... def __init__( self, xyA: Sequence[float], diff --git a/stubs/matplotlib/path.pyi b/stubs/matplotlib/path.pyi index 24e4ec78..60194e62 100644 --- a/stubs/matplotlib/path.pyi +++ b/stubs/matplotlib/path.pyi @@ -54,7 +54,7 @@ class Path: self, transform: None = ..., remove_nans: bool = ..., - clip: None | float | float = ..., + clip: None | float = ..., snap: None | bool = ..., stroke_width: float = ..., simplify: None | bool = ..., diff --git a/stubs/matplotlib/projections/geo.pyi b/stubs/matplotlib/projections/geo.pyi index 66457b30..2fa3e5ad 100644 --- a/stubs/matplotlib/projections/geo.pyi +++ b/stubs/matplotlib/projections/geo.pyi @@ -40,7 +40,6 @@ class GeoAxes(Axes): class _GeoTransform(Transform): input_dims = ... def __init__(self, resolution) -> None: ... - def __str__(self) -> str: ... def transform_path_non_affine(self, path: Path) -> Path: ... class AitoffAxes(GeoAxes): diff --git a/stubs/matplotlib/projections/polar.pyi b/stubs/matplotlib/projections/polar.pyi index 2308935c..233dbd91 100644 --- a/stubs/matplotlib/projections/polar.pyi +++ b/stubs/matplotlib/projections/polar.pyi @@ -53,7 +53,7 @@ class ThetaTick(XTick): class ThetaAxis(Axis): axis_name: str = ... - _tick_class: Type[ThetaTick] = ThetaTick + _tick_class: Type[ThetaTick] = ... def clear(self) -> None: ... class RadialLocator(Locator): @@ -73,7 +73,7 @@ class RadialTick(YTick): class RadialAxis(Axis): axis_name: str = ... - _tick_class: Type[RadialTick] = RadialTick + _tick_class: Type[RadialTick] = ... def __init__(self, *args, **kwargs) -> None: ... def clear(self) -> None: ... diff --git a/stubs/matplotlib/pyplot.pyi b/stubs/matplotlib/pyplot.pyi index 20db5b64..a9db83e0 100644 --- a/stubs/matplotlib/pyplot.pyi +++ b/stubs/matplotlib/pyplot.pyi @@ -38,7 +38,7 @@ def draw_all(force: bool = False) -> None: ... def set_loglevel(*args, **kwargs) -> None: ... def findobj(o=..., match=..., include_self: bool = ...) -> list: ... def switch_backend(newbackend: str) -> None: - class backend_mod(_Backend): ... + ... def new_figure_manager(*args, **kwargs) -> FigureManagerBase: ... def draw_if_interactive(*args, **kwargs): ... diff --git a/stubs/matplotlib/scale.pyi b/stubs/matplotlib/scale.pyi index 812b68d2..6e76a5ec 100644 --- a/stubs/matplotlib/scale.pyi +++ b/stubs/matplotlib/scale.pyi @@ -31,14 +31,12 @@ class FuncScale(ScaleBase): class LogTransform(Transform): input_dims = ... def __init__(self, base, nonpositive: Literal["clip", "mask"] = "clip") -> None: ... - def __str__(self) -> str: ... def transform_non_affine(self, a) -> list: ... def inverted(self): ... class InvertedLogTransform(Transform): input_dims = ... def __init__(self, base) -> None: ... - def __str__(self) -> str: ... def transform_non_affine(self, a) -> list: ... def inverted(self): ... @@ -108,14 +106,12 @@ class LogitTransform(Transform): def __init__(self, nonpositive: Literal["mask", "clip"] = ...) -> None: ... def transform_non_affine(self, a): ... def inverted(self): ... - def __str__(self) -> str: ... class LogisticTransform(Transform): input_dims = ... def __init__(self, nonpositive: Literal["mask", "clip"] = ...) -> None: ... def transform_non_affine(self, a): ... def inverted(self): ... - def __str__(self) -> str: ... class LogitScale(ScaleBase): name = ... diff --git a/stubs/matplotlib/spines.pyi b/stubs/matplotlib/spines.pyi index 0b15f581..110d148a 100644 --- a/stubs/matplotlib/spines.pyi +++ b/stubs/matplotlib/spines.pyi @@ -13,7 +13,6 @@ from .path import Path from .transforms import Transform class Spine(Patch): - def __str__(self) -> str: ... def __init__(self, axes: Axes, spine_type: str, path: Path, **kwargs) -> None: ... def set_patch_arc(self, center: Sequence[float], radius: float, theta1: float, theta2: float) -> None: ... def set_patch_circle(self, center: Sequence[float], radius: float) -> None: ... @@ -48,7 +47,7 @@ class SpinesProxy: class Spines(MutableMapping): def __init__(self, **kwargs) -> None: ... @classmethod - def from_dict(cls, d: OrderedDict | dict[str, Spine]) -> "Spines": ... + def from_dict(cls, d: OrderedDict | dict[str, Spine]) -> Spines: ... def __getstate__(self): ... def __setstate__(self, state): ... def __getattr__(self, name: str) -> Spine: ... diff --git a/stubs/matplotlib/style/__init__.pyi b/stubs/matplotlib/style/__init__.pyi index 7918cad6..366c305d 100644 --- a/stubs/matplotlib/style/__init__.pyi +++ b/stubs/matplotlib/style/__init__.pyi @@ -1,10 +1,11 @@ # COMPLETE +import typing_extensions from pathlib import Path from typing import Any, Dict, List, Mapping, Union -_Style = Union[str, Path, Mapping[str, Any]] -_StyleOrList = Union[_Style, List[_Style]] +_Style: typing_extensions.TypeAlias = Union[str, Path, Mapping[str, Any]] +_StyleOrList: typing_extensions.TypeAlias = Union[_Style, List[_Style]] def context(style: _StyleOrList, after_reset: bool = ...) -> None: ... def reload_library() -> None: ... diff --git a/stubs/matplotlib/table.pyi b/stubs/matplotlib/table.pyi index 492fb01b..e3b814f1 100644 --- a/stubs/matplotlib/table.pyi +++ b/stubs/matplotlib/table.pyi @@ -36,7 +36,7 @@ class Cell(Rectangle): def auto_set_font_size(self, renderer: RendererBase) -> float: ... @allow_rasterization def draw(self, renderer): - RendererBase: ... + ... def get_text_bounds(self, renderer: RendererBase): ... def get_required_width(self, renderer: RendererBase): ... diff --git a/stubs/matplotlib/text.pyi b/stubs/matplotlib/text.pyi index a12a2266..164da14f 100644 --- a/stubs/matplotlib/text.pyi +++ b/stubs/matplotlib/text.pyi @@ -176,7 +176,6 @@ class _AnnotationBase: def draggable(self, state: bool | None = ..., use_blit: bool = ...) -> None | DraggableAnnotation: ... class Annotation(Text, _AnnotationBase): - def __str__(self) -> str: ... def __init__( self, text: str, diff --git a/stubs/matplotlib/transforms.pyi b/stubs/matplotlib/transforms.pyi index 792c88c6..3403ac42 100644 --- a/stubs/matplotlib/transforms.pyi +++ b/stubs/matplotlib/transforms.pyi @@ -17,7 +17,7 @@ class TransformNode: pass_through = ... def __init__(self, shorthand_name: str = ...) -> None: ... if DEBUG: - def __str__(self) -> str: ... + pass def __getstate__(self): ... def __setstate__(self, data_dict): ... @@ -123,8 +123,6 @@ class Bbox(BboxBase): @staticmethod def from_extents(*args, minpos: float | None = ...): ... def __format__(self, fmt: str): ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def ignore(self, value: bool): ... def update_from_path( self, @@ -266,7 +264,6 @@ class Affine2DBase(AffineBase): class Affine2D(Affine2DBase): def __init__(self, matrix: ArrayLike = ..., **kwargs) -> None: ... - def __str__(self) -> str: ... @staticmethod def from_values(a: float, b: float, c: float, d: float, e: float, f: float): ... def get_matrix(self) -> np.ndarray: ... diff --git a/stubs/matplotlib/tri/triinterpolate.pyi b/stubs/matplotlib/tri/triinterpolate.pyi index e95f9d53..c111befd 100644 --- a/stubs/matplotlib/tri/triinterpolate.pyi +++ b/stubs/matplotlib/tri/triinterpolate.pyi @@ -85,6 +85,5 @@ class _Sparse_Matrix_coo: def compress_csc(self) -> None: ... def compress_csr(self) -> None: ... def to_dense(self) -> np.ndarray: ... - def __str__(self) -> str: ... @property def diag(self) -> np.ndarray: ... diff --git a/stubs/matplotlib/widgets.pyi b/stubs/matplotlib/widgets.pyi index 709f2bc7..91a6ed17 100644 --- a/stubs/matplotlib/widgets.pyi +++ b/stubs/matplotlib/widgets.pyi @@ -24,10 +24,10 @@ from .transforms import Affine2D, TransformedPatchPath class LockDraw: def __init__(self) -> None: ... - def __call__(self, o: "Lasso") -> None: ... - def release(self, o: "Lasso") -> None: ... - def available(self, o: "Lasso") -> bool: ... - def isowner(self, o: "Lasso") -> bool: ... + def __call__(self, o: Lasso) -> None: ... + def release(self, o: Lasso) -> None: ... + def available(self, o: Lasso) -> bool: ... + def isowner(self, o: Lasso) -> bool: ... def locked(self) -> bool: ... class Widget: diff --git a/stubs/networkx/_typing.pyi b/stubs/networkx/_typing.pyi index efac7656..48eb475c 100644 --- a/stubs/networkx/_typing.pyi +++ b/stubs/networkx/_typing.pyi @@ -1,20 +1,21 @@ import decimal import io +import typing_extensions import numpy.typing import pandas as pd Decimal = decimal.Decimal -PythonScalar = str | int | float | bool +PythonScalar: typing_extensions.TypeAlias = str | int | float | bool ArrayLike = numpy.typing.ArrayLike FileLike = io.IOBase PathLike = str -PandasScalar = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval -Scalar = PythonScalar | PandasScalar +PandasScalar: typing_extensions.TypeAlias = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval +Scalar: typing_extensions.TypeAlias = PythonScalar | PandasScalar -Color = tuple[float, float, float] | str +Color: typing_extensions.TypeAlias = tuple[float, float, float] | str __all__ = [ "ArrayLike", diff --git a/stubs/networkx/algorithms/approximation/kcomponents.pyi b/stubs/networkx/algorithms/approximation/kcomponents.pyi index 4d3d56b3..195b189b 100644 --- a/stubs/networkx/algorithms/approximation/kcomponents.pyi +++ b/stubs/networkx/algorithms/approximation/kcomponents.pyi @@ -23,14 +23,11 @@ class _AntiGraph(Graph): def __getitem__(self, n) -> Mapping: ... def neighbors(self, n): ... - ... - ... @cached_property def adj(self): ... def subgraph(self, nodes): ... - ... @cached_property def degree(self): ... diff --git a/stubs/networkx/algorithms/chordal.pyi b/stubs/networkx/algorithms/chordal.pyi index cb8c7b41..d0dfea83 100644 --- a/stubs/networkx/algorithms/chordal.pyi +++ b/stubs/networkx/algorithms/chordal.pyi @@ -16,7 +16,7 @@ __all__ = [ ] class NetworkXTreewidthBoundExceeded(NetworkXException): - pass + ... def is_chordal(G: Graph) -> bool: ... def find_induced_nodes(G: Graph, s, t, treewidth_bound: float = ...): ... diff --git a/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi b/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi index d8ee5f0d..d3ca448b 100644 --- a/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi +++ b/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi @@ -20,7 +20,7 @@ __all__ = [ ] def copyfunc(f, name=None): ... -def allclose(x, y, rtol: float = 1.0000000000000001e-05, atol: float = 1e-08): ... +def allclose(x, y, rtol: float = ..., atol: float = 1e-08): ... categorical_doc: str = ... @@ -42,7 +42,7 @@ numerical_doc: str = ... def numerical_node_match( attr: str | ArrayLike, default, - rtol: float = 1.0000000000000001e-05, + rtol: float = ..., atol: float = 1e-08, ): ... @@ -51,7 +51,7 @@ numerical_edge_match = ... def numerical_multiedge_match( attr: str | ArrayLike, default, - rtol: float = 1.0000000000000001e-05, + rtol: float = ..., atol: float = 1e-08, ): ... diff --git a/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi b/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi index 99d449af..915b4272 100644 --- a/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi +++ b/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi @@ -31,7 +31,7 @@ class DiGraphMatcher(vf2.DiGraphMatcher): # provide "multi" versions, but we do so to match NetworkX's base classes. class MultiGraphMatcher(GraphMatcher): - pass + ... class MultiDiGraphMatcher(DiGraphMatcher): - pass + ... diff --git a/stubs/networkx/algorithms/lowest_common_ancestors.pyi b/stubs/networkx/algorithms/lowest_common_ancestors.pyi index 269cbbb4..840e6729 100644 --- a/stubs/networkx/algorithms/lowest_common_ancestors.pyi +++ b/stubs/networkx/algorithms/lowest_common_ancestors.pyi @@ -1,5 +1,5 @@ from collections import defaultdict -from collections.abc import Mapping, Set +from collections.abc import Mapping, Set as AbstractSet from itertools import combinations_with_replacement from typing import Any diff --git a/stubs/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/algorithms/tree/branchings.pyi index 11cb0f65..99d57777 100644 --- a/stubs/networkx/algorithms/tree/branchings.pyi +++ b/stubs/networkx/algorithms/tree/branchings.pyi @@ -121,7 +121,6 @@ maximum_spanning_arborescence.__doc__ = ... minimum_spanning_arborescence.__doc__ = ... class ArborescenceIterator: - ... def __init__( self, diff --git a/stubs/networkx/algorithms/tree/coding.pyi b/stubs/networkx/algorithms/tree/coding.pyi index 80749e17..5d50c714 100644 --- a/stubs/networkx/algorithms/tree/coding.pyi +++ b/stubs/networkx/algorithms/tree/coding.pyi @@ -16,7 +16,7 @@ __all__ = [ ] class NotATree(NetworkXException): - pass + ... def to_nested_tuple(T, root, canonical_form: bool = False) -> tuple: ... def from_nested_tuple(sequence: tuple, sensible_relabeling: bool = False): ... diff --git a/stubs/networkx/algorithms/tree/mst.pyi b/stubs/networkx/algorithms/tree/mst.pyi index fe043cfd..65ae57f8 100644 --- a/stubs/networkx/algorithms/tree/mst.pyi +++ b/stubs/networkx/algorithms/tree/mst.pyi @@ -69,7 +69,6 @@ def maximum_spanning_tree(G: Graph, weight: str = "weight", algorithm: str = "kr def random_spanning_tree(G: Graph, weight: str | None = None, *, multiplicative: bool = True, seed=None): ... class SpanningTreeIterator: - ... def __init__( self, diff --git a/stubs/networkx/classes/graph.pyi b/stubs/networkx/classes/graph.pyi index f799168b..87a5a855 100644 --- a/stubs/networkx/classes/graph.pyi +++ b/stubs/networkx/classes/graph.pyi @@ -41,7 +41,6 @@ class Graph: def name(self): ... @name.setter def name(self, s): ... - def __str__(self) -> str: ... def __iter__(self): ... def __contains__(self, n): ... def __len__(self) -> int: ... diff --git a/stubs/networkx/classes/reportviews.pyi b/stubs/networkx/classes/reportviews.pyi index 61fc9098..d115c2c3 100644 --- a/stubs/networkx/classes/reportviews.pyi +++ b/stubs/networkx/classes/reportviews.pyi @@ -1,4 +1,4 @@ -from collections.abc import Mapping, Set +from collections.abc import Mapping, Set as AbstractSet from typing import Any from ..classes.graph import Graph @@ -30,7 +30,7 @@ __all__ = [ ] # NodeViews -class NodeView(Mapping, Set): +class NodeView(Mapping, AbstractSet): __slots__ = ... def __getstate__(self): ... @@ -53,7 +53,7 @@ class NodeView(Mapping, Set): def __str__(self): ... def __repr__(self): ... -class NodeDataView(Set): +class NodeDataView(AbstractSet): __slots__ = ... def __getstate__(self): ... @@ -155,7 +155,7 @@ class InMultiEdgeDataView(OutMultiEdgeDataView): def __contains__(self, e): ... # EdgeViews have set operations and no data reported -class OutEdgeView(Set, Mapping): +class OutEdgeView(AbstractSet, Mapping): __slots__ = ... def __getstate__(self): ... diff --git a/stubs/networkx/exception.pyi b/stubs/networkx/exception.pyi index 33f4b947..ee868918 100644 --- a/stubs/networkx/exception.pyi +++ b/stubs/networkx/exception.pyi @@ -16,43 +16,43 @@ __all__ = [ ] class NetworkXException(Exception): - pass + ... class NetworkXError(NetworkXException): - pass + ... class NetworkXPointlessConcept(NetworkXException): - pass + ... class NetworkXAlgorithmError(NetworkXException): - pass + ... class NetworkXUnfeasible(NetworkXAlgorithmError): - pass + ... class NetworkXNoPath(NetworkXUnfeasible): - pass + ... class NetworkXNoCycle(NetworkXUnfeasible): - pass + ... class HasACycle(NetworkXException): - pass + ... class NetworkXUnbounded(NetworkXAlgorithmError): - pass + ... class NetworkXNotImplemented(NetworkXException): - pass + ... class NodeNotFound(NetworkXException): - pass + ... class AmbiguousSolution(NetworkXException): - pass + ... class ExceededMaxIterations(NetworkXException): - pass + ... class PowerIterationFailedConvergence(ExceededMaxIterations): def __init__(self, num_iterations, *args, **kw): ... diff --git a/stubs/networkx/utils/heaps.pyi b/stubs/networkx/utils/heaps.pyi index a3162eb0..a6aae7f2 100644 --- a/stubs/networkx/utils/heaps.pyi +++ b/stubs/networkx/utils/heaps.pyi @@ -7,7 +7,6 @@ from ..classes.graph import Graph __all__ = ["MinHeap", "PairingHeap", "BinaryHeap"] class MinHeap: - ... def __init__(self): ... def min(self) -> tuple: ... @@ -20,7 +19,6 @@ class MinHeap: def __contains__(self, key): ... class PairingHeap(MinHeap): - ... def __init__(self): ... def min(self) -> tuple: ... diff --git a/stubs/skimage/_shared/utils.pyi b/stubs/skimage/_shared/utils.pyi index df32496a..a8378b8d 100644 --- a/stubs/skimage/_shared/utils.pyi +++ b/stubs/skimage/_shared/utils.pyi @@ -26,7 +26,7 @@ __all__ = [ ] class skimage_deprecation(Warning): - pass + ... def _get_stack_rank(func): ... def _is_wrapped(func): ... diff --git a/stubs/skimage/_typing.pyi b/stubs/skimage/_typing.pyi index efac7656..48eb475c 100644 --- a/stubs/skimage/_typing.pyi +++ b/stubs/skimage/_typing.pyi @@ -1,20 +1,21 @@ import decimal import io +import typing_extensions import numpy.typing import pandas as pd Decimal = decimal.Decimal -PythonScalar = str | int | float | bool +PythonScalar: typing_extensions.TypeAlias = str | int | float | bool ArrayLike = numpy.typing.ArrayLike FileLike = io.IOBase PathLike = str -PandasScalar = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval -Scalar = PythonScalar | PandasScalar +PandasScalar: typing_extensions.TypeAlias = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval +Scalar: typing_extensions.TypeAlias = PythonScalar | PandasScalar -Color = tuple[float, float, float] | str +Color: typing_extensions.TypeAlias = tuple[float, float, float] | str __all__ = [ "ArrayLike", diff --git a/stubs/sklearn/_loss/loss.pyi b/stubs/sklearn/_loss/loss.pyi index b5863637..3057087e 100644 --- a/stubs/sklearn/_loss/loss.pyi +++ b/stubs/sklearn/_loss/loss.pyi @@ -128,7 +128,7 @@ class BaseLoss: self, n_samples: Int, dtype: Type[Float] | Float = ..., - order: Literal["C", "F", "F"] = "F", + order: Literal["C", "F"] = "F", ) -> tuple[ndarray, ndarray]: ... # Note: Naturally, we would inherit in the following order diff --git a/stubs/sklearn/_typing.pyi b/stubs/sklearn/_typing.pyi index fa4801c9..50b06856 100644 --- a/stubs/sklearn/_typing.pyi +++ b/stubs/sklearn/_typing.pyi @@ -4,6 +4,7 @@ import decimal import io +import typing_extensions import numpy as np import numpy.typing @@ -13,20 +14,20 @@ from scipy.sparse import spmatrix from .base import BaseEstimator, ClassifierMixin, RegressorMixin Decimal = decimal.Decimal -PythonScalar = str | int | float | bool +PythonScalar: typing_extensions.TypeAlias = str | int | float | bool ArrayLike = numpy.typing.ArrayLike -MatrixLike = np.ndarray | pd.DataFrame | spmatrix +MatrixLike: typing_extensions.TypeAlias = np.ndarray | pd.DataFrame | spmatrix FileLike = io.IOBase PathLike = str -Int = int | np.int8 | np.int16 | np.int32 | np.int64 -Float = float | np.float16 | np.float32 | np.float64 +Int: typing_extensions.TypeAlias = int | np.int8 | np.int16 | np.int32 | np.int64 +Float: typing_extensions.TypeAlias = float | np.float16 | np.float32 | np.float64 -PandasScalar = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval -Scalar = PythonScalar | PandasScalar +PandasScalar: typing_extensions.TypeAlias = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval +Scalar: typing_extensions.TypeAlias = PythonScalar | PandasScalar Estimator = BaseEstimator Classifier = ClassifierMixin Regressor = RegressorMixin -Color = tuple[float, float, float] | str +Color: typing_extensions.TypeAlias = tuple[float, float, float] | str diff --git a/stubs/sklearn/base.pyi b/stubs/sklearn/base.pyi index dd5afa71..9fbe1c41 100644 --- a/stubs/sklearn/base.pyi +++ b/stubs/sklearn/base.pyi @@ -11,7 +11,7 @@ from .utils._param_validation import validate_parameter_constraints as validate_ from .utils._set_output import _SetOutputMixin from .utils.validation import check_array as check_array, check_is_fitted as check_is_fitted, check_X_y as check_X_y -BaseEstimator_Self = TypeVar("BaseEstimator_Self", bound="BaseEstimator") +BaseEstimator_Self = TypeVar("BaseEstimator_Self", bound=BaseEstimator) # Author: Gael Varoquaux # License: BSD 3 clause diff --git a/stubs/sklearn/calibration.pyi b/stubs/sklearn/calibration.pyi index 181bedaf..df64a156 100644 --- a/stubs/sklearn/calibration.pyi +++ b/stubs/sklearn/calibration.pyi @@ -31,8 +31,8 @@ from .utils.multiclass import check_classification_targets as check_classificati from .utils.parallel import Parallel as Parallel, delayed as delayed from .utils.validation import check_consistent_length as check_consistent_length, check_is_fitted as check_is_fitted -CalibratedClassifierCV_Self = TypeVar("CalibratedClassifierCV_Self", bound="CalibratedClassifierCV") -_SigmoidCalibration_Self = TypeVar("_SigmoidCalibration_Self", bound="_SigmoidCalibration") +CalibratedClassifierCV_Self = TypeVar("CalibratedClassifierCV_Self", bound=CalibratedClassifierCV) +_SigmoidCalibration_Self = TypeVar("_SigmoidCalibration_Self", bound=_SigmoidCalibration) import warnings @@ -50,7 +50,7 @@ class CalibratedClassifierCV(ClassifierMixin, MetaEstimatorMixin, BaseEstimator) self, estimator: None | BaseEstimator = None, *, - method: Literal["sigmoid", "isotonic", "sigmoid"] = "sigmoid", + method: Literal["sigmoid", "isotonic"] = "sigmoid", cv: int | BaseCrossValidator | Iterable | None | str | BaseShuffleSplit = None, n_jobs: None | Int = None, ensemble: bool = True, @@ -73,7 +73,7 @@ class _CalibratedClassifier: calibrators: list[IsotonicRegression | _SigmoidCalibration] | list[BaseEstimator], *, classes: ArrayLike, - method: Literal["sigmoid", "isotonic", "sigmoid"] = "sigmoid", + method: Literal["sigmoid", "isotonic"] = "sigmoid", ) -> None: ... def predict_proba(self, X: ArrayLike) -> ndarray: ... @@ -96,7 +96,7 @@ def calibration_curve( pos_label: None | str | Int = None, normalize: str | bool = "deprecated", n_bins: Int = 5, - strategy: Literal["uniform", "quantile", "uniform"] = "uniform", + strategy: Literal["uniform", "quantile"] = "uniform", ) -> tuple[ndarray, ndarray]: ... class CalibrationDisplay: @@ -129,7 +129,7 @@ class CalibrationDisplay: y: ArrayLike, *, n_bins: Int = 5, - strategy: Literal["uniform", "quantile", "uniform"] = "uniform", + strategy: Literal["uniform", "quantile"] = "uniform", pos_label: None | str | int = None, name: None | str = None, ref_line: bool = True, @@ -143,7 +143,7 @@ class CalibrationDisplay: y_prob: ArrayLike, *, n_bins: Int = 5, - strategy: Literal["uniform", "quantile", "uniform"] = "uniform", + strategy: Literal["uniform", "quantile"] = "uniform", pos_label: None | str | int = None, name: None | str = None, ref_line: bool = True, diff --git a/stubs/sklearn/cluster/_affinity_propagation.pyi b/stubs/sklearn/cluster/_affinity_propagation.pyi index 4482fea7..ea4f77fa 100644 --- a/stubs/sklearn/cluster/_affinity_propagation.pyi +++ b/stubs/sklearn/cluster/_affinity_propagation.pyi @@ -13,7 +13,7 @@ from ..utils import as_float_array as as_float_array, check_random_state as chec from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ..utils.validation import check_is_fitted as check_is_fitted -AffinityPropagation_Self = TypeVar("AffinityPropagation_Self", bound="AffinityPropagation") +AffinityPropagation_Self = TypeVar("AffinityPropagation_Self", bound=AffinityPropagation) import warnings @@ -54,7 +54,7 @@ class AffinityPropagation(ClusterMixin, BaseEstimator): convergence_iter: Int = 15, copy: bool = True, preference: float | None | ArrayLike = None, - affinity: Literal["euclidean", "precomputed", "euclidean"] = "euclidean", + affinity: Literal["euclidean", "precomputed"] = "euclidean", verbose: bool = False, random_state: RandomState | None | Int = None, ) -> None: ... diff --git a/stubs/sklearn/cluster/_agglomerative.pyi b/stubs/sklearn/cluster/_agglomerative.pyi index c526afd4..f895fa88 100644 --- a/stubs/sklearn/cluster/_agglomerative.pyi +++ b/stubs/sklearn/cluster/_agglomerative.pyi @@ -19,8 +19,8 @@ from ..utils._param_validation import HasMethods as HasMethods, Hidden as Hidden from ..utils.validation import check_memory as check_memory from ._feature_agglomeration import AgglomerationTransform -FeatureAgglomeration_Self = TypeVar("FeatureAgglomeration_Self", bound="FeatureAgglomeration") -AgglomerativeClustering_Self = TypeVar("AgglomerativeClustering_Self", bound="AgglomerativeClustering") +FeatureAgglomeration_Self = TypeVar("FeatureAgglomeration_Self", bound=FeatureAgglomeration) +AgglomerativeClustering_Self = TypeVar("AgglomerativeClustering_Self", bound=AgglomerativeClustering) import warnings @@ -42,7 +42,7 @@ def linkage_tree( X: MatrixLike, connectivity: None | MatrixLike = None, n_clusters: None | Int = None, - linkage: Literal["complete", "average", "complete", "single"] = "complete", + linkage: Literal["complete", "average", "single"] = "complete", affinity: str | Callable = "euclidean", return_distance: bool = False, ) -> tuple[ndarray, int, int, ndarray | None, ndarray]: ... @@ -71,8 +71,8 @@ class AgglomerativeClustering(ClusterMixin, BaseEstimator): metric: None | str | Callable = None, # TODO(1.4): Set to "euclidean" memory: None | Memory | str = None, connectivity: None | ArrayLike | Callable = None, - compute_full_tree: Literal["auto", "auto"] | bool = "auto", - linkage: Literal["ward", "complete", "average", "single", "ward"] = "ward", + compute_full_tree: Literal["auto"] | bool = "auto", + linkage: Literal["ward", "complete", "average", "single"] = "ward", distance_threshold: None | Float = None, compute_distances: bool = False, ) -> None: ... @@ -99,8 +99,8 @@ class FeatureAgglomeration(ClassNamePrefixFeaturesOutMixin, AgglomerativeCluster metric: None | str | Callable = None, # TODO(1.4): Set to "euclidean" memory: None | Memory | str = None, connectivity: None | ArrayLike | Callable = None, - compute_full_tree: Literal["auto", "auto"] | bool = "auto", - linkage: Literal["ward", "complete", "average", "single", "ward"] = "ward", + compute_full_tree: Literal["auto"] | bool = "auto", + linkage: Literal["ward", "complete", "average", "single"] = "ward", pooling_func: Callable = ..., distance_threshold: None | Float = None, compute_distances: bool = False, diff --git a/stubs/sklearn/cluster/_bicluster.pyi b/stubs/sklearn/cluster/_bicluster.pyi index 03a7ce5b..de7b3580 100644 --- a/stubs/sklearn/cluster/_bicluster.pyi +++ b/stubs/sklearn/cluster/_bicluster.pyi @@ -20,7 +20,7 @@ from ..utils.extmath import ( from ..utils.validation import assert_all_finite as assert_all_finite from . import KMeans as KMeans, MiniBatchKMeans as MiniBatchKMeans -BaseSpectral_Self = TypeVar("BaseSpectral_Self", bound="BaseSpectral") +BaseSpectral_Self = TypeVar("BaseSpectral_Self", bound=BaseSpectral) import numpy as np @@ -57,10 +57,10 @@ class SpectralCoclustering(BaseSpectral): self, n_clusters: Int = 3, *, - svd_method: Literal["randomized", "arpack", "randomized"] = "randomized", + svd_method: Literal["randomized", "arpack"] = "randomized", n_svd_vecs: None | Int = None, mini_batch: bool = False, - init: MatrixLike | Literal["k-means++", "random", "k-means++"] = "k-means++", + init: MatrixLike | Literal["k-means++", "random"] = "k-means++", n_init: Int = 10, random_state: RandomState | None | Int = None, ) -> None: ... @@ -80,13 +80,13 @@ class SpectralBiclustering(BaseSpectral): self, n_clusters: tuple[int, int] | int = 3, *, - method: Literal["bistochastic", "scale", "log", "bistochastic"] = "bistochastic", + method: Literal["bistochastic", "scale", "log"] = "bistochastic", n_components: Int = 6, n_best: Int = 3, - svd_method: Literal["randomized", "arpack", "randomized"] = "randomized", + svd_method: Literal["randomized", "arpack"] = "randomized", n_svd_vecs: None | Int = None, mini_batch: bool = False, - init: MatrixLike | Literal["k-means++", "random", "k-means++"] = "k-means++", + init: MatrixLike | Literal["k-means++", "random"] = "k-means++", n_init: Int = 10, random_state: RandomState | None | Int = None, ) -> None: ... diff --git a/stubs/sklearn/cluster/_birch.pyi b/stubs/sklearn/cluster/_birch.pyi index 397548fe..6ffe9714 100644 --- a/stubs/sklearn/cluster/_birch.pyi +++ b/stubs/sklearn/cluster/_birch.pyi @@ -17,7 +17,7 @@ from ..utils.extmath import row_norms as row_norms from ..utils.validation import check_is_fitted as check_is_fitted from . import AgglomerativeClustering as AgglomerativeClustering -Birch_Self = TypeVar("Birch_Self", bound="Birch") +Birch_Self = TypeVar("Birch_Self", bound=Birch) # Authors: Manoj Kumar # Alexandre Gramfort diff --git a/stubs/sklearn/cluster/_bisect_k_means.pyi b/stubs/sklearn/cluster/_bisect_k_means.pyi index 000eec7c..2304cc74 100644 --- a/stubs/sklearn/cluster/_bisect_k_means.pyi +++ b/stubs/sklearn/cluster/_bisect_k_means.pyi @@ -9,7 +9,7 @@ from ..utils.extmath import row_norms as row_norms from ..utils.validation import check_is_fitted as check_is_fitted, check_random_state as check_random_state from ._kmeans import _BaseKMeans -BisectingKMeans_Self = TypeVar("BisectingKMeans_Self", bound="BisectingKMeans") +BisectingKMeans_Self = TypeVar("BisectingKMeans_Self", bound=BisectingKMeans) # Author: Michal Krawczyk @@ -37,15 +37,15 @@ class BisectingKMeans(_BaseKMeans): self, n_clusters: Int = 8, *, - init: Literal["k-means++", "random", "random"] | Callable = "random", + init: Literal["k-means++", "random"] | Callable = "random", n_init: Int = 1, random_state: RandomState | None | Int = None, max_iter: Int = 300, verbose: Int = 0, tol: Float = 1e-4, copy_x: bool = True, - algorithm: Literal["lloyd", "elkan", "lloyd"] = "lloyd", - bisecting_strategy: Literal["biggest_inertia", "largest_cluster", "biggest_inertia"] = "biggest_inertia", + algorithm: Literal["lloyd", "elkan"] = "lloyd", + bisecting_strategy: Literal["biggest_inertia", "largest_cluster"] = "biggest_inertia", ) -> None: ... def fit( self: BisectingKMeans_Self, diff --git a/stubs/sklearn/cluster/_dbscan.pyi b/stubs/sklearn/cluster/_dbscan.pyi index 71c3b0ac..2140b07a 100644 --- a/stubs/sklearn/cluster/_dbscan.pyi +++ b/stubs/sklearn/cluster/_dbscan.pyi @@ -10,7 +10,7 @@ from ..neighbors import NearestNeighbors as NearestNeighbors from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ._dbscan_inner import dbscan_inner as dbscan_inner -DBSCAN_Self = TypeVar("DBSCAN_Self", bound="DBSCAN") +DBSCAN_Self = TypeVar("DBSCAN_Self", bound=DBSCAN) # Author: Robert Layton # Joel Nothman @@ -29,7 +29,7 @@ def dbscan( min_samples: Int = 5, metric: str | Callable = "minkowski", metric_params: None | dict = None, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, p: Float = 2, sample_weight: None | ArrayLike = None, @@ -52,7 +52,7 @@ class DBSCAN(ClusterMixin, BaseEstimator): min_samples: Int = 5, metric: str | Callable = "euclidean", metric_params: None | dict = None, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, p: None | Float = None, n_jobs: None | Int = None, diff --git a/stubs/sklearn/cluster/_kmeans.pyi b/stubs/sklearn/cluster/_kmeans.pyi index 2407d349..a12fd731 100644 --- a/stubs/sklearn/cluster/_kmeans.pyi +++ b/stubs/sklearn/cluster/_kmeans.pyi @@ -33,8 +33,8 @@ from ._k_means_lloyd import ( lloyd_iter_chunked_sparse as lloyd_iter_chunked_sparse, ) -KMeans_Self = TypeVar("KMeans_Self", bound="KMeans") -MiniBatchKMeans_Self = TypeVar("MiniBatchKMeans_Self", bound="MiniBatchKMeans") +KMeans_Self = TypeVar("KMeans_Self", bound=KMeans) +MiniBatchKMeans_Self = TypeVar("MiniBatchKMeans_Self", bound=MiniBatchKMeans) import warnings @@ -57,14 +57,14 @@ def k_means( n_clusters: Int, *, sample_weight: None | ArrayLike = None, - init: MatrixLike | Callable | Literal["k-means++", "random", "k-means++"] = "k-means++", + init: MatrixLike | Callable | Literal["k-means++", "random"] = "k-means++", n_init: Literal["auto", "warn"] | int = "warn", max_iter: Int = 300, verbose: bool = False, tol: Float = 1e-4, random_state: RandomState | None | Int = None, copy_x: bool = True, - algorithm: Literal["lloyd", "elkan", "auto", "full", "lloyd"] = "lloyd", + algorithm: Literal["lloyd", "elkan", "auto", "full"] = "lloyd", return_n_iter: bool = False, ) -> tuple[ndarray, ndarray, float] | tuple[ndarray, ndarray, float, int]: ... @@ -117,14 +117,14 @@ class KMeans(_BaseKMeans): self, n_clusters: Int = 8, *, - init: MatrixLike | Callable | Literal["k-means++", "random", "k-means++"] = "k-means++", + init: MatrixLike | Callable | Literal["k-means++", "random"] = "k-means++", n_init: Literal["auto", "warn"] | int = "warn", max_iter: Int = 300, tol: Float = 1e-4, verbose: Int = 0, random_state: RandomState | None | Int = None, copy_x: bool = True, - algorithm: Literal["lloyd", "elkan", "auto", "full", "lloyd"] = "lloyd", + algorithm: Literal["lloyd", "elkan", "auto", "full"] = "lloyd", ) -> None: ... def fit( self: KMeans_Self, @@ -148,7 +148,7 @@ class MiniBatchKMeans(_BaseKMeans): self, n_clusters: Int = 8, *, - init: MatrixLike | Callable | Literal["k-means++", "random", "k-means++"] = "k-means++", + init: MatrixLike | Callable | Literal["k-means++", "random"] = "k-means++", max_iter: Int = 100, batch_size: Int = 1024, verbose: Int = 0, diff --git a/stubs/sklearn/cluster/_mean_shift.pyi b/stubs/sklearn/cluster/_mean_shift.pyi index ed18fb26..6e264589 100644 --- a/stubs/sklearn/cluster/_mean_shift.pyi +++ b/stubs/sklearn/cluster/_mean_shift.pyi @@ -15,7 +15,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted -MeanShift_Self = TypeVar("MeanShift_Self", bound="MeanShift") +MeanShift_Self = TypeVar("MeanShift_Self", bound=MeanShift) # Authors: Conrad Lee # Alexandre Gramfort diff --git a/stubs/sklearn/cluster/_optics.pyi b/stubs/sklearn/cluster/_optics.pyi index 84aab08a..22af1c44 100644 --- a/stubs/sklearn/cluster/_optics.pyi +++ b/stubs/sklearn/cluster/_optics.pyi @@ -15,7 +15,7 @@ from ..utils import gen_batches as gen_batches, get_chunk_n_rows as get_chunk_n_ from ..utils._param_validation import HasMethods as HasMethods, Interval as Interval, StrOptions as StrOptions from ..utils.validation import check_memory as check_memory -OPTICS_Self = TypeVar("OPTICS_Self", bound="OPTICS") +OPTICS_Self = TypeVar("OPTICS_Self", bound=OPTICS) import warnings @@ -46,7 +46,7 @@ class OPTICS(ClusterMixin, BaseEstimator): xi: float = 0.05, predecessor_correction: bool = True, min_cluster_size: float | None | int = None, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, memory: None | Memory | str = None, n_jobs: None | Int = None, diff --git a/stubs/sklearn/cluster/_spectral.pyi b/stubs/sklearn/cluster/_spectral.pyi index d8f5a79e..fb7efb52 100644 --- a/stubs/sklearn/cluster/_spectral.pyi +++ b/stubs/sklearn/cluster/_spectral.pyi @@ -16,7 +16,7 @@ from ..utils import as_float_array as as_float_array, check_random_state as chec from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ._kmeans import k_means as k_means -SpectralClustering_Self = TypeVar("SpectralClustering_Self", bound="SpectralClustering") +SpectralClustering_Self = TypeVar("SpectralClustering_Self", bound=SpectralClustering) import warnings @@ -40,7 +40,7 @@ def spectral_clustering( random_state: RandomState | None | Int = None, n_init: Int = 10, eigen_tol: str | Float = "auto", - assign_labels: Literal["kmeans", "discretize", "cluster_qr", "kmeans"] = "kmeans", + assign_labels: Literal["kmeans", "discretize", "cluster_qr"] = "kmeans", verbose: bool = False, ) -> ndarray: ... @@ -64,7 +64,7 @@ class SpectralClustering(ClusterMixin, BaseEstimator): affinity: str | Callable = "rbf", n_neighbors: Int = 10, eigen_tol: str | Float = "auto", - assign_labels: Literal["kmeans", "discretize", "cluster_qr", "kmeans"] = "kmeans", + assign_labels: Literal["kmeans", "discretize", "cluster_qr"] = "kmeans", degree: Float = 3, coef0: Float = 1, kernel_params: None | Mapping[str, Any] = None, diff --git a/stubs/sklearn/compose/_column_transformer.pyi b/stubs/sklearn/compose/_column_transformer.pyi index f6fe6d05..77a5df85 100644 --- a/stubs/sklearn/compose/_column_transformer.pyi +++ b/stubs/sklearn/compose/_column_transformer.pyi @@ -15,7 +15,7 @@ from ..utils.metaestimators import _BaseComposition from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_array as check_array, check_is_fitted as check_is_fitted -ColumnTransformer_Self = TypeVar("ColumnTransformer_Self", bound="ColumnTransformer") +ColumnTransformer_Self = TypeVar("ColumnTransformer_Self", bound=ColumnTransformer) import numpy as np @@ -35,7 +35,7 @@ class ColumnTransformer(TransformerMixin, _BaseComposition): self, transformers: Sequence[tuple], *, - remainder: Literal["drop", "passthrough", "drop"] | BaseEstimator = "drop", + remainder: Literal["drop", "passthrough"] | BaseEstimator = "drop", sparse_threshold: Float = 0.3, n_jobs: None | Int = None, transformer_weights: None | dict = None, @@ -54,7 +54,7 @@ class ColumnTransformer(TransformerMixin, _BaseComposition): def make_column_transformer( *transformers, - remainder: Literal["drop", "passthrough", "drop"] | BaseEstimator = "drop", + remainder: Literal["drop", "passthrough"] | BaseEstimator = "drop", sparse_threshold: Float = 0.3, n_jobs: None | Int = None, verbose: bool = False, diff --git a/stubs/sklearn/compose/_target.pyi b/stubs/sklearn/compose/_target.pyi index 782bc388..ffa384b1 100644 --- a/stubs/sklearn/compose/_target.pyi +++ b/stubs/sklearn/compose/_target.pyi @@ -11,7 +11,7 @@ from ..utils import check_array as check_array from ..utils._param_validation import HasMethods as HasMethods from ..utils.validation import check_is_fitted as check_is_fitted -TransformedTargetRegressor_Self = TypeVar("TransformedTargetRegressor_Self", bound="TransformedTargetRegressor") +TransformedTargetRegressor_Self = TypeVar("TransformedTargetRegressor_Self", bound=TransformedTargetRegressor) # Authors: Andreas Mueller # Guillaume Lemaitre diff --git a/stubs/sklearn/covariance/_elliptic_envelope.pyi b/stubs/sklearn/covariance/_elliptic_envelope.pyi index f7a27f30..4d8dc6a2 100644 --- a/stubs/sklearn/covariance/_elliptic_envelope.pyi +++ b/stubs/sklearn/covariance/_elliptic_envelope.pyi @@ -11,7 +11,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.validation import check_is_fitted as check_is_fitted from . import MinCovDet -EllipticEnvelope_Self = TypeVar("EllipticEnvelope_Self", bound="EllipticEnvelope") +EllipticEnvelope_Self = TypeVar("EllipticEnvelope_Self", bound=EllipticEnvelope) # Author: Virgile Fritsch # diff --git a/stubs/sklearn/covariance/_empirical_covariance.pyi b/stubs/sklearn/covariance/_empirical_covariance.pyi index aac6bf80..656dc9ad 100644 --- a/stubs/sklearn/covariance/_empirical_covariance.pyi +++ b/stubs/sklearn/covariance/_empirical_covariance.pyi @@ -10,7 +10,7 @@ from ..metrics.pairwise import pairwise_distances as pairwise_distances from ..utils import check_array as check_array from ..utils.extmath import fast_logdet as fast_logdet -EmpiricalCovariance_Self = TypeVar("EmpiricalCovariance_Self", bound="EmpiricalCovariance") +EmpiricalCovariance_Self = TypeVar("EmpiricalCovariance_Self", bound=EmpiricalCovariance) # Author: Alexandre Gramfort # Gael Varoquaux @@ -42,7 +42,7 @@ class EmpiricalCovariance(BaseEstimator): def error_norm( self, comp_cov: MatrixLike, - norm: Literal["frobenius", "spectral", "frobenius"] = "frobenius", + norm: Literal["frobenius", "spectral"] = "frobenius", scaling: bool = True, squared: bool = True, ) -> Float: ... diff --git a/stubs/sklearn/covariance/_graph_lasso.pyi b/stubs/sklearn/covariance/_graph_lasso.pyi index e354cfe3..9fd4e629 100644 --- a/stubs/sklearn/covariance/_graph_lasso.pyi +++ b/stubs/sklearn/covariance/_graph_lasso.pyi @@ -14,8 +14,8 @@ from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_random_state as check_random_state, check_scalar as check_scalar from . import EmpiricalCovariance, empirical_covariance as empirical_covariance, log_likelihood as log_likelihood -GraphicalLassoCV_Self = TypeVar("GraphicalLassoCV_Self", bound="GraphicalLassoCV") -GraphicalLasso_Self = TypeVar("GraphicalLasso_Self", bound="GraphicalLasso") +GraphicalLassoCV_Self = TypeVar("GraphicalLassoCV_Self", bound=GraphicalLassoCV) +GraphicalLasso_Self = TypeVar("GraphicalLasso_Self", bound=GraphicalLasso) import operator import sys @@ -36,7 +36,7 @@ def graphical_lasso( alpha: Float, *, cov_init: None | MatrixLike = None, - mode: Literal["cd", "lars", "cd"] = "cd", + mode: Literal["cd", "lars"] = "cd", tol: Float = 1e-4, enet_tol: Float = 1e-4, max_iter: Int = 100, @@ -78,7 +78,7 @@ class GraphicalLasso(BaseGraphicalLasso): self, alpha: Float = 0.01, *, - mode: Literal["cd", "lars", "cd"] = "cd", + mode: Literal["cd", "lars"] = "cd", tol: Float = 1e-4, enet_tol: Float = 1e-4, max_iter: Int = 100, @@ -93,7 +93,7 @@ def graphical_lasso_path( alphas: ArrayLike, cov_init: None | MatrixLike = None, X_test: None | MatrixLike = None, - mode: Literal["cd", "lars", "cd"] = "cd", + mode: Literal["cd", "lars"] = "cd", tol: Float = 1e-4, enet_tol: Float = 1e-4, max_iter: Int = 100, @@ -121,7 +121,7 @@ class GraphicalLassoCV(BaseGraphicalLasso): tol: Float = 1e-4, enet_tol: Float = 1e-4, max_iter: Int = 100, - mode: Literal["cd", "lars", "cd"] = "cd", + mode: Literal["cd", "lars"] = "cd", n_jobs: None | Int = None, verbose: bool = False, assume_centered: bool = False, diff --git a/stubs/sklearn/covariance/_robust_covariance.pyi b/stubs/sklearn/covariance/_robust_covariance.pyi index b4be6d28..34a07084 100644 --- a/stubs/sklearn/covariance/_robust_covariance.pyi +++ b/stubs/sklearn/covariance/_robust_covariance.pyi @@ -12,7 +12,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.extmath import fast_logdet as fast_logdet from . import EmpiricalCovariance, empirical_covariance as empirical_covariance -MinCovDet_Self = TypeVar("MinCovDet_Self", bound="MinCovDet") +MinCovDet_Self = TypeVar("MinCovDet_Self", bound=MinCovDet) # Author: Virgile Fritsch # diff --git a/stubs/sklearn/covariance/_shrunk_covariance.pyi b/stubs/sklearn/covariance/_shrunk_covariance.pyi index a3574542..e6f05ede 100644 --- a/stubs/sklearn/covariance/_shrunk_covariance.pyi +++ b/stubs/sklearn/covariance/_shrunk_covariance.pyi @@ -9,9 +9,9 @@ from ..utils import check_array as check_array from ..utils._param_validation import Interval as Interval from . import EmpiricalCovariance, empirical_covariance as empirical_covariance -ShrunkCovariance_Self = TypeVar("ShrunkCovariance_Self", bound="ShrunkCovariance") -LedoitWolf_Self = TypeVar("LedoitWolf_Self", bound="LedoitWolf") -OAS_Self = TypeVar("OAS_Self", bound="OAS") +ShrunkCovariance_Self = TypeVar("ShrunkCovariance_Self", bound=ShrunkCovariance) +LedoitWolf_Self = TypeVar("LedoitWolf_Self", bound=LedoitWolf) +OAS_Self = TypeVar("OAS_Self", bound=OAS) # Author: Alexandre Gramfort # Gael Varoquaux diff --git a/stubs/sklearn/cross_decomposition/_pls.pyi b/stubs/sklearn/cross_decomposition/_pls.pyi index 36b761a0..a9fb662c 100644 --- a/stubs/sklearn/cross_decomposition/_pls.pyi +++ b/stubs/sklearn/cross_decomposition/_pls.pyi @@ -12,9 +12,9 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.extmath import svd_flip as svd_flip from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted -PLSSVD_Self = TypeVar("PLSSVD_Self", bound="PLSSVD") -PLSRegression_Self = TypeVar("PLSRegression_Self", bound="PLSRegression") -_PLS_Self = TypeVar("_PLS_Self", bound="_PLS") +PLSSVD_Self = TypeVar("PLSSVD_Self", bound=PLSSVD) +PLSRegression_Self = TypeVar("PLSRegression_Self", bound=PLSRegression) +_PLS_Self = TypeVar("_PLS_Self", bound=_PLS) import warnings @@ -120,7 +120,7 @@ class PLSCanonical(_PLS): n_components: Int = 2, *, scale: bool = True, - algorithm: Literal["nipals", "svd", "nipals"] = "nipals", + algorithm: Literal["nipals", "svd"] = "nipals", max_iter: Int = 500, tol: Float = 1e-06, copy: bool = True, diff --git a/stubs/sklearn/datasets/_base.pyi b/stubs/sklearn/datasets/_base.pyi index 299d619a..bc5a9710 100644 --- a/stubs/sklearn/datasets/_base.pyi +++ b/stubs/sklearn/datasets/_base.pyi @@ -41,7 +41,7 @@ def load_files( load_content: bool = True, shuffle: bool = True, encoding: None | str = None, - decode_error: Literal["strict", "ignore", "replace", "strict"] = "strict", + decode_error: Literal["strict", "ignore", "replace"] = "strict", random_state: RandomState | None | Int = 0, allowed_extensions: None | Sequence[str] = None, ) -> Bunch: ... diff --git a/stubs/sklearn/datasets/_lfw.pyi b/stubs/sklearn/datasets/_lfw.pyi index dd00f2d0..a9a751c5 100644 --- a/stubs/sklearn/datasets/_lfw.pyi +++ b/stubs/sklearn/datasets/_lfw.pyi @@ -39,7 +39,7 @@ def fetch_lfw_people( ) -> Bunch | tuple[Bunch, tuple]: ... def fetch_lfw_pairs( *, - subset: Literal["train", "test", "10_folds", "train"] = "train", + subset: Literal["train", "test", "10_folds"] = "train", data_home: None | str = None, funneled: bool = True, resize: Float = 0.5, diff --git a/stubs/sklearn/datasets/_rcv1.pyi b/stubs/sklearn/datasets/_rcv1.pyi index 614d6bf8..8644a2e0 100644 --- a/stubs/sklearn/datasets/_rcv1.pyi +++ b/stubs/sklearn/datasets/_rcv1.pyi @@ -38,7 +38,7 @@ logger = ... def fetch_rcv1( *, data_home: None | str = None, - subset: Literal["train", "test", "all", "all"] = "all", + subset: Literal["train", "test", "all"] = "all", download_if_missing: bool = True, random_state: RandomState | None | Int = None, shuffle: bool = False, diff --git a/stubs/sklearn/datasets/_samples_generator.pyi b/stubs/sklearn/datasets/_samples_generator.pyi index b55b6740..23578f55 100644 --- a/stubs/sklearn/datasets/_samples_generator.pyi +++ b/stubs/sklearn/datasets/_samples_generator.pyi @@ -47,7 +47,7 @@ def make_multilabel_classification( length: Int = 50, allow_unlabeled: bool = True, sparse: bool = False, - return_indicator: Literal["dense", "sparse", "dense"] | bool = "dense", + return_indicator: Literal["dense", "sparse"] | bool = "dense", return_distributions: bool = False, random_state: RandomState | None | Int = None, ) -> tuple[ndarray, ndarray | spmatrix, ndarray, ndarray]: ... diff --git a/stubs/sklearn/datasets/_svmlight_format_io.pyi b/stubs/sklearn/datasets/_svmlight_format_io.pyi index 203b15c8..ef234bc6 100644 --- a/stubs/sklearn/datasets/_svmlight_format_io.pyi +++ b/stubs/sklearn/datasets/_svmlight_format_io.pyi @@ -17,7 +17,7 @@ def load_svmlight_file( n_features: None | Int = None, dtype: dtype = ..., multilabel: bool = False, - zero_based: Literal["auto", "auto"] | bool = "auto", + zero_based: Literal["auto"] | bool = "auto", query_id: bool = False, offset: Int = 0, length: Int = ..., @@ -28,7 +28,7 @@ def load_svmlight_files( n_features: None | Int = None, dtype: dtype = ..., multilabel: bool = False, - zero_based: Literal["auto", "auto"] | bool = "auto", + zero_based: Literal["auto"] | bool = "auto", query_id: bool = False, offset: Int = 0, length: Int = ..., diff --git a/stubs/sklearn/datasets/_twenty_newsgroups.pyi b/stubs/sklearn/datasets/_twenty_newsgroups.pyi index b959e9d9..52f3876c 100644 --- a/stubs/sklearn/datasets/_twenty_newsgroups.pyi +++ b/stubs/sklearn/datasets/_twenty_newsgroups.pyi @@ -43,7 +43,7 @@ def strip_newsgroup_footer(text: str) -> str: ... def fetch_20newsgroups( *, data_home: None | str = None, - subset: Literal["train", "test", "all", "train"] = "train", + subset: Literal["train", "test", "all"] = "train", categories: None | ArrayLike = None, shuffle: bool = True, random_state: RandomState | None | Int = 42, @@ -53,7 +53,7 @@ def fetch_20newsgroups( ) -> Bunch | tuple[list[str], ndarray] | tuple[Bunch, tuple]: ... def fetch_20newsgroups_vectorized( *, - subset: Literal["train", "test", "all", "train"] = "train", + subset: Literal["train", "test", "all"] = "train", remove: tuple = ..., data_home: None | str = None, download_if_missing: bool = True, diff --git a/stubs/sklearn/decomposition/_base.pyi b/stubs/sklearn/decomposition/_base.pyi index cad9c845..f327b120 100644 --- a/stubs/sklearn/decomposition/_base.pyi +++ b/stubs/sklearn/decomposition/_base.pyi @@ -8,7 +8,7 @@ from .._typing import MatrixLike from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin from ..utils.validation import check_is_fitted as check_is_fitted -_BasePCA_Self = TypeVar("_BasePCA_Self", bound="_BasePCA") +_BasePCA_Self = TypeVar("_BasePCA_Self", bound=_BasePCA) # Author: Alexandre Gramfort # Olivier Grisel diff --git a/stubs/sklearn/decomposition/_dict_learning.pyi b/stubs/sklearn/decomposition/_dict_learning.pyi index d3ad4e40..bb50fd3f 100644 --- a/stubs/sklearn/decomposition/_dict_learning.pyi +++ b/stubs/sklearn/decomposition/_dict_learning.pyi @@ -22,9 +22,9 @@ from ..utils.extmath import randomized_svd as randomized_svd, row_norms as row_n from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted -DictionaryLearning_Self = TypeVar("DictionaryLearning_Self", bound="DictionaryLearning") -SparseCoder_Self = TypeVar("SparseCoder_Self", bound="SparseCoder") -MiniBatchDictionaryLearning_Self = TypeVar("MiniBatchDictionaryLearning_Self", bound="MiniBatchDictionaryLearning") +DictionaryLearning_Self = TypeVar("DictionaryLearning_Self", bound=DictionaryLearning) +SparseCoder_Self = TypeVar("SparseCoder_Self", bound=SparseCoder) +MiniBatchDictionaryLearning_Self = TypeVar("MiniBatchDictionaryLearning_Self", bound=MiniBatchDictionaryLearning) # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause @@ -43,7 +43,7 @@ def sparse_encode( *, gram: None | MatrixLike = None, cov: None | MatrixLike = None, - algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold", "lasso_lars"] = "lasso_lars", + algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold"] = "lasso_lars", n_nonzero_coefs: None | Int = None, alpha: None | Float = None, copy_cov: bool = True, @@ -61,7 +61,7 @@ def dict_learning( alpha: Int, max_iter: Int = 100, tol: Float = 1e-8, - method: Literal["lars", "cd", "lars"] = "lars", + method: Literal["lars", "cd"] = "lars", n_jobs: None | Int = None, dict_init: None | MatrixLike = None, code_init: None | MatrixLike = None, @@ -87,7 +87,7 @@ def dict_learning_online( verbose: bool = False, shuffle: bool = True, n_jobs: None | Int = None, - method: Literal["lars", "cd", "lars"] = "lars", + method: Literal["lars", "cd"] = "lars", iter_offset: str | Int = "deprecated", random_state: RandomState | None | Int = None, return_inner_stats: str | bool = "deprecated", @@ -122,7 +122,7 @@ class SparseCoder(_BaseSparseCoding, BaseEstimator): self, dictionary: MatrixLike, *, - transform_algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold", "omp"] = "omp", + transform_algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold"] = "omp", transform_n_nonzero_coefs: None | Int = None, transform_alpha: None | Float = None, split_sign: bool = False, @@ -153,8 +153,8 @@ class DictionaryLearning(_BaseSparseCoding, BaseEstimator): alpha: Float = 1, max_iter: Int = 1000, tol: Float = 1e-8, - fit_algorithm: Literal["lars", "cd", "lars"] = "lars", - transform_algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold", "omp"] = "omp", + fit_algorithm: Literal["lars", "cd"] = "lars", + transform_algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold"] = "omp", transform_n_nonzero_coefs: None | Int = None, transform_alpha: None | Float = None, n_jobs: None | int = None, @@ -185,12 +185,12 @@ class MiniBatchDictionaryLearning(_BaseSparseCoding, BaseEstimator): alpha: Float = 1, n_iter: str | Int = "deprecated", max_iter: None | Int = None, - fit_algorithm: Literal["lars", "cd", "lars"] = "lars", + fit_algorithm: Literal["lars", "cd"] = "lars", n_jobs: None | Int = None, batch_size: str | Int = "warn", shuffle: bool = True, dict_init: None | MatrixLike = None, - transform_algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold", "omp"] = "omp", + transform_algorithm: Literal["lasso_lars", "lasso_cd", "lars", "omp", "threshold"] = "omp", transform_n_nonzero_coefs: None | Int = None, transform_alpha: None | Float = None, verbose: int | bool = False, @@ -203,13 +203,13 @@ class MiniBatchDictionaryLearning(_BaseSparseCoding, BaseEstimator): tol: Float = 1e-3, max_no_improvement: Int = 10, ) -> None: ... - @deprecated("The attribute `iter_offset_` is deprecated in 1.1 and will be removed in 1.3.") # type: ignore + @deprecated(...) # type: ignore @property def iter_offset_(self) -> int: ... - @deprecated("The attribute `random_state_` is deprecated in 1.1 and will be removed in 1.3.") # type: ignore + @deprecated(...) # type: ignore @property def random_state_(self) -> RandomState: ... - @deprecated("The attribute `inner_stats_` is deprecated in 1.1 and will be removed in 1.3.") # type: ignore + @deprecated(...) # type: ignore @property def inner_stats_(self) -> tuple[ndarray, ndarray]: ... def fit(self: MiniBatchDictionaryLearning_Self, X: MatrixLike, y: Any = None) -> MiniBatchDictionaryLearning_Self: ... diff --git a/stubs/sklearn/decomposition/_factor_analysis.pyi b/stubs/sklearn/decomposition/_factor_analysis.pyi index 501721f6..e7c7f0c1 100644 --- a/stubs/sklearn/decomposition/_factor_analysis.pyi +++ b/stubs/sklearn/decomposition/_factor_analysis.pyi @@ -14,7 +14,7 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.extmath import fast_logdet as fast_logdet, randomized_svd as randomized_svd, squared_norm as squared_norm from ..utils.validation import check_is_fitted as check_is_fitted -FactorAnalysis_Self = TypeVar("FactorAnalysis_Self", bound="FactorAnalysis") +FactorAnalysis_Self = TypeVar("FactorAnalysis_Self", bound=FactorAnalysis) # Author: Christian Osendorfer # Alexandre Gramfort @@ -45,7 +45,7 @@ class FactorAnalysis(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEsti copy: bool = True, max_iter: Int = 1000, noise_variance_init: None | ArrayLike = None, - svd_method: Literal["lapack", "randomized", "randomized"] = "randomized", + svd_method: Literal["lapack", "randomized"] = "randomized", iterated_power: Int = 3, rotation: None | Literal["varimax", "quartimax"] = None, random_state: None | RandomState | int = 0, diff --git a/stubs/sklearn/decomposition/_fastica.pyi b/stubs/sklearn/decomposition/_fastica.pyi index 9e41bfd7..67f2d713 100644 --- a/stubs/sklearn/decomposition/_fastica.pyi +++ b/stubs/sklearn/decomposition/_fastica.pyi @@ -12,7 +12,7 @@ from ..utils import as_float_array as as_float_array, check_array as check_array from ..utils._param_validation import Hidden as Hidden, Interval as Interval, StrOptions as StrOptions from ..utils.validation import check_is_fitted as check_is_fitted -FastICA_Self = TypeVar("FastICA_Self", bound="FastICA") +FastICA_Self = TypeVar("FastICA_Self", bound=FastICA) # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann @@ -28,14 +28,14 @@ def fastica( X: MatrixLike, n_components: None | Int = None, *, - algorithm: Literal["parallel", "deflation", "parallel"] = "parallel", + algorithm: Literal["parallel", "deflation"] = "parallel", whiten: str | bool = "warn", - fun: Literal["logcosh", "exp", "cube", "logcosh"] | Callable = "logcosh", + fun: Literal["logcosh", "exp", "cube"] | Callable = "logcosh", fun_args: None | dict = None, max_iter: Int = 200, tol: Float = 1e-04, w_init: None | MatrixLike = None, - whiten_solver: Literal["eigh", "svd", "svd"] = "svd", + whiten_solver: Literal["eigh", "svd"] = "svd", random_state: RandomState | None | Int = None, return_X_mean: bool = False, compute_sources: bool = True, @@ -57,14 +57,14 @@ class FastICA(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator): self, n_components: None | Int = None, *, - algorithm: Literal["parallel", "deflation", "parallel"] = "parallel", + algorithm: Literal["parallel", "deflation"] = "parallel", whiten: str | bool = "warn", - fun: Literal["logcosh", "exp", "cube", "logcosh"] | Callable = "logcosh", + fun: Literal["logcosh", "exp", "cube"] | Callable = "logcosh", fun_args: None | dict = None, max_iter: Int = 200, tol: Float = 1e-4, w_init: None | MatrixLike = None, - whiten_solver: Literal["eigh", "svd", "svd"] = "svd", + whiten_solver: Literal["eigh", "svd"] = "svd", random_state: RandomState | None | Int = None, ) -> None: ... def fit_transform(self, X: MatrixLike, y: Any = None) -> ndarray: ... diff --git a/stubs/sklearn/decomposition/_incremental_pca.pyi b/stubs/sklearn/decomposition/_incremental_pca.pyi index d15d64fb..9cce800f 100644 --- a/stubs/sklearn/decomposition/_incremental_pca.pyi +++ b/stubs/sklearn/decomposition/_incremental_pca.pyi @@ -10,7 +10,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.extmath import svd_flip as svd_flip from ._base import _BasePCA -IncrementalPCA_Self = TypeVar("IncrementalPCA_Self", bound="IncrementalPCA") +IncrementalPCA_Self = TypeVar("IncrementalPCA_Self", bound=IncrementalPCA) import numpy as np diff --git a/stubs/sklearn/decomposition/_kernel_pca.pyi b/stubs/sklearn/decomposition/_kernel_pca.pyi index a4367108..1703e0a6 100644 --- a/stubs/sklearn/decomposition/_kernel_pca.pyi +++ b/stubs/sklearn/decomposition/_kernel_pca.pyi @@ -15,7 +15,7 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.extmath import svd_flip as svd_flip from ..utils.validation import check_is_fitted as check_is_fitted -KernelPCA_Self = TypeVar("KernelPCA_Self", bound="KernelPCA") +KernelPCA_Self = TypeVar("KernelPCA_Self", bound=KernelPCA) # Author: Mathieu Blondel # Sylvain Marie @@ -38,17 +38,17 @@ class KernelPCA(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator self, n_components: None | Int = None, *, - kernel: Callable | Literal["linear", "poly", "rbf", "sigmoid", "cosine", "precomputed", "linear"] = "linear", + kernel: Callable | Literal["linear", "poly", "rbf", "sigmoid", "cosine", "precomputed"] = "linear", gamma: None | Float = None, degree: Int = 3, coef0: Float = 1, kernel_params: None | dict = None, alpha: Float = 1.0, fit_inverse_transform: bool = False, - eigen_solver: Literal["auto", "dense", "arpack", "randomized", "auto"] = "auto", + eigen_solver: Literal["auto", "dense", "arpack", "randomized"] = "auto", tol: Float = 0, max_iter: None | Int = None, - iterated_power: Literal["auto", "auto"] | int = "auto", + iterated_power: Literal["auto"] | int = "auto", remove_zero_eig: bool = False, random_state: RandomState | None | Int = None, copy_X: bool = True, diff --git a/stubs/sklearn/decomposition/_lda.pyi b/stubs/sklearn/decomposition/_lda.pyi index 29f1dabf..6a512a47 100644 --- a/stubs/sklearn/decomposition/_lda.pyi +++ b/stubs/sklearn/decomposition/_lda.pyi @@ -14,7 +14,7 @@ from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted, check_non_negative as check_non_negative from ._online_lda_fast import mean_change as cy_mean_change -LatentDirichletAllocation_Self = TypeVar("LatentDirichletAllocation_Self", bound="LatentDirichletAllocation") +LatentDirichletAllocation_Self = TypeVar("LatentDirichletAllocation_Self", bound=LatentDirichletAllocation) import numpy as np import scipy.sparse as sp @@ -41,7 +41,7 @@ class LatentDirichletAllocation(ClassNamePrefixFeaturesOutMixin, TransformerMixi *, doc_topic_prior: None | Float = None, topic_word_prior: None | Float = None, - learning_method: Literal["batch", "online", "batch"] = "batch", + learning_method: Literal["batch", "online"] = "batch", learning_decay: Float = 0.7, learning_offset: Float = 10.0, max_iter: Int = 10, diff --git a/stubs/sklearn/decomposition/_nmf.pyi b/stubs/sklearn/decomposition/_nmf.pyi index 96033410..4bc8948d 100644 --- a/stubs/sklearn/decomposition/_nmf.pyi +++ b/stubs/sklearn/decomposition/_nmf.pyi @@ -17,8 +17,8 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.extmath import randomized_svd as randomized_svd, safe_sparse_dot as safe_sparse_dot, squared_norm as squared_norm from ..utils.validation import check_is_fitted as check_is_fitted, check_non_negative as check_non_negative -MiniBatchNMF_Self = TypeVar("MiniBatchNMF_Self", bound="MiniBatchNMF") -_BaseNMF_Self = TypeVar("_BaseNMF_Self", bound="_BaseNMF") +MiniBatchNMF_Self = TypeVar("MiniBatchNMF_Self", bound=MiniBatchNMF) +_BaseNMF_Self = TypeVar("_BaseNMF_Self", bound=_BaseNMF) import itertools import time @@ -39,12 +39,12 @@ def non_negative_factorization( *, init: Literal["random", "nndsvd", "nndsvda", "nndsvdar", "custom"] | None = None, update_H: bool = True, - solver: Literal["cd", "mu", "cd"] = "cd", - beta_loss: float | Literal["frobenius", "kullback-leibler", "itakura-saito", "frobenius"] = "frobenius", + solver: Literal["cd", "mu"] = "cd", + beta_loss: float | Literal["frobenius", "kullback-leibler", "itakura-saito"] = "frobenius", tol: Float = 1e-4, max_iter: Int = 200, alpha_W: Float = 0.0, - alpha_H: float | Literal["same", "same"] = "same", + alpha_H: float | Literal["same"] = "same", l1_ratio: Float = 0.0, random_state: RandomState | None | Int = None, verbose: Int = 0, @@ -86,13 +86,13 @@ class NMF(_BaseNMF): n_components: None | Int = None, *, init: Literal["random", "nndsvd", "nndsvda", "nndsvdar", "custom"] | None = None, - solver: Literal["cd", "mu", "cd"] = "cd", - beta_loss: float | Literal["frobenius", "kullback-leibler", "itakura-saito", "frobenius"] = "frobenius", + solver: Literal["cd", "mu"] = "cd", + beta_loss: float | Literal["frobenius", "kullback-leibler", "itakura-saito"] = "frobenius", tol: Float = 1e-4, max_iter: Int = 200, random_state: RandomState | None | Int = None, alpha_W: Float = 0.0, - alpha_H: float | Literal["same", "same"] = "same", + alpha_H: float | Literal["same"] = "same", l1_ratio: Float = 0.0, verbose: Int = 0, shuffle: bool = False, @@ -123,12 +123,12 @@ class MiniBatchNMF(_BaseNMF): *, init: Literal["random", "nndsvd", "nndsvda", "nndsvdar", "custom"] | None = None, batch_size: Int = 1024, - beta_loss: float | Literal["frobenius", "kullback-leibler", "itakura-saito", "frobenius"] = "frobenius", + beta_loss: float | Literal["frobenius", "kullback-leibler", "itakura-saito"] = "frobenius", tol: Float = 1e-4, max_no_improvement: Int = 10, max_iter: Int = 200, alpha_W: Float = 0.0, - alpha_H: float | Literal["same", "same"] = "same", + alpha_H: float | Literal["same"] = "same", l1_ratio: Float = 0.0, forget_factor: Float = 0.7, fresh_restarts: bool = False, diff --git a/stubs/sklearn/decomposition/_pca.pyi b/stubs/sklearn/decomposition/_pca.pyi index 77f7a8b3..602be090 100644 --- a/stubs/sklearn/decomposition/_pca.pyi +++ b/stubs/sklearn/decomposition/_pca.pyi @@ -22,7 +22,7 @@ from ..utils.extmath import ( from ..utils.validation import check_is_fitted as check_is_fitted from ._base import _BasePCA -PCA_Self = TypeVar("PCA_Self", bound="PCA") +PCA_Self = TypeVar("PCA_Self", bound=PCA) import numpy as np @@ -46,18 +46,18 @@ class PCA(_BasePCA): *, copy: bool = True, whiten: bool = False, - svd_solver: Literal["auto", "full", "arpack", "randomized", "auto"] = "auto", + svd_solver: Literal["auto", "full", "arpack", "randomized"] = "auto", tol: Float = 0.0, - iterated_power: Literal["auto", "auto"] | Int = "auto", + iterated_power: Literal["auto"] | Int = "auto", n_oversamples: Int = 10, - power_iteration_normalizer: Literal["auto", "QR", "LU", "none", "auto"] = "auto", + power_iteration_normalizer: Literal["auto", "QR", "LU", "none"] = "auto", random_state: RandomState | None | Int = None, ) -> None: ... # TODO(1.4): remove in 1.4 # mypy error: Decorated property not supported @deprecated( # type: ignore - "Attribute `n_features_` was deprecated in version 1.2 and will be removed in 1.4. Use `n_features_in_` instead." + ... ) @property def n_features_(self) -> int: ... diff --git a/stubs/sklearn/decomposition/_sparse_pca.pyi b/stubs/sklearn/decomposition/_sparse_pca.pyi index c5222583..8e242a6d 100644 --- a/stubs/sklearn/decomposition/_sparse_pca.pyi +++ b/stubs/sklearn/decomposition/_sparse_pca.pyi @@ -13,7 +13,7 @@ from ..utils.extmath import svd_flip as svd_flip from ..utils.validation import check_array as check_array, check_is_fitted as check_is_fitted from ._dict_learning import MiniBatchDictionaryLearning as MiniBatchDictionaryLearning, dict_learning as dict_learning -_BaseSparsePCA_Self = TypeVar("_BaseSparsePCA_Self", bound="_BaseSparsePCA") +_BaseSparsePCA_Self = TypeVar("_BaseSparsePCA_Self", bound=_BaseSparsePCA) import numpy as np @@ -56,7 +56,7 @@ class SparsePCA(_BaseSparsePCA): ridge_alpha: Float = 0.01, max_iter: Int = 1000, tol: Float = 1e-8, - method: Literal["lars", "cd", "lars"] = "lars", + method: Literal["lars", "cd"] = "lars", n_jobs: None | Int = None, U_init: None | MatrixLike = None, V_init: None | MatrixLike = None, @@ -87,7 +87,7 @@ class MiniBatchSparsePCA(_BaseSparsePCA): verbose: int | bool = False, shuffle: bool = True, n_jobs: None | Int = None, - method: Literal["lars", "cd", "lars"] = "lars", + method: Literal["lars", "cd"] = "lars", random_state: RandomState | None | Int = None, tol: Float = 1e-3, max_no_improvement: None | int = 10, diff --git a/stubs/sklearn/decomposition/_truncated_svd.pyi b/stubs/sklearn/decomposition/_truncated_svd.pyi index 68d207b3..e9b718d2 100644 --- a/stubs/sklearn/decomposition/_truncated_svd.pyi +++ b/stubs/sklearn/decomposition/_truncated_svd.pyi @@ -13,7 +13,7 @@ from ..utils.extmath import randomized_svd as randomized_svd, safe_sparse_dot as from ..utils.sparsefuncs import mean_variance_axis as mean_variance_axis from ..utils.validation import check_is_fitted as check_is_fitted -TruncatedSVD_Self = TypeVar("TruncatedSVD_Self", bound="TruncatedSVD") +TruncatedSVD_Self = TypeVar("TruncatedSVD_Self", bound=TruncatedSVD) import numpy as np import scipy.sparse as sp @@ -34,10 +34,10 @@ class TruncatedSVD(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstima self, n_components: Int = 2, *, - algorithm: Literal["arpack", "randomized", "randomized"] = "randomized", + algorithm: Literal["arpack", "randomized"] = "randomized", n_iter: Int = 5, n_oversamples: Int = 10, - power_iteration_normalizer: Literal["auto", "QR", "LU", "none", "auto"] = "auto", + power_iteration_normalizer: Literal["auto", "QR", "LU", "none"] = "auto", random_state: RandomState | None | Int = None, tol: Float = 0.0, ) -> None: ... diff --git a/stubs/sklearn/discriminant_analysis.pyi b/stubs/sklearn/discriminant_analysis.pyi index 0302a63e..738b7320 100644 --- a/stubs/sklearn/discriminant_analysis.pyi +++ b/stubs/sklearn/discriminant_analysis.pyi @@ -20,8 +20,8 @@ from .utils.extmath import softmax as softmax from .utils.multiclass import check_classification_targets as check_classification_targets, unique_labels as unique_labels from .utils.validation import check_is_fitted as check_is_fitted -LinearDiscriminantAnalysis_Self = TypeVar("LinearDiscriminantAnalysis_Self", bound="LinearDiscriminantAnalysis") -QuadraticDiscriminantAnalysis_Self = TypeVar("QuadraticDiscriminantAnalysis_Self", bound="QuadraticDiscriminantAnalysis") +LinearDiscriminantAnalysis_Self = TypeVar("LinearDiscriminantAnalysis_Self", bound=LinearDiscriminantAnalysis) +QuadraticDiscriminantAnalysis_Self = TypeVar("QuadraticDiscriminantAnalysis_Self", bound=QuadraticDiscriminantAnalysis) # Authors: Clemens Brunner # Martin Billinger @@ -59,7 +59,7 @@ class LinearDiscriminantAnalysis( def __init__( self, - solver: Literal["svd", "lsqr", "eigen", "svd"] = "svd", + solver: Literal["svd", "lsqr", "eigen"] = "svd", shrinkage: float | None | str = None, priors: None | ArrayLike = None, n_components: None | Int = None, diff --git a/stubs/sklearn/dummy.pyi b/stubs/sklearn/dummy.pyi index 9c5d91d2..1a2500c4 100644 --- a/stubs/sklearn/dummy.pyi +++ b/stubs/sklearn/dummy.pyi @@ -15,8 +15,8 @@ from .utils.validation import ( check_is_fitted as check_is_fitted, ) -DummyRegressor_Self = TypeVar("DummyRegressor_Self", bound="DummyRegressor") -DummyClassifier_Self = TypeVar("DummyClassifier_Self", bound="DummyClassifier") +DummyRegressor_Self = TypeVar("DummyRegressor_Self", bound=DummyRegressor) +DummyClassifier_Self = TypeVar("DummyClassifier_Self", bound=DummyClassifier) # Author: Mathieu Blondel # Arnaud Joly @@ -40,7 +40,7 @@ class DummyClassifier(MultiOutputMixin, ClassifierMixin, BaseEstimator): def __init__( self, *, - strategy: Literal["most_frequent", "prior", "stratified", "uniform", "constant", "prior"] = "prior", + strategy: Literal["most_frequent", "prior", "stratified", "uniform", "constant"] = "prior", random_state: RandomState | None | Int = None, constant: None | str | ArrayLike | int = None, ) -> None: ... @@ -69,7 +69,7 @@ class DummyRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator): def __init__( self, *, - strategy: Literal["mean", "median", "quantile", "constant", "mean"] = "mean", + strategy: Literal["mean", "median", "quantile", "constant"] = "mean", constant: float | None | ArrayLike | int = None, quantile: float | None = None, ) -> None: ... diff --git a/stubs/sklearn/ensemble/_bagging.pyi b/stubs/sklearn/ensemble/_bagging.pyi index 01302115..878989f3 100644 --- a/stubs/sklearn/ensemble/_bagging.pyi +++ b/stubs/sklearn/ensemble/_bagging.pyi @@ -20,7 +20,7 @@ from ..utils.random import sample_without_replacement as sample_without_replacem from ..utils.validation import check_is_fitted as check_is_fitted, has_fit_parameter as has_fit_parameter from ._base import BaseEnsemble -BaseBagging_Self = TypeVar("BaseBagging_Self", bound="BaseBagging") +BaseBagging_Self = TypeVar("BaseBagging_Self", bound=BaseBagging) # Author: Gilles Louppe # License: BSD 3 clause diff --git a/stubs/sklearn/ensemble/_base.pyi b/stubs/sklearn/ensemble/_base.pyi index 30293fbe..40d1b5b6 100644 --- a/stubs/sklearn/ensemble/_base.pyi +++ b/stubs/sklearn/ensemble/_base.pyi @@ -13,7 +13,7 @@ from ..tree import ( from ..utils import Bunch, check_random_state as check_random_state, deprecated from ..utils.metaestimators import _BaseComposition -_BaseHeterogeneousEnsemble_Self = TypeVar("_BaseHeterogeneousEnsemble_Self", bound="_BaseHeterogeneousEnsemble") +_BaseHeterogeneousEnsemble_Self = TypeVar("_BaseHeterogeneousEnsemble_Self", bound=_BaseHeterogeneousEnsemble) import warnings @@ -38,7 +38,7 @@ class BaseEnsemble(MetaEstimatorMixin, BaseEstimator, metaclass=ABCMeta): # TODO(1.4): remove # mypy error: Decorated property not supported @deprecated( # type: ignore - "Attribute `base_estimator_` was deprecated in version 1.2 and will be removed in 1.4. Use `estimator_` instead." + ... ) @property def base_estimator_(self) -> BaseEstimator: ... diff --git a/stubs/sklearn/ensemble/_forest.pyi b/stubs/sklearn/ensemble/_forest.pyi index a3abcce2..e0f3fcb6 100644 --- a/stubs/sklearn/ensemble/_forest.pyi +++ b/stubs/sklearn/ensemble/_forest.pyi @@ -27,8 +27,8 @@ from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted from ._base import BaseEnsemble -BaseForest_Self = TypeVar("BaseForest_Self", bound="BaseForest") -RandomTreesEmbedding_Self = TypeVar("RandomTreesEmbedding_Self", bound="RandomTreesEmbedding") +BaseForest_Self = TypeVar("BaseForest_Self", bound=BaseForest) +RandomTreesEmbedding_Self = TypeVar("RandomTreesEmbedding_Self", bound=RandomTreesEmbedding) import threading @@ -135,12 +135,12 @@ class RandomForestClassifier(ForestClassifier): self, n_estimators: Int = 100, *, - criterion: Literal["gini", "entropy", "log_loss", "gini"] = "gini", + criterion: Literal["gini", "entropy", "log_loss"] = "gini", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, min_weight_fraction_leaf: Float = 0.0, - max_features: float | Literal["sqrt", "log2", "sqrt"] | int = "sqrt", + max_features: float | Literal["sqrt", "log2"] | int = "sqrt", max_leaf_nodes: None | Int = None, min_impurity_decrease: Float = 0.0, bootstrap: bool = True, @@ -171,13 +171,7 @@ class RandomForestRegressor(ForestRegressor): self, n_estimators: Int = 100, *, - criterion: Literal[ - "squared_error", - "absolute_error", - "friedman_mse", - "poisson", - "squared_error", - ] = "squared_error", + criterion: Literal["squared_error", "absolute_error", "friedman_mse", "poisson"] = "squared_error", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, @@ -214,12 +208,12 @@ class ExtraTreesClassifier(ForestClassifier): self, n_estimators: Int = 100, *, - criterion: Literal["gini", "entropy", "log_loss", "gini"] = "gini", + criterion: Literal["gini", "entropy", "log_loss"] = "gini", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, min_weight_fraction_leaf: Float = 0.0, - max_features: float | Literal["sqrt", "log2", "sqrt"] | int = "sqrt", + max_features: float | Literal["sqrt", "log2"] | int = "sqrt", max_leaf_nodes: None | Int = None, min_impurity_decrease: Float = 0.0, bootstrap: bool = False, @@ -250,13 +244,7 @@ class ExtraTreesRegressor(ForestRegressor): self, n_estimators: Int = 100, *, - criterion: Literal[ - "squared_error", - "absolute_error", - "friedman_mse", - "poisson", - "squared_error", - ] = "squared_error", + criterion: Literal["squared_error", "absolute_error", "friedman_mse", "poisson"] = "squared_error", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, diff --git a/stubs/sklearn/ensemble/_gb.pyi b/stubs/sklearn/ensemble/_gb.pyi index 8f5f3f24..65b59846 100644 --- a/stubs/sklearn/ensemble/_gb.pyi +++ b/stubs/sklearn/ensemble/_gb.pyi @@ -21,7 +21,7 @@ from ._base import BaseEnsemble from ._gb_losses import LossFunction from ._gradient_boosting import predict_stage as predict_stage, predict_stages as predict_stages -BaseGradientBoosting_Self = TypeVar("BaseGradientBoosting_Self", bound="BaseGradientBoosting") +BaseGradientBoosting_Self = TypeVar("BaseGradientBoosting_Self", bound=BaseGradientBoosting) import warnings @@ -74,7 +74,7 @@ class BaseGradientBoosting(BaseEnsemble, metaclass=ABCMeta): # TODO(1.3): Remove # mypy error: Decorated property not supported - @deprecated("Attribute `loss_` was deprecated in version 1.1 and will be removed in 1.3.") # type: ignore + @deprecated(...) # type: ignore def loss_(self): ... class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting): @@ -97,11 +97,11 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting): def __init__( self, *, - loss: Literal["log_loss", "deviance", "exponential", "log_loss"] = "log_loss", + loss: Literal["log_loss", "deviance", "exponential"] = "log_loss", learning_rate: Float = 0.1, n_estimators: Int = 100, subsample: Float = 1.0, - criterion: Literal["friedman_mse", "squared_error", "friedman_mse"] = "friedman_mse", + criterion: Literal["friedman_mse", "squared_error"] = "friedman_mse", min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, min_weight_fraction_leaf: Float = 0.0, @@ -143,11 +143,11 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting): def __init__( self, *, - loss: Literal["squared_error", "absolute_error", "huber", "quantile", "squared_error"] = "squared_error", + loss: Literal["squared_error", "absolute_error", "huber", "quantile"] = "squared_error", learning_rate: Float = 0.1, n_estimators: Int = 100, subsample: Float = 1.0, - criterion: Literal["friedman_mse", "squared_error", "friedman_mse"] = "friedman_mse", + criterion: Literal["friedman_mse", "squared_error"] = "friedman_mse", min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, min_weight_fraction_leaf: Float = 0.0, diff --git a/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi b/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi index fd69d2ca..09dddb5d 100644 --- a/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi +++ b/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi @@ -16,7 +16,7 @@ from .common import ( X_DTYPE as X_DTYPE, ) -_BinMapper_Self = TypeVar("_BinMapper_Self", bound="_BinMapper") +_BinMapper_Self = TypeVar("_BinMapper_Self", bound=_BinMapper) # Author: Nicolas Hug diff --git a/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi b/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi index a5d0b9e9..fa99b6b5 100644 --- a/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi +++ b/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi @@ -31,7 +31,7 @@ from ...utils.validation import check_consistent_length as check_consistent_leng from .common import G_H_DTYPE as G_H_DTYPE, X_DTYPE as X_DTYPE, Y_DTYPE as Y_DTYPE from .grower import TreeGrower as TreeGrower -BaseHistGradientBoosting_Self = TypeVar("BaseHistGradientBoosting_Self", bound="BaseHistGradientBoosting") +BaseHistGradientBoosting_Self = TypeVar("BaseHistGradientBoosting_Self", bound=BaseHistGradientBoosting) import itertools import warnings @@ -90,7 +90,7 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting): def __init__( self, - loss: Literal["squared_error", "absolute_error", "poisson", "quantile", "squared_error"] = "squared_error", + loss: Literal["squared_error", "absolute_error", "poisson", "quantile"] = "squared_error", *, quantile: None | Float = None, learning_rate: Float = 0.1, @@ -105,7 +105,7 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting): monotonic_cst: None | Mapping | ArrayLike = None, interaction_cst: None | Literal["pairwise", "no_interaction"] | Sequence[list[int] | tuple[int, ...] | set[int]] = None, warm_start: bool = False, - early_stopping: Literal["auto", "auto"] | bool = "auto", + early_stopping: Literal["auto"] | bool = "auto", scoring: None | str | Callable = "loss", validation_fraction: float | None | int = 0.1, n_iter_no_change: Int = 10, @@ -132,13 +132,7 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting): def __init__( self, - loss: Literal[ - "log_loss", - "log_loss", - "auto", - "binary_crossentropy", - "categorical_crossentropy", - ] = "log_loss", + loss: Literal["log_loss", "auto", "binary_crossentropy", "categorical_crossentropy"] = "log_loss", *, learning_rate: Float = 0.1, max_iter: Int = 100, @@ -152,7 +146,7 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting): monotonic_cst: None | Mapping | ArrayLike = None, interaction_cst: None | Literal["pairwise", "no_interaction"] | Sequence[list[int] | tuple[int, ...] | set[int]] = None, warm_start: bool = False, - early_stopping: Literal["auto", "auto"] | bool = "auto", + early_stopping: Literal["auto"] | bool = "auto", scoring: None | str | Callable = "loss", validation_fraction: float | None | int = 0.1, n_iter_no_change: Int = 10, diff --git a/stubs/sklearn/ensemble/_iforest.pyi b/stubs/sklearn/ensemble/_iforest.pyi index 097059ed..1d134eb9 100644 --- a/stubs/sklearn/ensemble/_iforest.pyi +++ b/stubs/sklearn/ensemble/_iforest.pyi @@ -20,7 +20,7 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.validation import check_is_fitted as check_is_fitted from ._bagging import BaseBagging -IsolationForest_Self = TypeVar("IsolationForest_Self", bound="IsolationForest") +IsolationForest_Self = TypeVar("IsolationForest_Self", bound=IsolationForest) # Authors: Nicolas Goix # Alexandre Gramfort @@ -49,7 +49,7 @@ class IsolationForest(OutlierMixin, BaseBagging): self, *, n_estimators: Int = 100, - max_samples: float | Literal["auto", "auto"] | int = "auto", + max_samples: float | Literal["auto"] | int = "auto", contamination: float | str = "auto", max_features: float | int = 1.0, bootstrap: bool = False, diff --git a/stubs/sklearn/ensemble/_stacking.pyi b/stubs/sklearn/ensemble/_stacking.pyi index 49e3af3a..b007e3c2 100644 --- a/stubs/sklearn/ensemble/_stacking.pyi +++ b/stubs/sklearn/ensemble/_stacking.pyi @@ -30,9 +30,9 @@ from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted, column_or_1d as column_or_1d from ._base import _BaseHeterogeneousEnsemble -_BaseStacking_Self = TypeVar("_BaseStacking_Self", bound="_BaseStacking") -StackingRegressor_Self = TypeVar("StackingRegressor_Self", bound="StackingRegressor") -StackingClassifier_Self = TypeVar("StackingClassifier_Self", bound="StackingClassifier") +_BaseStacking_Self = TypeVar("_BaseStacking_Self", bound=_BaseStacking) +StackingRegressor_Self = TypeVar("StackingRegressor_Self", bound=StackingRegressor) +StackingClassifier_Self = TypeVar("StackingClassifier_Self", bound=StackingClassifier) import numpy as np import scipy.sparse as sparse @@ -79,7 +79,7 @@ class StackingClassifier(ClassifierMixin, _BaseStacking): final_estimator: None | BaseEstimator | LogisticRegression = None, *, cv: int | BaseCrossValidator | Iterable | None | str | BaseShuffleSplit = None, - stack_method: Literal["auto", "predict_proba", "decision_function", "predict", "auto"] = "auto", + stack_method: Literal["auto", "predict_proba", "decision_function", "predict"] = "auto", n_jobs: None | Int = None, passthrough: bool = False, verbose: Int = 0, diff --git a/stubs/sklearn/ensemble/_voting.pyi b/stubs/sklearn/ensemble/_voting.pyi index de5ceb00..903dc22d 100644 --- a/stubs/sklearn/ensemble/_voting.pyi +++ b/stubs/sklearn/ensemble/_voting.pyi @@ -16,8 +16,8 @@ from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted, column_or_1d as column_or_1d from ._base import _BaseHeterogeneousEnsemble -VotingClassifier_Self = TypeVar("VotingClassifier_Self", bound="VotingClassifier") -VotingRegressor_Self = TypeVar("VotingRegressor_Self", bound="VotingRegressor") +VotingClassifier_Self = TypeVar("VotingClassifier_Self", bound=VotingClassifier) +VotingRegressor_Self = TypeVar("VotingRegressor_Self", bound=VotingRegressor) import numpy as np @@ -43,7 +43,7 @@ class VotingClassifier(ClassifierMixin, _BaseVoting): self, estimators: list[tuple[str, BaseEstimator]], *, - voting: Literal["hard", "soft", "hard"] = "hard", + voting: Literal["hard", "soft"] = "hard", weights: None | ArrayLike = None, n_jobs: None | Int = None, flatten_transform: bool = True, diff --git a/stubs/sklearn/ensemble/_weight_boosting.pyi b/stubs/sklearn/ensemble/_weight_boosting.pyi index f6c64b29..873f60c7 100644 --- a/stubs/sklearn/ensemble/_weight_boosting.pyi +++ b/stubs/sklearn/ensemble/_weight_boosting.pyi @@ -16,7 +16,7 @@ from ..utils.extmath import softmax as softmax, stable_cumsum as stable_cumsum from ..utils.validation import check_is_fitted as check_is_fitted, has_fit_parameter as has_fit_parameter from ._base import BaseEnsemble -BaseWeightBoosting_Self = TypeVar("BaseWeightBoosting_Self", bound="BaseWeightBoosting") +BaseWeightBoosting_Self = TypeVar("BaseWeightBoosting_Self", bound=BaseWeightBoosting) import warnings @@ -76,7 +76,7 @@ class AdaBoostClassifier(ClassifierMixin, BaseWeightBoosting): *, n_estimators: Int = 50, learning_rate: Float = 1.0, - algorithm: Literal["SAMME", "SAMME.R", "SAMME.R"] = "SAMME.R", + algorithm: Literal["SAMME", "SAMME.R"] = "SAMME.R", random_state: RandomState | None | Int = None, base_estimator: Any = "deprecated", ) -> None: ... @@ -106,7 +106,7 @@ class AdaBoostRegressor(RegressorMixin, BaseWeightBoosting): *, n_estimators: Int = 50, learning_rate: Float = 1.0, - loss: Literal["linear", "square", "exponential", "linear"] = "linear", + loss: Literal["linear", "square", "exponential"] = "linear", random_state: RandomState | None | Int = None, base_estimator: Any = "deprecated", ) -> None: ... diff --git a/stubs/sklearn/externals/_arff.pyi b/stubs/sklearn/externals/_arff.pyi index 879278f8..4cafb89a 100644 --- a/stubs/sklearn/externals/_arff.pyi +++ b/stubs/sklearn/externals/_arff.pyi @@ -69,7 +69,6 @@ class ArffException(Exception): message: ClassVar[Optional[str]] = ... def __init__(self) -> None: ... - def __str__(self) -> str: ... class BadRelationFormat(ArffException): message: ClassVar[Literal["Bad @RELATION format, at line %d."]] = ... @@ -105,7 +104,6 @@ class BadLayout(ArffException): class BadObject(ArffException): def __init__(self, msg: str = "Invalid object.") -> None: ... - def __str__(self) -> str: ... def encode_string(s): ... diff --git a/stubs/sklearn/externals/_packaging/_structures.pyi b/stubs/sklearn/externals/_packaging/_structures.pyi index fd324f9c..727e8cc1 100644 --- a/stubs/sklearn/externals/_packaging/_structures.pyi +++ b/stubs/sklearn/externals/_packaging/_structures.pyi @@ -23,7 +23,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. class InfinityType: - def __repr__(self) -> str: ... def __hash__(self) -> int: ... def __lt__(self, other: object) -> bool: ... def __le__(self, other: object) -> bool: ... @@ -31,12 +30,11 @@ class InfinityType: def __ne__(self, other: object) -> bool: ... def __gt__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... - def __neg__(self: object) -> "NegativeInfinityType": ... + def __neg__(self: object) -> NegativeInfinityType: ... Infinity = ... class NegativeInfinityType: - def __repr__(self) -> str: ... def __hash__(self) -> int: ... def __lt__(self, other: object) -> bool: ... def __le__(self, other: object) -> bool: ... diff --git a/stubs/sklearn/externals/_packaging/version.pyi b/stubs/sklearn/externals/_packaging/version.pyi index 5d5e2fff..8b6fcd80 100644 --- a/stubs/sklearn/externals/_packaging/version.pyi +++ b/stubs/sklearn/externals/_packaging/version.pyi @@ -1,3 +1,4 @@ +import typing_extensions from typing import Callable, ClassVar, Optional, Tuple, Union from ._structures import ( @@ -33,10 +34,10 @@ from ._structures import ( __all__ = ["parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"] -InfiniteTypes = Union[InfinityType, NegativeInfinityType] -PrePostDevType = Union[InfiniteTypes, Tuple[str, int]] -SubLocalType = Union[InfiniteTypes, int, str] -LocalType = Union[ +InfiniteTypes: typing_extensions.TypeAlias = Union[InfinityType, NegativeInfinityType] +PrePostDevType: typing_extensions.TypeAlias = Union[InfiniteTypes, Tuple[str, int]] +SubLocalType: typing_extensions.TypeAlias = Union[InfiniteTypes, int, str] +LocalType: typing_extensions.TypeAlias = Union[ NegativeInfinityType, Tuple[ Union[ @@ -47,13 +48,13 @@ LocalType = Union[ ..., ], ] -CmpKey = Tuple[int, Tuple[int, ...], PrePostDevType, PrePostDevType, PrePostDevType, LocalType] -LegacyCmpKey = Tuple[int, Tuple[str, ...]] -VersionComparisonMethod = Callable[[Union[CmpKey, LegacyCmpKey], Union[CmpKey, LegacyCmpKey]], bool] +CmpKey: typing_extensions.TypeAlias = Tuple[int, Tuple[int, ...], PrePostDevType, PrePostDevType, PrePostDevType, LocalType] +LegacyCmpKey: typing_extensions.TypeAlias = Tuple[int, Tuple[str, ...]] +VersionComparisonMethod: typing_extensions.TypeAlias = Callable[[Union[CmpKey, LegacyCmpKey], Union[CmpKey, LegacyCmpKey]], bool] _Version = ... -def parse(version: str) -> Union["LegacyVersion", "Version"]: ... +def parse(version: str) -> Union[LegacyVersion, Version]: ... class InvalidVersion(ValueError): ... @@ -65,17 +66,15 @@ class _BaseVersion: # Please keep the duplicated `isinstance` check # in the six comparisons hereunder # unless you find a way to avoid adding overhead function calls. - def __lt__(self, other: "_BaseVersion") -> bool: ... - def __le__(self, other: "_BaseVersion") -> bool: ... + def __lt__(self, other: _BaseVersion) -> bool: ... + def __le__(self, other: _BaseVersion) -> bool: ... def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: "_BaseVersion") -> bool: ... - def __gt__(self, other: "_BaseVersion") -> bool: ... + def __ge__(self, other: _BaseVersion) -> bool: ... + def __gt__(self, other: _BaseVersion) -> bool: ... def __ne__(self, other: object) -> bool: ... class LegacyVersion(_BaseVersion): def __init__(self, version: str) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def public(self) -> str: ... def base_version(self) -> str: ... def epoch(self) -> int: ... @@ -100,8 +99,6 @@ class Version(_BaseVersion): _regex = ... def __init__(self, version: str) -> None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def epoch(self) -> int: ... def release(self) -> Tuple[int, ...]: ... def pre(self) -> Optional[Tuple[str, int]]: ... diff --git a/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi b/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi index 05d9de3c..e48fcede 100644 --- a/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi +++ b/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi @@ -11,7 +11,7 @@ from .._typing import ArrayLike, MatrixLike from ..base import BaseEstimator, TransformerMixin from ..utils import check_array as check_array -DictVectorizer_Self = TypeVar("DictVectorizer_Self", bound="DictVectorizer") +DictVectorizer_Self = TypeVar("DictVectorizer_Self", bound=DictVectorizer) # Authors: Lars Buitinck # Dan Blanchard diff --git a/stubs/sklearn/feature_extraction/_hash.pyi b/stubs/sklearn/feature_extraction/_hash.pyi index ae6e1570..4294bf78 100644 --- a/stubs/sklearn/feature_extraction/_hash.pyi +++ b/stubs/sklearn/feature_extraction/_hash.pyi @@ -10,7 +10,7 @@ from ..base import BaseEstimator, TransformerMixin from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ._hashing_fast import transform as _hashing_transform -FeatureHasher_Self = TypeVar("FeatureHasher_Self", bound="FeatureHasher") +FeatureHasher_Self = TypeVar("FeatureHasher_Self", bound=FeatureHasher) # Author: Lars Buitinck # License: BSD 3 clause diff --git a/stubs/sklearn/feature_extraction/image.pyi b/stubs/sklearn/feature_extraction/image.pyi index 7848ec3e..edd3b275 100644 --- a/stubs/sklearn/feature_extraction/image.pyi +++ b/stubs/sklearn/feature_extraction/image.pyi @@ -14,7 +14,7 @@ from ..base import BaseEstimator from ..utils import check_array as check_array, check_random_state as check_random_state from ..utils._param_validation import Interval as Interval -PatchExtractor_Self = TypeVar("PatchExtractor_Self", bound="PatchExtractor") +PatchExtractor_Self = TypeVar("PatchExtractor_Self", bound=PatchExtractor) import numpy as np diff --git a/stubs/sklearn/feature_extraction/text.pyi b/stubs/sklearn/feature_extraction/text.pyi index e24dca56..591600a0 100644 --- a/stubs/sklearn/feature_extraction/text.pyi +++ b/stubs/sklearn/feature_extraction/text.pyi @@ -17,10 +17,10 @@ from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_array as chec from ._hash import FeatureHasher as FeatureHasher from ._stop_words import ENGLISH_STOP_WORDS -TfidfVectorizer_Self = TypeVar("TfidfVectorizer_Self", bound="TfidfVectorizer") -HashingVectorizer_Self = TypeVar("HashingVectorizer_Self", bound="HashingVectorizer") -CountVectorizer_Self = TypeVar("CountVectorizer_Self", bound="CountVectorizer") -TfidfTransformer_Self = TypeVar("TfidfTransformer_Self", bound="TfidfTransformer") +TfidfVectorizer_Self = TypeVar("TfidfVectorizer_Self", bound=TfidfVectorizer) +HashingVectorizer_Self = TypeVar("HashingVectorizer_Self", bound=HashingVectorizer) +CountVectorizer_Self = TypeVar("CountVectorizer_Self", bound=CountVectorizer) +TfidfTransformer_Self = TypeVar("TfidfTransformer_Self", bound=TfidfTransformer) # Authors: Olivier Grisel # Mathieu Blondel @@ -69,9 +69,9 @@ class HashingVectorizer(TransformerMixin, _VectorizerMixin, BaseEstimator, auto_ def __init__( self, *, - input: Literal["filename", "file", "content", "content"] = "content", + input: Literal["filename", "file", "content"] = "content", encoding: str = "utf-8", - decode_error: Literal["strict", "ignore", "replace", "strict"] = "strict", + decode_error: Literal["strict", "ignore", "replace"] = "strict", strip_accents: None | Literal["ascii", "unicode"] | Callable = None, lowercase: bool = True, preprocessor: None | Callable = None, @@ -79,10 +79,10 @@ class HashingVectorizer(TransformerMixin, _VectorizerMixin, BaseEstimator, auto_ stop_words: None | str | ArrayLike = None, token_pattern: None | str = r"(?u)\b\w\w+\b", ngram_range: tuple[float, float] = ..., - analyzer: Literal["word", "char", "char_wb", "word"] | Callable = "word", + analyzer: Literal["word", "char", "char_wb"] | Callable = "word", n_features: Int = ..., binary: bool = False, - norm: Literal["l1", "l2", "l2"] = "l2", + norm: Literal["l1", "l2"] = "l2", alternate_sign: bool = True, dtype=..., ) -> None: ... @@ -101,9 +101,9 @@ class CountVectorizer(_VectorizerMixin, BaseEstimator): def __init__( self, *, - input: Literal["filename", "file", "content", "content"] = "content", + input: Literal["filename", "file", "content"] = "content", encoding: str = "utf-8", - decode_error: Literal["strict", "ignore", "replace", "strict"] = "strict", + decode_error: Literal["strict", "ignore", "replace"] = "strict", strip_accents: None | Literal["ascii", "unicode"] | Callable = None, lowercase: bool = True, preprocessor: None | Callable = None, @@ -111,7 +111,7 @@ class CountVectorizer(_VectorizerMixin, BaseEstimator): stop_words: None | str | ArrayLike = None, token_pattern: None | str = r"(?u)\b\w\w+\b", ngram_range: tuple[float, float] = ..., - analyzer: Literal["word", "char", "char_wb", "word"] | Callable = "word", + analyzer: Literal["word", "char", "char_wb"] | Callable = "word", max_df: float | int = 1.0, min_df: float | int = 1, max_features: None | Int = None, @@ -138,7 +138,7 @@ class TfidfTransformer(OneToOneFeatureMixin, TransformerMixin, BaseEstimator, au def __init__( self, *, - norm: None | Literal["l1", "l2", "l2"] = "l2", + norm: None | Literal["l1", "l2"] = "l2", use_idf: bool = True, smooth_idf: bool = True, sublinear_tf: bool = False, @@ -160,14 +160,14 @@ class TfidfVectorizer(CountVectorizer): def __init__( self, *, - input: Literal["filename", "file", "content", "content"] = "content", + input: Literal["filename", "file", "content"] = "content", encoding: str = "utf-8", - decode_error: Literal["strict", "ignore", "replace", "strict"] = "strict", + decode_error: Literal["strict", "ignore", "replace"] = "strict", strip_accents: None | Literal["ascii", "unicode"] | Callable = None, lowercase: bool = True, preprocessor: None | Callable = None, tokenizer: None | Callable = None, - analyzer: Literal["word", "char", "char_wb", "word"] | Callable = "word", + analyzer: Literal["word", "char", "char_wb"] | Callable = "word", stop_words: None | str | ArrayLike = None, token_pattern: str = r"(?u)\b\w\w+\b", ngram_range: tuple[float, float] = ..., @@ -177,7 +177,7 @@ class TfidfVectorizer(CountVectorizer): vocabulary: Iterable | None | Mapping = None, binary: bool = False, dtype=..., - norm: None | Literal["l1", "l2", "l2"] = "l2", + norm: None | Literal["l1", "l2"] = "l2", use_idf: bool = True, smooth_idf: bool = True, sublinear_tf: bool = False, diff --git a/stubs/sklearn/feature_selection/_from_model.pyi b/stubs/sklearn/feature_selection/_from_model.pyi index 6bc241a4..6aa241a5 100644 --- a/stubs/sklearn/feature_selection/_from_model.pyi +++ b/stubs/sklearn/feature_selection/_from_model.pyi @@ -12,7 +12,7 @@ from ..utils.metaestimators import available_if as available_if from ..utils.validation import check_is_fitted as check_is_fitted, check_scalar as check_scalar from ._base import SelectorMixin -SelectFromModel_Self = TypeVar("SelectFromModel_Self", bound="SelectFromModel") +SelectFromModel_Self = TypeVar("SelectFromModel_Self", bound=SelectFromModel) # Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena # License: BSD 3 clause diff --git a/stubs/sklearn/feature_selection/_mutual_info.pyi b/stubs/sklearn/feature_selection/_mutual_info.pyi index b4681198..e198d293 100644 --- a/stubs/sklearn/feature_selection/_mutual_info.pyi +++ b/stubs/sklearn/feature_selection/_mutual_info.pyi @@ -21,7 +21,7 @@ def mutual_info_regression( X: MatrixLike, y: ArrayLike, *, - discrete_features: Literal["auto", "auto"] | ArrayLike | bool = "auto", + discrete_features: Literal["auto"] | ArrayLike | bool = "auto", n_neighbors: Int = 3, copy: bool = True, random_state: RandomState | None | Int = None, @@ -30,7 +30,7 @@ def mutual_info_classif( X: MatrixLike, y: ArrayLike, *, - discrete_features: Literal["auto", "auto"] | ArrayLike | bool = "auto", + discrete_features: Literal["auto"] | ArrayLike | bool = "auto", n_neighbors: Int = 3, copy: bool = True, random_state: RandomState | None | Int = None, diff --git a/stubs/sklearn/feature_selection/_rfe.pyi b/stubs/sklearn/feature_selection/_rfe.pyi index 2ae39e6c..ece96882 100644 --- a/stubs/sklearn/feature_selection/_rfe.pyi +++ b/stubs/sklearn/feature_selection/_rfe.pyi @@ -16,8 +16,8 @@ from ..utils.parallel import Parallel as Parallel, delayed as delayed from ..utils.validation import check_is_fitted as check_is_fitted from ._base import SelectorMixin -RFECV_Self = TypeVar("RFECV_Self", bound="RFECV") -RFE_Self = TypeVar("RFE_Self", bound="RFE") +RFECV_Self = TypeVar("RFECV_Self", bound=RFECV) +RFE_Self = TypeVar("RFE_Self", bound=RFE) # Authors: Alexandre Gramfort # Vincent Michel diff --git a/stubs/sklearn/feature_selection/_sequential.pyi b/stubs/sklearn/feature_selection/_sequential.pyi index 05a022f8..09273ff9 100644 --- a/stubs/sklearn/feature_selection/_sequential.pyi +++ b/stubs/sklearn/feature_selection/_sequential.pyi @@ -12,7 +12,7 @@ from ..utils._param_validation import HasMethods as HasMethods, Hidden as Hidden from ..utils.validation import check_is_fitted as check_is_fitted from ._base import SelectorMixin -SequentialFeatureSelector_Self = TypeVar("SequentialFeatureSelector_Self", bound="SequentialFeatureSelector") +SequentialFeatureSelector_Self = TypeVar("SequentialFeatureSelector_Self", bound=SequentialFeatureSelector) import warnings @@ -32,7 +32,7 @@ class SequentialFeatureSelector(SelectorMixin, MetaEstimatorMixin, BaseEstimator *, n_features_to_select: float | int | Literal["auto", "warn"] = "warn", tol: None | Float = None, - direction: Literal["forward", "backward", "forward"] = "forward", + direction: Literal["forward", "backward"] = "forward", scoring: None | str | Callable = None, cv: Iterable | int | BaseShuffleSplit | BaseCrossValidator = 5, n_jobs: None | Int = None, diff --git a/stubs/sklearn/feature_selection/_univariate_selection.pyi b/stubs/sklearn/feature_selection/_univariate_selection.pyi index 45e7a30e..4d00a7e0 100644 --- a/stubs/sklearn/feature_selection/_univariate_selection.pyi +++ b/stubs/sklearn/feature_selection/_univariate_selection.pyi @@ -21,7 +21,7 @@ from ..utils.extmath import row_norms as row_norms, safe_sparse_dot as safe_spar from ..utils.validation import check_is_fitted as check_is_fitted from ._base import SelectorMixin -_BaseFilter_Self = TypeVar("_BaseFilter_Self", bound="_BaseFilter") +_BaseFilter_Self = TypeVar("_BaseFilter_Self", bound=_BaseFilter) # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly @@ -127,6 +127,6 @@ class GenericUnivariateSelect(_BaseFilter): self, score_func: Callable = ..., *, - mode: Literal["percentile", "k_best", "fpr", "fdr", "fwe", "percentile"] = "percentile", + mode: Literal["percentile", "k_best", "fpr", "fdr", "fwe"] = "percentile", param: float | str | int = 1e-5, ) -> None: ... diff --git a/stubs/sklearn/feature_selection/_variance_threshold.pyi b/stubs/sklearn/feature_selection/_variance_threshold.pyi index d990c96e..001ef127 100644 --- a/stubs/sklearn/feature_selection/_variance_threshold.pyi +++ b/stubs/sklearn/feature_selection/_variance_threshold.pyi @@ -10,7 +10,7 @@ from ..utils.sparsefuncs import mean_variance_axis as mean_variance_axis, min_ma from ..utils.validation import check_is_fitted as check_is_fitted from ._base import SelectorMixin -VarianceThreshold_Self = TypeVar("VarianceThreshold_Self", bound="VarianceThreshold") +VarianceThreshold_Self = TypeVar("VarianceThreshold_Self", bound=VarianceThreshold) # Author: Lars Buitinck # License: 3-clause BSD diff --git a/stubs/sklearn/gaussian_process/_gpc.pyi b/stubs/sklearn/gaussian_process/_gpc.pyi index 2d36262e..1b05382d 100644 --- a/stubs/sklearn/gaussian_process/_gpc.pyi +++ b/stubs/sklearn/gaussian_process/_gpc.pyi @@ -18,9 +18,9 @@ from .kernels import RBF as RBF, CompoundKernel as CompoundKernel, ConstantKerne _BinaryGaussianProcessClassifierLaplace_Self = TypeVar( "_BinaryGaussianProcessClassifierLaplace_Self", - bound="_BinaryGaussianProcessClassifierLaplace", + bound=_BinaryGaussianProcessClassifierLaplace, ) -GaussianProcessClassifier_Self = TypeVar("GaussianProcessClassifier_Self", bound="GaussianProcessClassifier") +GaussianProcessClassifier_Self = TypeVar("GaussianProcessClassifier_Self", bound=GaussianProcessClassifier) import numpy as np import scipy.optimize @@ -48,7 +48,7 @@ class _BinaryGaussianProcessClassifierLaplace(BaseEstimator): self, kernel: Product | None | Kernel = None, *, - optimizer: Literal["fmin_l_bfgs_b", "fmin_l_bfgs_b"] | Callable = "fmin_l_bfgs_b", + optimizer: Literal["fmin_l_bfgs_b"] | Callable = "fmin_l_bfgs_b", n_restarts_optimizer: Int = 0, max_iter_predict: Int = 100, warm_start: bool = False, @@ -83,13 +83,13 @@ class GaussianProcessClassifier(ClassifierMixin, BaseEstimator): self, kernel: Product | None | Kernel = None, *, - optimizer: Literal["fmin_l_bfgs_b", "fmin_l_bfgs_b"] | None | Callable = "fmin_l_bfgs_b", + optimizer: Literal["fmin_l_bfgs_b"] | None | Callable = "fmin_l_bfgs_b", n_restarts_optimizer: Int = 0, max_iter_predict: Int = 100, warm_start: bool = False, copy_X_train: bool = True, random_state: RandomState | None | Int = None, - multi_class: Literal["one_vs_rest", "one_vs_one", "one_vs_rest"] = "one_vs_rest", + multi_class: Literal["one_vs_rest", "one_vs_one"] = "one_vs_rest", n_jobs: None | Int = None, ) -> None: ... def fit(self: GaussianProcessClassifier_Self, X: MatrixLike | ArrayLike, y: ArrayLike) -> GaussianProcessClassifier_Self: ... diff --git a/stubs/sklearn/gaussian_process/_gpr.pyi b/stubs/sklearn/gaussian_process/_gpr.pyi index c1e2ef3f..c76d9947 100644 --- a/stubs/sklearn/gaussian_process/_gpr.pyi +++ b/stubs/sklearn/gaussian_process/_gpr.pyi @@ -12,7 +12,7 @@ from ..utils import check_random_state as check_random_state from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from .kernels import RBF as RBF, ConstantKernel as C, Kernel -GaussianProcessRegressor_Self = TypeVar("GaussianProcessRegressor_Self", bound="GaussianProcessRegressor") +GaussianProcessRegressor_Self = TypeVar("GaussianProcessRegressor_Self", bound=GaussianProcessRegressor) # Authors: Jan Hendrik Metzen # Modified by: Pete Green @@ -42,7 +42,7 @@ class GaussianProcessRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator): kernel: None | Kernel = None, *, alpha: float | ArrayLike = 1e-10, - optimizer: Literal["fmin_l_bfgs_b", "fmin_l_bfgs_b"] | None | Callable = "fmin_l_bfgs_b", + optimizer: Literal["fmin_l_bfgs_b"] | None | Callable = "fmin_l_bfgs_b", n_restarts_optimizer: Int = 0, normalize_y: bool = False, copy_X_train: bool = True, diff --git a/stubs/sklearn/gaussian_process/kernels.pyi b/stubs/sklearn/gaussian_process/kernels.pyi index c0656e7a..74aafea8 100644 --- a/stubs/sklearn/gaussian_process/kernels.pyi +++ b/stubs/sklearn/gaussian_process/kernels.pyi @@ -12,8 +12,8 @@ from ..base import clone as clone from ..exceptions import ConvergenceWarning as ConvergenceWarning from ..metrics.pairwise import pairwise_kernels as pairwise_kernels -Kernel_Self = TypeVar("Kernel_Self", bound="Kernel") -Hyperparameter_Self = TypeVar("Hyperparameter_Self", bound="Hyperparameter") +Kernel_Self = TypeVar("Kernel_Self", bound=Kernel) +Hyperparameter_Self = TypeVar("Hyperparameter_Self", bound=Hyperparameter) import math import warnings @@ -68,7 +68,6 @@ class Kernel(metaclass=ABCMeta): def __rmul__(self, b: float | int) -> Product: ... def __pow__(self, b: int) -> Exponentiation: ... def __eq__(self, b: str) -> bool: ... - def __repr__(self) -> str: ... @abstractmethod def __call__(self, X, Y=None, eval_gradient: bool = False): ... @abstractmethod @@ -128,7 +127,6 @@ class Sum(KernelOperator): eval_gradient: bool = False, ) -> ndarray | tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike | ArrayLike) -> ndarray: ... - def __repr__(self) -> str: ... class Product(KernelOperator): def __call__( @@ -138,7 +136,6 @@ class Product(KernelOperator): eval_gradient: bool = False, ) -> ndarray | tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike | ArrayLike) -> ndarray: ... - def __repr__(self) -> str: ... class Exponentiation(Kernel): def __init__(self, kernel: DotProduct | Kernel, exponent: Float) -> None: ... @@ -158,7 +155,6 @@ class Exponentiation(Kernel): eval_gradient: bool = False, ) -> ndarray | tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike | ArrayLike) -> ndarray: ... - def __repr__(self) -> str: ... def is_stationary(self): ... def requires_vector_input(self) -> bool: ... @@ -176,7 +172,6 @@ class ConstantKernel(StationaryKernelMixin, GenericKernelMixin, Kernel): eval_gradient: bool = False, ) -> ndarray | tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike | ArrayLike) -> ndarray: ... - def __repr__(self) -> str: ... class WhiteKernel(StationaryKernelMixin, GenericKernelMixin, Kernel): def __init__( @@ -192,7 +187,6 @@ class WhiteKernel(StationaryKernelMixin, GenericKernelMixin, Kernel): eval_gradient: bool = False, ) -> ndarray | tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike | ArrayLike) -> ndarray: ... - def __repr__(self) -> str: ... class RBF(StationaryKernelMixin, NormalizedKernelMixin, Kernel): def __init__( @@ -205,7 +199,6 @@ class RBF(StationaryKernelMixin, NormalizedKernelMixin, Kernel): def __call__( self, X: MatrixLike, Y: None | MatrixLike = None, eval_gradient: bool = False ) -> ndarray | tuple[ndarray, ndarray]: ... - def __repr__(self) -> str: ... class Matern(RBF): def __init__( @@ -217,7 +210,6 @@ class Matern(RBF): def __call__( self, X: MatrixLike, Y: None | MatrixLike = None, eval_gradient: bool = False ) -> ndarray | tuple[ndarray, ndarray]: ... - def __repr__(self) -> str: ... class RationalQuadratic(StationaryKernelMixin, NormalizedKernelMixin, Kernel): def __init__( @@ -232,7 +224,6 @@ class RationalQuadratic(StationaryKernelMixin, NormalizedKernelMixin, Kernel): def __call__( self, X: MatrixLike, Y: None | MatrixLike = None, eval_gradient: bool = False ) -> ndarray | tuple[ndarray, ndarray]: ... - def __repr__(self) -> str: ... class ExpSineSquared(StationaryKernelMixin, NormalizedKernelMixin, Kernel): def __init__( @@ -247,7 +238,6 @@ class ExpSineSquared(StationaryKernelMixin, NormalizedKernelMixin, Kernel): def __call__( self, X: MatrixLike, Y: None | MatrixLike = None, eval_gradient: bool = False ) -> ndarray | tuple[ndarray, ndarray]: ... - def __repr__(self) -> str: ... class DotProduct(Kernel): def __init__(self, sigma_0: Float = 1.0, sigma_0_bounds: str | tuple[float, float] = ...) -> None: ... @@ -257,7 +247,6 @@ class DotProduct(Kernel): ) -> ndarray | tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike) -> ndarray: ... def is_stationary(self): ... - def __repr__(self) -> str: ... class PairwiseKernel(Kernel): def __init__( @@ -265,18 +254,7 @@ class PairwiseKernel(Kernel): gamma: Float = 1.0, gamma_bounds: str | tuple[float, float] = ..., metric: ( - Literal[ - "linear", - "additive_chi2", - "chi2", - "poly", - "polynomial", - "rbf", - "laplacian", - "sigmoid", - "cosine", - "linear", - ] + Literal["linear", "additive_chi2", "chi2", "poly", "polynomial", "rbf", "laplacian", "sigmoid", "cosine"] | Callable ) = "linear", pairwise_kernels_kwargs: None | dict = None, @@ -285,4 +263,3 @@ class PairwiseKernel(Kernel): def __call__(self, X: MatrixLike, Y: None | MatrixLike = None, eval_gradient: bool = False) -> tuple[ndarray, ndarray]: ... def diag(self, X: MatrixLike) -> ndarray: ... def is_stationary(self): ... - def __repr__(self) -> str: ... diff --git a/stubs/sklearn/impute/_base.pyi b/stubs/sklearn/impute/_base.pyi index 53a3c935..58e30bde 100644 --- a/stubs/sklearn/impute/_base.pyi +++ b/stubs/sklearn/impute/_base.pyi @@ -11,8 +11,8 @@ from ..utils import is_scalar_nan as is_scalar_nan from ..utils._param_validation import Hidden as Hidden, StrOptions as StrOptions from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted -SimpleImputer_Self = TypeVar("SimpleImputer_Self", bound="SimpleImputer") -MissingIndicator_Self = TypeVar("MissingIndicator_Self", bound="MissingIndicator") +SimpleImputer_Self = TypeVar("SimpleImputer_Self", bound=SimpleImputer) +MissingIndicator_Self = TypeVar("MissingIndicator_Self", bound=MissingIndicator) # Authors: Nicolas Tresegnie # Sergey Feldman @@ -70,8 +70,8 @@ class MissingIndicator(TransformerMixin, BaseEstimator): self, *, missing_values: float | None | str | int = ..., - features: Literal["missing-only", "all", "missing-only"] = "missing-only", - sparse: Literal["auto", "auto"] | bool = "auto", + features: Literal["missing-only", "all"] = "missing-only", + sparse: Literal["auto"] | bool = "auto", error_on_new: bool = True, ) -> None: ... def fit(self: MissingIndicator_Self, X: MatrixLike | ArrayLike, y: Any = None) -> MissingIndicator_Self: ... diff --git a/stubs/sklearn/impute/_iterative.pyi b/stubs/sklearn/impute/_iterative.pyi index 905012a2..a638e623 100644 --- a/stubs/sklearn/impute/_iterative.pyi +++ b/stubs/sklearn/impute/_iterative.pyi @@ -17,7 +17,7 @@ from ..utils._param_validation import HasMethods as HasMethods, Interval as Inte from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted from ._base import MissingIndicator, SimpleImputer, _BaseImputer -IterativeImputer_Self = TypeVar("IterativeImputer_Self", bound="IterativeImputer") +IterativeImputer_Self = TypeVar("IterativeImputer_Self", bound=IterativeImputer) import warnings @@ -46,8 +46,8 @@ class IterativeImputer(_BaseImputer): max_iter: Int = 10, tol: Float = 1e-3, n_nearest_features: None | Int = None, - initial_strategy: Literal["mean", "median", "most_frequent", "constant", "mean"] = "mean", - imputation_order: Literal["ascending", "descending", "roman", "arabic", "random", "ascending"] = "ascending", + initial_strategy: Literal["mean", "median", "most_frequent", "constant"] = "mean", + imputation_order: Literal["ascending", "descending", "roman", "arabic", "random"] = "ascending", skip_complete: bool = False, min_value: float | ArrayLike = ..., max_value: float | ArrayLike = ..., diff --git a/stubs/sklearn/impute/_knn.pyi b/stubs/sklearn/impute/_knn.pyi index 2ec52725..9a40dd78 100644 --- a/stubs/sklearn/impute/_knn.pyi +++ b/stubs/sklearn/impute/_knn.pyi @@ -10,7 +10,7 @@ from ..utils._param_validation import Hidden as Hidden, Interval as Interval, St from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted from ._base import MissingIndicator, _BaseImputer -KNNImputer_Self = TypeVar("KNNImputer_Self", bound="KNNImputer") +KNNImputer_Self = TypeVar("KNNImputer_Self", bound=KNNImputer) # Authors: Ashim Bhattarai # Thomas J Fan @@ -30,8 +30,8 @@ class KNNImputer(_BaseImputer): *, missing_values: float | None | str | int = ..., n_neighbors: Int = 5, - weights: Literal["uniform", "distance", "uniform"] | Callable = "uniform", - metric: Callable | Literal["nan_euclidean", "nan_euclidean"] = "nan_euclidean", + weights: Literal["uniform", "distance"] | Callable = "uniform", + metric: Callable | Literal["nan_euclidean"] = "nan_euclidean", copy: bool = True, add_indicator: bool = False, keep_empty_features: bool = False, diff --git a/stubs/sklearn/inspection/_partial_dependence.pyi b/stubs/sklearn/inspection/_partial_dependence.pyi index 7eb10e18..ca1d0cc1 100644 --- a/stubs/sklearn/inspection/_partial_dependence.pyi +++ b/stubs/sklearn/inspection/_partial_dependence.pyi @@ -28,9 +28,9 @@ def partial_dependence( *, categorical_features: None | MatrixLike | ArrayLike = None, feature_names: None | ArrayLike = None, - response_method: Literal["auto", "predict_proba", "decision_function", "auto"] = "auto", + response_method: Literal["auto", "predict_proba", "decision_function"] = "auto", percentiles: tuple[float, ...] = ..., grid_resolution: Int = 100, - method: Literal["auto", "recursion", "brute", "auto"] = "auto", - kind: Literal["average", "individual", "both", "average"] = "average", + method: Literal["auto", "recursion", "brute"] = "auto", + kind: Literal["average", "individual", "both"] = "average", ) -> Bunch: ... diff --git a/stubs/sklearn/inspection/_plot/decision_boundary.pyi b/stubs/sklearn/inspection/_plot/decision_boundary.pyi index d7e0049d..20d96832 100644 --- a/stubs/sklearn/inspection/_plot/decision_boundary.pyi +++ b/stubs/sklearn/inspection/_plot/decision_boundary.pyi @@ -29,7 +29,7 @@ class DecisionBoundaryDisplay: ) -> None: ... def plot( self, - plot_method: Literal["contourf", "contourf", "contour", "pcolormesh"] = "contourf", + plot_method: Literal["contourf", "contour", "pcolormesh"] = "contourf", ax: None | Axes = None, xlabel: None | str = None, ylabel: None | str = None, @@ -43,8 +43,8 @@ class DecisionBoundaryDisplay: *, grid_resolution: Int = 100, eps: Float = 1.0, - plot_method: Literal["contourf", "contour", "pcolormesh", "contourf"] = "contourf", - response_method: Literal["auto", "predict_proba", "decision_function", "predict", "auto"] = "auto", + plot_method: Literal["contourf", "contour", "pcolormesh"] = "contourf", + response_method: Literal["auto", "predict_proba", "decision_function", "predict"] = "auto", xlabel: None | str = None, ylabel: None | str = None, ax: None | Axes = None, diff --git a/stubs/sklearn/inspection/_plot/partial_dependence.pyi b/stubs/sklearn/inspection/_plot/partial_dependence.pyi index 7f65a4d0..7a6e3817 100644 --- a/stubs/sklearn/inspection/_plot/partial_dependence.pyi +++ b/stubs/sklearn/inspection/_plot/partial_dependence.pyi @@ -45,7 +45,7 @@ class PartialDependenceDisplay: deciles: dict, pdp_lim: None | Mapping | str = "deprecated", kind: ( - Sequence[Literal["average", "individual", "both"]] | Literal["average", "individual", "both", "average"] + Sequence[Literal["average", "individual", "both"]] | Literal["average", "individual", "both"] ) = "average", subsample: float | None | int = 1000, random_state: RandomState | None | Int = None, @@ -61,7 +61,7 @@ class PartialDependenceDisplay: categorical_features: None | MatrixLike | ArrayLike = None, feature_names: None | ArrayLike = None, target: None | Int = None, - response_method: Literal["auto", "predict_proba", "decision_function", "auto"] = "auto", + response_method: Literal["auto", "predict_proba", "decision_function"] = "auto", n_cols: Int = 3, grid_resolution: Int = 100, percentiles: tuple[float, ...] = ..., @@ -73,7 +73,7 @@ class PartialDependenceDisplay: pd_line_kw: None | dict = None, contour_kw: None | dict = None, ax: None | Sequence[Axes] | Axes = None, - kind: Literal["average", "individual", "both", "average"] = "average", + kind: Literal["average", "individual", "both"] = "average", centered: bool = False, subsample: float | None | int = 1000, random_state: RandomState | None | Int = None, diff --git a/stubs/sklearn/isotonic.pyi b/stubs/sklearn/isotonic.pyi index 2f718839..f94f7e73 100644 --- a/stubs/sklearn/isotonic.pyi +++ b/stubs/sklearn/isotonic.pyi @@ -10,7 +10,7 @@ from .base import BaseEstimator, RegressorMixin, TransformerMixin from .utils import check_array as check_array, check_consistent_length as check_consistent_length from .utils._param_validation import Interval as Interval, StrOptions as StrOptions -IsotonicRegression_Self = TypeVar("IsotonicRegression_Self", bound="IsotonicRegression") +IsotonicRegression_Self = TypeVar("IsotonicRegression_Self", bound=IsotonicRegression) # Authors: Fabian Pedregosa # Alexandre Gramfort @@ -50,7 +50,7 @@ class IsotonicRegression(RegressorMixin, TransformerMixin, BaseEstimator): y_min: None | Float = None, y_max: None | Float = None, increasing: str | bool = True, - out_of_bounds: Literal["nan", "clip", "raise", "nan"] = "nan", + out_of_bounds: Literal["nan", "clip", "raise"] = "nan", ) -> None: ... def fit( self: IsotonicRegression_Self, diff --git a/stubs/sklearn/kernel_approximation.pyi b/stubs/sklearn/kernel_approximation.pyi index d529ebb4..18274a53 100644 --- a/stubs/sklearn/kernel_approximation.pyi +++ b/stubs/sklearn/kernel_approximation.pyi @@ -19,11 +19,11 @@ from .utils._param_validation import Interval as Interval, StrOptions as StrOpti from .utils.extmath import safe_sparse_dot as safe_sparse_dot from .utils.validation import check_is_fitted as check_is_fitted, check_non_negative as check_non_negative -SkewedChi2Sampler_Self = TypeVar("SkewedChi2Sampler_Self", bound="SkewedChi2Sampler") -PolynomialCountSketch_Self = TypeVar("PolynomialCountSketch_Self", bound="PolynomialCountSketch") -AdditiveChi2Sampler_Self = TypeVar("AdditiveChi2Sampler_Self", bound="AdditiveChi2Sampler") -RBFSampler_Self = TypeVar("RBFSampler_Self", bound="RBFSampler") -Nystroem_Self = TypeVar("Nystroem_Self", bound="Nystroem") +SkewedChi2Sampler_Self = TypeVar("SkewedChi2Sampler_Self", bound=SkewedChi2Sampler) +PolynomialCountSketch_Self = TypeVar("PolynomialCountSketch_Self", bound=PolynomialCountSketch) +AdditiveChi2Sampler_Self = TypeVar("AdditiveChi2Sampler_Self", bound=AdditiveChi2Sampler) +RBFSampler_Self = TypeVar("RBFSampler_Self", bound=RBFSampler) +Nystroem_Self = TypeVar("Nystroem_Self", bound=Nystroem) import warnings diff --git a/stubs/sklearn/kernel_ridge.pyi b/stubs/sklearn/kernel_ridge.pyi index 3898d082..acbbbdc7 100644 --- a/stubs/sklearn/kernel_ridge.pyi +++ b/stubs/sklearn/kernel_ridge.pyi @@ -10,7 +10,7 @@ from .metrics.pairwise import PAIRWISE_KERNEL_FUNCTIONS as PAIRWISE_KERNEL_FUNCT from .utils._param_validation import Interval as Interval, StrOptions as StrOptions from .utils.validation import check_is_fitted as check_is_fitted -KernelRidge_Self = TypeVar("KernelRidge_Self", bound="KernelRidge") +KernelRidge_Self = TypeVar("KernelRidge_Self", bound=KernelRidge) import numpy as np diff --git a/stubs/sklearn/linear_model/_base.pyi b/stubs/sklearn/linear_model/_base.pyi index c4a2567b..1fb50ebe 100644 --- a/stubs/sklearn/linear_model/_base.pyi +++ b/stubs/sklearn/linear_model/_base.pyi @@ -19,8 +19,8 @@ from ..utils.sparsefuncs import inplace_column_scale as inplace_column_scale, me from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted from ._stochastic_gradient import SGDClassifier -LinearRegression_Self = TypeVar("LinearRegression_Self", bound="LinearRegression") -SparseCoefMixin_Self = TypeVar("SparseCoefMixin_Self", bound="SparseCoefMixin") +LinearRegression_Self = TypeVar("LinearRegression_Self", bound=LinearRegression) +SparseCoefMixin_Self = TypeVar("SparseCoefMixin_Self", bound=SparseCoefMixin) import numbers import warnings diff --git a/stubs/sklearn/linear_model/_bayes.pyi b/stubs/sklearn/linear_model/_bayes.pyi index c5f76cd5..c1e32ed9 100644 --- a/stubs/sklearn/linear_model/_bayes.pyi +++ b/stubs/sklearn/linear_model/_bayes.pyi @@ -12,8 +12,8 @@ from ..utils._param_validation import Interval as Interval from ..utils.extmath import fast_logdet as fast_logdet from ._base import LinearModel -BayesianRidge_Self = TypeVar("BayesianRidge_Self", bound="BayesianRidge") -ARDRegression_Self = TypeVar("ARDRegression_Self", bound="ARDRegression") +BayesianRidge_Self = TypeVar("BayesianRidge_Self", bound=BayesianRidge) +ARDRegression_Self = TypeVar("ARDRegression_Self", bound=ARDRegression) import numpy as np diff --git a/stubs/sklearn/linear_model/_coordinate_descent.pyi b/stubs/sklearn/linear_model/_coordinate_descent.pyi index d89a66fe..1a9c720e 100644 --- a/stubs/sklearn/linear_model/_coordinate_descent.pyi +++ b/stubs/sklearn/linear_model/_coordinate_descent.pyi @@ -26,11 +26,11 @@ from ..utils.validation import ( ) from ._base import LinearModel -LinearModelCV_Self = TypeVar("LinearModelCV_Self", bound="LinearModelCV") -MultiTaskElasticNetCV_Self = TypeVar("MultiTaskElasticNetCV_Self", bound="MultiTaskElasticNetCV") -MultiTaskLassoCV_Self = TypeVar("MultiTaskLassoCV_Self", bound="MultiTaskLassoCV") -ElasticNet_Self = TypeVar("ElasticNet_Self", bound="ElasticNet") -MultiTaskElasticNet_Self = TypeVar("MultiTaskElasticNet_Self", bound="MultiTaskElasticNet") +LinearModelCV_Self = TypeVar("LinearModelCV_Self", bound=LinearModelCV) +MultiTaskElasticNetCV_Self = TypeVar("MultiTaskElasticNetCV_Self", bound=MultiTaskElasticNetCV) +MultiTaskLassoCV_Self = TypeVar("MultiTaskLassoCV_Self", bound=MultiTaskLassoCV) +ElasticNet_Self = TypeVar("ElasticNet_Self", bound=ElasticNet) +MultiTaskElasticNet_Self = TypeVar("MultiTaskElasticNet_Self", bound=MultiTaskElasticNet) # Author: Alexandre Gramfort # Fabian Pedregosa @@ -52,7 +52,7 @@ def lasso_path( eps: Float = 1e-3, n_alphas: Int = 100, alphas: None | ArrayLike = None, - precompute: Literal["auto", "auto"] | MatrixLike | bool = "auto", + precompute: Literal["auto"] | MatrixLike | bool = "auto", Xy: None | MatrixLike | ArrayLike = None, copy_X: bool = True, coef_init: None | ArrayLike = None, @@ -69,7 +69,7 @@ def enet_path( eps: Float = 1e-3, n_alphas: Int = 100, alphas: None | ArrayLike = None, - precompute: Literal["auto", "auto"] | MatrixLike | bool = "auto", + precompute: Literal["auto"] | MatrixLike | bool = "auto", Xy: None | MatrixLike | ArrayLike = None, copy_X: bool = True, coef_init: None | ArrayLike = None, @@ -108,7 +108,7 @@ class ElasticNet(MultiOutputMixin, RegressorMixin, LinearModel): warm_start: bool = False, positive: bool = False, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... def fit( self: ElasticNet_Self, @@ -148,7 +148,7 @@ class Lasso(ElasticNet): warm_start: bool = False, positive: bool = False, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... class LinearModelCV(MultiOutputMixin, LinearModel, ABC): @@ -202,7 +202,7 @@ class LassoCV(RegressorMixin, LinearModelCV): n_alphas: Int = 100, alphas: None | ArrayLike = None, fit_intercept: bool = True, - precompute: Literal["auto", "auto"] | MatrixLike | bool = "auto", + precompute: Literal["auto"] | MatrixLike | bool = "auto", max_iter: Int = 1000, tol: Float = 1e-4, copy_X: bool = True, @@ -211,7 +211,7 @@ class LassoCV(RegressorMixin, LinearModelCV): n_jobs: None | Int = None, positive: bool = False, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... class ElasticNetCV(RegressorMixin, LinearModelCV): @@ -238,7 +238,7 @@ class ElasticNetCV(RegressorMixin, LinearModelCV): n_alphas: Int = 100, alphas: None | ArrayLike = None, fit_intercept: bool = True, - precompute: Literal["auto", "auto"] | MatrixLike | bool = "auto", + precompute: Literal["auto"] | MatrixLike | bool = "auto", max_iter: Int = 1000, tol: Float = 1e-4, cv: int | BaseCrossValidator | Iterable | None | BaseShuffleSplit = None, @@ -247,7 +247,7 @@ class ElasticNetCV(RegressorMixin, LinearModelCV): n_jobs: None | Int = None, positive: bool = False, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... ############################################################################### @@ -278,7 +278,7 @@ class MultiTaskElasticNet(Lasso): tol: Float = 1e-4, warm_start: bool = False, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... def fit(self: MultiTaskElasticNet_Self, X: ArrayLike, y: MatrixLike) -> MultiTaskElasticNet_Self | MultiTaskLasso: ... @@ -304,7 +304,7 @@ class MultiTaskLasso(MultiTaskElasticNet): tol: Float = 1e-4, warm_start: bool = False, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV): @@ -338,7 +338,7 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV): verbose: int | bool = 0, n_jobs: None | Int = None, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... # This is necessary as LinearModelCV now supports sample_weight while @@ -374,7 +374,7 @@ class MultiTaskLassoCV(RegressorMixin, LinearModelCV): verbose: int | bool = False, n_jobs: None | Int = None, random_state: RandomState | None | Int = None, - selection: Literal["cyclic", "random", "cyclic"] = "cyclic", + selection: Literal["cyclic", "random"] = "cyclic", ) -> None: ... # This is necessary as LinearModelCV now supports sample_weight while diff --git a/stubs/sklearn/linear_model/_glm/glm.pyi b/stubs/sklearn/linear_model/_glm/glm.pyi index 99ab2e14..8e6186cb 100644 --- a/stubs/sklearn/linear_model/_glm/glm.pyi +++ b/stubs/sklearn/linear_model/_glm/glm.pyi @@ -20,7 +20,7 @@ from ...utils.validation import check_is_fitted as check_is_fitted from .._linear_loss import LinearModelLoss as LinearModelLoss from ._newton_solver import NewtonCholeskySolver as NewtonCholeskySolver, NewtonSolver -_GeneralizedLinearRegressor_Self = TypeVar("_GeneralizedLinearRegressor_Self", bound="_GeneralizedLinearRegressor") +_GeneralizedLinearRegressor_Self = TypeVar("_GeneralizedLinearRegressor_Self", bound=_GeneralizedLinearRegressor) import numpy as np import scipy.optimize @@ -41,7 +41,7 @@ class _GeneralizedLinearRegressor(RegressorMixin, BaseEstimator): *, alpha: Float = 1.0, fit_intercept: bool = True, - solver: Literal["lbfgs", "newton-cholesky", "lbfgs"] = "lbfgs", + solver: Literal["lbfgs", "newton-cholesky"] = "lbfgs", max_iter: Int = 100, tol: Float = 1e-4, warm_start: bool = False, @@ -62,7 +62,7 @@ class _GeneralizedLinearRegressor(RegressorMixin, BaseEstimator): ) -> Float: ... # TODO(1.3): remove - @deprecated("Attribute `family` was deprecated in version 1.1 and will be removed in 1.3.") # type: ignore + @deprecated(...) # type: ignore def family(self): ... class PoissonRegressor(_GeneralizedLinearRegressor): @@ -79,7 +79,7 @@ class PoissonRegressor(_GeneralizedLinearRegressor): *, alpha: Float = 1.0, fit_intercept: bool = True, - solver: Literal["lbfgs", "newton-cholesky", "lbfgs"] = "lbfgs", + solver: Literal["lbfgs", "newton-cholesky"] = "lbfgs", max_iter: Int = 100, tol: Float = 1e-4, warm_start: bool = False, @@ -100,7 +100,7 @@ class GammaRegressor(_GeneralizedLinearRegressor): *, alpha: Float = 1.0, fit_intercept: bool = True, - solver: Literal["lbfgs", "newton-cholesky", "lbfgs"] = "lbfgs", + solver: Literal["lbfgs", "newton-cholesky"] = "lbfgs", max_iter: Int = 100, tol: Float = 1e-4, warm_start: bool = False, @@ -122,8 +122,8 @@ class TweedieRegressor(_GeneralizedLinearRegressor): power: Float = 0.0, alpha: Float = 1.0, fit_intercept: bool = True, - link: Literal["auto", "identity", "log", "auto"] = "auto", - solver: Literal["lbfgs", "newton-cholesky", "lbfgs"] = "lbfgs", + link: Literal["auto", "identity", "log"] = "auto", + solver: Literal["lbfgs", "newton-cholesky"] = "lbfgs", max_iter: Int = 100, tol: Float = 1e-4, warm_start: bool = False, diff --git a/stubs/sklearn/linear_model/_huber.pyi b/stubs/sklearn/linear_model/_huber.pyi index 13de3318..7a24c481 100644 --- a/stubs/sklearn/linear_model/_huber.pyi +++ b/stubs/sklearn/linear_model/_huber.pyi @@ -11,7 +11,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.extmath import safe_sparse_dot as safe_sparse_dot from ._base import LinearModel -HuberRegressor_Self = TypeVar("HuberRegressor_Self", bound="HuberRegressor") +HuberRegressor_Self = TypeVar("HuberRegressor_Self", bound=HuberRegressor) # Authors: Manoj Kumar mks542@nyu.edu # License: BSD 3 clause diff --git a/stubs/sklearn/linear_model/_least_angle.pyi b/stubs/sklearn/linear_model/_least_angle.pyi index 1fb6835b..c71624a9 100644 --- a/stubs/sklearn/linear_model/_least_angle.pyi +++ b/stubs/sklearn/linear_model/_least_angle.pyi @@ -17,9 +17,9 @@ from ..utils._param_validation import Hidden as Hidden, Interval as Interval, St from ..utils.parallel import Parallel as Parallel, delayed as delayed from ._base import LinearModel, LinearRegression as LinearRegression -LassoLarsIC_Self = TypeVar("LassoLarsIC_Self", bound="LassoLarsIC") -Lars_Self = TypeVar("Lars_Self", bound="Lars") -LarsCV_Self = TypeVar("LarsCV_Self", bound="LarsCV") +LassoLarsIC_Self = TypeVar("LassoLarsIC_Self", bound=LassoLarsIC) +Lars_Self = TypeVar("Lars_Self", bound=Lars) +LarsCV_Self = TypeVar("LarsCV_Self", bound=LarsCV) import sys import warnings @@ -36,7 +36,7 @@ def lars_path( Gram: None | MatrixLike | str = None, max_iter: Int = 500, alpha_min: Float = 0, - method: Literal["lar", "lasso", "lar"] = "lar", + method: Literal["lar", "lasso"] = "lar", copy_X: bool = True, eps: Float = ..., copy_Gram: bool = True, @@ -52,7 +52,7 @@ def lars_path_gram( n_samples: float | int, max_iter: Int = 500, alpha_min: Float = 0, - method: Literal["lar", "lasso", "lar"] = "lar", + method: Literal["lar", "lasso"] = "lar", copy_X: bool = True, eps: Float = ..., copy_Gram: bool = True, @@ -86,7 +86,7 @@ class Lars(MultiOutputMixin, RegressorMixin, LinearModel): fit_intercept: bool = True, verbose: int | bool = False, normalize: str | bool = "deprecated", - precompute: Literal["auto", "auto"] | ArrayLike | bool = "auto", + precompute: Literal["auto"] | ArrayLike | bool = "auto", n_nonzero_coefs: Int = 500, eps: Float = ..., copy_X: bool = True, @@ -122,7 +122,7 @@ class LassoLars(Lars): fit_intercept: bool = True, verbose: int | bool = False, normalize: str | bool = "deprecated", - precompute: Literal["auto", "auto"] | ArrayLike | bool = "auto", + precompute: Literal["auto"] | ArrayLike | bool = "auto", max_iter: Int = 500, eps: Float = ..., copy_X: bool = True, @@ -159,7 +159,7 @@ class LarsCV(Lars): verbose: int | bool = False, max_iter: Int = 500, normalize: str | bool = "deprecated", - precompute: Literal["auto", "auto"] | ArrayLike | bool = "auto", + precompute: Literal["auto"] | ArrayLike | bool = "auto", cv: int | BaseCrossValidator | Iterable | None | BaseShuffleSplit = None, max_n_alphas: Int = 1000, n_jobs: None | int = None, @@ -192,7 +192,7 @@ class LassoLarsCV(LarsCV): verbose: int | bool = False, max_iter: Int = 500, normalize: str | bool = "deprecated", - precompute: Literal["auto", "auto"] | bool = "auto", + precompute: Literal["auto"] | bool = "auto", cv: int | BaseCrossValidator | Iterable | None | BaseShuffleSplit = None, max_n_alphas: Int = 1000, n_jobs: None | int = None, @@ -219,12 +219,12 @@ class LassoLarsIC(LassoLars): def __init__( self, - criterion: Literal["aic", "bic", "aic"] = "aic", + criterion: Literal["aic", "bic"] = "aic", *, fit_intercept: bool = True, verbose: int | bool = False, normalize: str | bool = "deprecated", - precompute: Literal["auto", "auto"] | ArrayLike | bool = "auto", + precompute: Literal["auto"] | ArrayLike | bool = "auto", max_iter: Int = 500, eps: Float = ..., copy_X: bool = True, diff --git a/stubs/sklearn/linear_model/_logistic.pyi b/stubs/sklearn/linear_model/_logistic.pyi index e3b670cb..fe4924f8 100644 --- a/stubs/sklearn/linear_model/_logistic.pyi +++ b/stubs/sklearn/linear_model/_logistic.pyi @@ -28,8 +28,8 @@ from ._glm.glm import NewtonCholeskySolver as NewtonCholeskySolver from ._linear_loss import LinearModelLoss as LinearModelLoss from ._sag import sag_solver as sag_solver -LogisticRegressionCV_Self = TypeVar("LogisticRegressionCV_Self", bound="LogisticRegressionCV") -LogisticRegression_Self = TypeVar("LogisticRegression_Self", bound="LogisticRegression") +LogisticRegressionCV_Self = TypeVar("LogisticRegressionCV_Self", bound=LogisticRegressionCV) +LogisticRegression_Self = TypeVar("LogisticRegression_Self", bound=LogisticRegression) # Author: Gael Varoquaux # Fabian Pedregosa @@ -58,7 +58,7 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator): def __init__( self, - penalty: Literal["l1", "l2", "elasticnet", "l2"] | None = "l2", + penalty: Literal["l1", "l2", "elasticnet"] | None = "l2", *, dual: bool = False, tol: Float = 1e-4, @@ -67,9 +67,9 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator): intercept_scaling: Float = 1, class_weight: None | Mapping | str = None, random_state: RandomState | None | Int = None, - solver: Literal["lbfgs", "liblinear", "newton-cg", "newton-cholesky", "sag", "saga", "lbfgs"] = "lbfgs", + solver: Literal["lbfgs", "liblinear", "newton-cg", "newton-cholesky", "sag", "saga"] = "lbfgs", max_iter: Int = 100, - multi_class: Literal["auto", "ovr", "multinomial", "auto"] = "auto", + multi_class: Literal["auto", "ovr", "multinomial"] = "auto", verbose: Int = 0, warm_start: bool = False, n_jobs: None | Int = None, @@ -110,9 +110,9 @@ class LogisticRegressionCV(LogisticRegression, LinearClassifierMixin, BaseEstima fit_intercept: bool = True, cv: int | None | BaseShuffleSplit | BaseCrossValidator = None, dual: bool = False, - penalty: Literal["l1", "l2", "elasticnet", "l2"] = "l2", + penalty: Literal["l1", "l2", "elasticnet"] = "l2", scoring: None | str | Callable = None, - solver: Literal["lbfgs", "liblinear", "newton-cg", "newton-cholesky", "sag", "saga", "lbfgs"] = "lbfgs", + solver: Literal["lbfgs", "liblinear", "newton-cg", "newton-cholesky", "sag", "saga"] = "lbfgs", tol: Float = 1e-4, max_iter: Int = 100, class_weight: None | Mapping | str = None, @@ -120,7 +120,7 @@ class LogisticRegressionCV(LogisticRegression, LinearClassifierMixin, BaseEstima verbose: Int = 0, refit: bool = True, intercept_scaling: Float = 1.0, - multi_class: Literal["auto", "ovr", "multinomial", "auto"] = "auto", + multi_class: Literal["auto", "ovr", "multinomial"] = "auto", random_state: RandomState | None | Int = None, l1_ratios: None | Sequence[float] = None, ) -> None: ... diff --git a/stubs/sklearn/linear_model/_omp.pyi b/stubs/sklearn/linear_model/_omp.pyi index 382ca441..6456922b 100644 --- a/stubs/sklearn/linear_model/_omp.pyi +++ b/stubs/sklearn/linear_model/_omp.pyi @@ -15,8 +15,8 @@ from ..utils._param_validation import Hidden as Hidden, Interval as Interval, St from ..utils.parallel import Parallel as Parallel, delayed as delayed from ._base import LinearModel -OrthogonalMatchingPursuitCV_Self = TypeVar("OrthogonalMatchingPursuitCV_Self", bound="OrthogonalMatchingPursuitCV") -OrthogonalMatchingPursuit_Self = TypeVar("OrthogonalMatchingPursuit_Self", bound="OrthogonalMatchingPursuit") +OrthogonalMatchingPursuitCV_Self = TypeVar("OrthogonalMatchingPursuitCV_Self", bound=OrthogonalMatchingPursuitCV) +OrthogonalMatchingPursuit_Self = TypeVar("OrthogonalMatchingPursuit_Self", bound=OrthogonalMatchingPursuit) # Author: Vlad Niculae # @@ -69,7 +69,7 @@ class OrthogonalMatchingPursuit(MultiOutputMixin, RegressorMixin, LinearModel): tol: None | Float = None, fit_intercept: bool = True, normalize: str | bool = "deprecated", - precompute: Literal["auto", "auto"] | bool = "auto", + precompute: Literal["auto"] | bool = "auto", ) -> None: ... def fit(self: OrthogonalMatchingPursuit_Self, X: MatrixLike, y: MatrixLike | ArrayLike) -> OrthogonalMatchingPursuit_Self: ... diff --git a/stubs/sklearn/linear_model/_passive_aggressive.pyi b/stubs/sklearn/linear_model/_passive_aggressive.pyi index 15bfba0b..97f06523 100644 --- a/stubs/sklearn/linear_model/_passive_aggressive.pyi +++ b/stubs/sklearn/linear_model/_passive_aggressive.pyi @@ -8,8 +8,8 @@ from .._typing import ArrayLike, Float, Int, MatrixLike from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ._stochastic_gradient import DEFAULT_EPSILON as DEFAULT_EPSILON, BaseSGDClassifier, BaseSGDRegressor -PassiveAggressiveClassifier_Self = TypeVar("PassiveAggressiveClassifier_Self", bound="PassiveAggressiveClassifier") -PassiveAggressiveRegressor_Self = TypeVar("PassiveAggressiveRegressor_Self", bound="PassiveAggressiveRegressor") +PassiveAggressiveClassifier_Self = TypeVar("PassiveAggressiveClassifier_Self", bound=PassiveAggressiveClassifier) +PassiveAggressiveRegressor_Self = TypeVar("PassiveAggressiveRegressor_Self", bound=PassiveAggressiveRegressor) # Authors: Rob Zinkov, Mathieu Blondel # License: BSD 3 clause diff --git a/stubs/sklearn/linear_model/_quantile.pyi b/stubs/sklearn/linear_model/_quantile.pyi index f1088dd1..597407aa 100644 --- a/stubs/sklearn/linear_model/_quantile.pyi +++ b/stubs/sklearn/linear_model/_quantile.pyi @@ -11,7 +11,7 @@ from ..exceptions import ConvergenceWarning as ConvergenceWarning from ..utils._param_validation import Hidden as Hidden, Interval as Interval, StrOptions as StrOptions from ._base import LinearModel -QuantileRegressor_Self = TypeVar("QuantileRegressor_Self", bound="QuantileRegressor") +QuantileRegressor_Self = TypeVar("QuantileRegressor_Self", bound=QuantileRegressor) # Authors: David Dale # Christian Lorentzen diff --git a/stubs/sklearn/linear_model/_ransac.pyi b/stubs/sklearn/linear_model/_ransac.pyi index 395a40a2..74a62ab2 100644 --- a/stubs/sklearn/linear_model/_ransac.pyi +++ b/stubs/sklearn/linear_model/_ransac.pyi @@ -19,7 +19,7 @@ from ..utils.random import sample_without_replacement as sample_without_replacem from ..utils.validation import check_is_fitted as check_is_fitted, has_fit_parameter as has_fit_parameter from ._base import LinearRegression as LinearRegression -RANSACRegressor_Self = TypeVar("RANSACRegressor_Self", bound="RANSACRegressor") +RANSACRegressor_Self = TypeVar("RANSACRegressor_Self", bound=RANSACRegressor) # Author: Johannes Schönberger # diff --git a/stubs/sklearn/linear_model/_ridge.pyi b/stubs/sklearn/linear_model/_ridge.pyi index 92942141..ab6869b8 100644 --- a/stubs/sklearn/linear_model/_ridge.pyi +++ b/stubs/sklearn/linear_model/_ridge.pyi @@ -34,12 +34,12 @@ from ..utils.validation import check_is_fitted as check_is_fitted from ._base import LinearClassifierMixin, LinearModel from ._sag import sag_solver as sag_solver -_BaseRidgeCV_Self = TypeVar("_BaseRidgeCV_Self", bound="_BaseRidgeCV") -_RidgeGCV_Self = TypeVar("_RidgeGCV_Self", bound="_RidgeGCV") -RidgeClassifier_Self = TypeVar("RidgeClassifier_Self", bound="RidgeClassifier") -RidgeClassifierCV_Self = TypeVar("RidgeClassifierCV_Self", bound="RidgeClassifierCV") -RidgeCV_Self = TypeVar("RidgeCV_Self", bound="RidgeCV") -Ridge_Self = TypeVar("Ridge_Self", bound="Ridge") +_BaseRidgeCV_Self = TypeVar("_BaseRidgeCV_Self", bound=_BaseRidgeCV) +_RidgeGCV_Self = TypeVar("_RidgeGCV_Self", bound=_RidgeGCV) +RidgeClassifier_Self = TypeVar("RidgeClassifier_Self", bound=RidgeClassifier) +RidgeClassifierCV_Self = TypeVar("RidgeClassifierCV_Self", bound=RidgeClassifierCV) +RidgeCV_Self = TypeVar("RidgeCV_Self", bound=RidgeCV) +Ridge_Self = TypeVar("Ridge_Self", bound=Ridge) import numbers import warnings @@ -52,7 +52,7 @@ def ridge_regression( alpha: float | ArrayLike, *, sample_weight: None | ArrayLike = None, - solver: Literal["auto", "svd", "cholesky", "lsqr", "sparse_cg", "sag", "saga", "lbfgs", "auto"] = "auto", + solver: Literal["auto", "svd", "cholesky", "lsqr", "sparse_cg", "sag", "saga", "lbfgs"] = "auto", max_iter: None | Int = None, tol: Float = 1e-4, verbose: Int = 0, @@ -101,17 +101,7 @@ class Ridge(MultiOutputMixin, RegressorMixin, _BaseRidge): copy_X: bool = True, max_iter: None | Int = None, tol: Float = 1e-4, - solver: Literal[ - "auto", - "svd", - "cholesky", - "lsqr", - "sparse_cg", - "sag", - "saga", - "lbfgs", - "auto", - ] = "auto", + solver: Literal["auto", "svd", "cholesky", "lsqr", "sparse_cg", "sag", "saga", "lbfgs"] = "auto", positive: bool = False, random_state: RandomState | None | Int = None, ) -> None: ... @@ -145,17 +135,7 @@ class RidgeClassifier(_RidgeClassifierMixin, _BaseRidge): max_iter: None | Int = None, tol: Float = 1e-4, class_weight: None | Mapping | str = None, - solver: Literal[ - "auto", - "svd", - "cholesky", - "lsqr", - "sparse_cg", - "sag", - "saga", - "lbfgs", - "auto", - ] = "auto", + solver: Literal["auto", "svd", "cholesky", "lsqr", "sparse_cg", "sag", "saga", "lbfgs"] = "auto", positive: bool = False, random_state: RandomState | None | Int = None, ) -> None: ... diff --git a/stubs/sklearn/linear_model/_sag.pyi b/stubs/sklearn/linear_model/_sag.pyi index dfb13cac..8ceb5731 100644 --- a/stubs/sklearn/linear_model/_sag.pyi +++ b/stubs/sklearn/linear_model/_sag.pyi @@ -28,7 +28,7 @@ def sag_solver( X: MatrixLike | ArrayLike, y: ArrayLike, sample_weight: None | ArrayLike = None, - loss: Literal["log", "log", "squared", "multinomial"] = "log", + loss: Literal["log", "squared", "multinomial"] = "log", alpha: Float = 1.0, beta: Float = 0.0, max_iter: Int = 1000, diff --git a/stubs/sklearn/linear_model/_stochastic_gradient.pyi b/stubs/sklearn/linear_model/_stochastic_gradient.pyi index b3f3194c..fc1cc355 100644 --- a/stubs/sklearn/linear_model/_stochastic_gradient.pyi +++ b/stubs/sklearn/linear_model/_stochastic_gradient.pyi @@ -29,9 +29,9 @@ from ._sgd_fast import ( SquaredLoss as SquaredLoss, ) -BaseSGDClassifier_Self = TypeVar("BaseSGDClassifier_Self", bound="BaseSGDClassifier") -SGDOneClassSVM_Self = TypeVar("SGDOneClassSVM_Self", bound="SGDOneClassSVM") -BaseSGDRegressor_Self = TypeVar("BaseSGDRegressor_Self", bound="BaseSGDRegressor") +BaseSGDClassifier_Self = TypeVar("BaseSGDClassifier_Self", bound=BaseSGDClassifier) +SGDOneClassSVM_Self = TypeVar("SGDOneClassSVM_Self", bound=SGDOneClassSVM) +BaseSGDRegressor_Self = TypeVar("BaseSGDRegressor_Self", bound=BaseSGDRegressor) # Authors: Peter Prettenhofer (main author) # Mathieu Blondel (partial_fit support) @@ -170,21 +170,9 @@ class SGDClassifier(BaseSGDClassifier): def __init__( self, - loss: Literal[ - "hinge", - "log_loss", - "log", - "modified_huber", - "squared_hinge", - "perceptron", - "squared_error", - "huber", - "epsilon_insensitive", - "squared_epsilon_insensitive", - "hinge", - ] = "hinge", + loss: Literal["hinge", "log_loss", "log", "modified_huber", "squared_hinge", "perceptron", "squared_error", "huber", "epsilon_insensitive", "squared_epsilon_insensitive"] = "hinge", *, - penalty: None | Literal["l2", "l1", "elasticnet", "l2"] = "l2", + penalty: None | Literal["l2", "l1", "elasticnet"] = "l2", alpha: Float = 0.0001, l1_ratio: Float = 0.15, fit_intercept: bool = True, @@ -267,7 +255,7 @@ class SGDRegressor(BaseSGDRegressor): self, loss: str = "squared_error", *, - penalty: None | Literal["l2", "l1", "elasticnet", "l2"] = "l2", + penalty: None | Literal["l2", "l1", "elasticnet"] = "l2", alpha: Float = 0.0001, l1_ratio: Float = 0.15, fit_intercept: bool = True, @@ -309,7 +297,7 @@ class SGDOneClassSVM(BaseSGD, OutlierMixin): shuffle: bool = True, verbose: Int = 0, random_state: RandomState | None | Int = None, - learning_rate: Literal["optimal", "constant", "optimal", "invscaling", "adaptive"] = "optimal", + learning_rate: Literal["optimal", "constant", "invscaling", "adaptive"] = "optimal", eta0: Float = 0.0, power_t: Float = 0.5, warm_start: bool = False, diff --git a/stubs/sklearn/linear_model/_theil_sen.pyi b/stubs/sklearn/linear_model/_theil_sen.pyi index c56f6559..f7bd9802 100644 --- a/stubs/sklearn/linear_model/_theil_sen.pyi +++ b/stubs/sklearn/linear_model/_theil_sen.pyi @@ -17,7 +17,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.parallel import Parallel as Parallel, delayed as delayed from ._base import LinearModel -TheilSenRegressor_Self = TypeVar("TheilSenRegressor_Self", bound="TheilSenRegressor") +TheilSenRegressor_Self = TypeVar("TheilSenRegressor_Self", bound=TheilSenRegressor) # Author: Florian Wilhelm # diff --git a/stubs/sklearn/manifold/_isomap.pyi b/stubs/sklearn/manifold/_isomap.pyi index c34619d9..eecf040f 100644 --- a/stubs/sklearn/manifold/_isomap.pyi +++ b/stubs/sklearn/manifold/_isomap.pyi @@ -16,7 +16,7 @@ from ..preprocessing import KernelCenterer as KernelCenterer from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ..utils.validation import check_is_fitted as check_is_fitted -Isomap_Self = TypeVar("Isomap_Self", bound="Isomap") +Isomap_Self = TypeVar("Isomap_Self", bound=Isomap) # Author: Jake Vanderplas -- # License: BSD 3 clause (C) 2011 @@ -40,11 +40,11 @@ class Isomap(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator): n_neighbors: None | int = 5, radius: None | Float = None, n_components: Int = 2, - eigen_solver: Literal["auto", "arpack", "dense", "auto"] = "auto", + eigen_solver: Literal["auto", "arpack", "dense"] = "auto", tol: Float = 0, max_iter: None | Int = None, - path_method: Literal["auto", "FW", "D", "auto"] = "auto", - neighbors_algorithm: Literal["auto", "brute", "kd_tree", "ball_tree", "auto"] = "auto", + path_method: Literal["auto", "FW", "D"] = "auto", + neighbors_algorithm: Literal["auto", "brute", "kd_tree", "ball_tree"] = "auto", n_jobs: None | int = None, metric: str | Callable = "minkowski", p: Int = 2, diff --git a/stubs/sklearn/manifold/_locally_linear.pyi b/stubs/sklearn/manifold/_locally_linear.pyi index 2c6c1540..74cf0271 100644 --- a/stubs/sklearn/manifold/_locally_linear.pyi +++ b/stubs/sklearn/manifold/_locally_linear.pyi @@ -16,7 +16,7 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.extmath import stable_cumsum as stable_cumsum from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted -LocallyLinearEmbedding_Self = TypeVar("LocallyLinearEmbedding_Self", bound="LocallyLinearEmbedding") +LocallyLinearEmbedding_Self = TypeVar("LocallyLinearEmbedding_Self", bound=LocallyLinearEmbedding) import numpy as np @@ -31,7 +31,7 @@ def null_space( M: MatrixLike | LinearOperator, k: Int, k_skip: Int = 1, - eigen_solver: Literal["auto", "arpack", "dense", "arpack"] = "arpack", + eigen_solver: Literal["auto", "arpack", "dense"] = "arpack", tol: Float = 1e-6, max_iter: Int = 100, random_state: None | Int | RandomState = None, @@ -42,10 +42,10 @@ def locally_linear_embedding( n_neighbors: Int, n_components: Int, reg: Float = 1e-3, - eigen_solver: Literal["auto", "arpack", "dense", "auto"] = "auto", + eigen_solver: Literal["auto", "arpack", "dense"] = "auto", tol: Float = 1e-6, max_iter: Int = 100, - method: Literal["standard", "hessian", "modified", "ltsa", "standard"] = "standard", + method: Literal["standard", "hessian", "modified", "ltsa"] = "standard", hessian_tol: Float = 1e-4, modified_tol: Float = 1e-12, random_state: RandomState | None | Int = None, @@ -72,13 +72,13 @@ class LocallyLinearEmbedding( n_neighbors: Int = 5, n_components: Int = 2, reg: Float = 1e-3, - eigen_solver: Literal["auto", "arpack", "dense", "auto"] = "auto", + eigen_solver: Literal["auto", "arpack", "dense"] = "auto", tol: Float = 1e-6, max_iter: Int = 100, - method: Literal["standard", "hessian", "modified", "ltsa", "standard"] = "standard", + method: Literal["standard", "hessian", "modified", "ltsa"] = "standard", hessian_tol: Float = 1e-4, modified_tol: Float = 1e-12, - neighbors_algorithm: Literal["auto", "brute", "kd_tree", "ball_tree", "auto"] = "auto", + neighbors_algorithm: Literal["auto", "brute", "kd_tree", "ball_tree"] = "auto", random_state: RandomState | None | Int = None, n_jobs: None | int = None, ) -> None: ... diff --git a/stubs/sklearn/manifold/_mds.pyi b/stubs/sklearn/manifold/_mds.pyi index 6e02aa77..83e99520 100644 --- a/stubs/sklearn/manifold/_mds.pyi +++ b/stubs/sklearn/manifold/_mds.pyi @@ -13,7 +13,7 @@ from ..utils import check_array as check_array, check_random_state as check_rand from ..utils._param_validation import Hidden as Hidden, Interval as Interval, StrOptions as StrOptions from ..utils.parallel import Parallel as Parallel, delayed as delayed -MDS_Self = TypeVar("MDS_Self", bound="MDS") +MDS_Self = TypeVar("MDS_Self", bound=MDS) import warnings @@ -56,7 +56,7 @@ class MDS(BaseEstimator): eps: Float = 1e-3, n_jobs: None | Int = None, random_state: RandomState | None | Int = None, - dissimilarity: Literal["euclidean", "precomputed", "euclidean"] = "euclidean", + dissimilarity: Literal["euclidean", "precomputed"] = "euclidean", normalized_stress: Literal["auto", "warn"] | bool = "warn", ) -> None: ... def fit(self: MDS_Self, X: MatrixLike, y: Any = None, init: None | MatrixLike = None) -> MDS_Self: ... diff --git a/stubs/sklearn/manifold/_spectral_embedding.pyi b/stubs/sklearn/manifold/_spectral_embedding.pyi index e67318e5..7361cbb9 100644 --- a/stubs/sklearn/manifold/_spectral_embedding.pyi +++ b/stubs/sklearn/manifold/_spectral_embedding.pyi @@ -16,7 +16,7 @@ from ..neighbors import NearestNeighbors as NearestNeighbors, kneighbors_graph a from ..utils import check_array as check_array, check_random_state as check_random_state, check_symmetric as check_symmetric from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions -SpectralEmbedding_Self = TypeVar("SpectralEmbedding_Self", bound="SpectralEmbedding") +SpectralEmbedding_Self = TypeVar("SpectralEmbedding_Self", bound=SpectralEmbedding) import warnings @@ -47,13 +47,7 @@ class SpectralEmbedding(BaseEstimator): n_components: Int = 2, *, affinity: ( - Literal[ - "nearest_neighbors", - "rbf", - "precomputed", - "precomputed_nearest_neighbors", - "nearest_neighbors", - ] + Literal["nearest_neighbors", "rbf", "precomputed", "precomputed_nearest_neighbors"] | Callable ) = "nearest_neighbors", gamma: None | Float = None, diff --git a/stubs/sklearn/manifold/_t_sne.pyi b/stubs/sklearn/manifold/_t_sne.pyi index ee537859..bf21b357 100644 --- a/stubs/sklearn/manifold/_t_sne.pyi +++ b/stubs/sklearn/manifold/_t_sne.pyi @@ -61,16 +61,16 @@ class TSNE(BaseEstimator): *, perplexity: Float = 30.0, early_exaggeration: Float = 12.0, - learning_rate: float | Literal["auto", "auto"] = "auto", + learning_rate: float | Literal["auto"] = "auto", n_iter: Int = 1000, n_iter_without_progress: Int = 300, min_grad_norm: Float = 1e-7, metric: str | Callable = "euclidean", metric_params: None | dict = None, - init: MatrixLike | Literal["random", "pca", "pca"] = "pca", + init: MatrixLike | Literal["random", "pca"] = "pca", verbose: Int = 0, random_state: RandomState | None | Int = None, - method: Literal["barnes_hut", "exact", "barnes_hut"] = "barnes_hut", + method: Literal["barnes_hut", "exact"] = "barnes_hut", angle: Float = 0.5, n_jobs: None | Int = None, square_distances: str | bool = "deprecated", diff --git a/stubs/sklearn/metrics/_classification.pyi b/stubs/sklearn/metrics/_classification.pyi index 94b95746..88d20861 100644 --- a/stubs/sklearn/metrics/_classification.pyi +++ b/stubs/sklearn/metrics/_classification.pyi @@ -71,9 +71,9 @@ def jaccard_score( *, labels: None | ArrayLike = None, pos_label: str | int = 1, - average: None | Literal["micro", "macro", "samples", "weighted", "binary", "binary"] = "binary", + average: None | Literal["micro", "macro", "samples", "weighted", "binary"] = "binary", sample_weight: None | ArrayLike = None, - zero_division: float | Literal["warn", "warn"] = "warn", + zero_division: float | Literal["warn"] = "warn", ) -> ndarray | Float: ... def matthews_corrcoef(y_true: ArrayLike, y_pred: ArrayLike, *, sample_weight: None | ArrayLike = None) -> float: ... def zero_one_loss( @@ -89,9 +89,9 @@ def f1_score( *, labels: None | ArrayLike = None, pos_label: str | int = 1, - average: None | Literal["micro", "macro", "samples", "weighted", "binary", "binary"] = "binary", + average: None | Literal["micro", "macro", "samples", "weighted", "binary"] = "binary", sample_weight: None | ArrayLike = None, - zero_division: Literal["warn", "warn"] | int = "warn", + zero_division: Literal["warn"] | int = "warn", ) -> ndarray | Float: ... def fbeta_score( y_true: MatrixLike | ArrayLike, @@ -100,9 +100,9 @@ def fbeta_score( beta: Float, labels: None | ArrayLike = None, pos_label: str | int = 1, - average: None | Literal["micro", "macro", "samples", "weighted", "binary", "binary"] = "binary", + average: None | Literal["micro", "macro", "samples", "weighted", "binary"] = "binary", sample_weight: None | ArrayLike = None, - zero_division: Literal["warn", "warn"] | int = "warn", + zero_division: Literal["warn"] | int = "warn", ) -> ndarray | Float: ... def precision_recall_fscore_support( y_true: MatrixLike | ArrayLike, @@ -114,7 +114,7 @@ def precision_recall_fscore_support( average: None | Literal["binary", "micro", "macro", "samples", "weighted"] = None, warn_for: list | set | tuple = ..., sample_weight: None | ArrayLike = None, - zero_division: Literal["warn", "warn"] | int = "warn", + zero_division: Literal["warn"] | int = "warn", ) -> tuple[float | ndarray, float | ndarray, float | ndarray, None | ndarray]: ... def class_likelihood_ratios( y_true: MatrixLike | ArrayLike, @@ -130,9 +130,9 @@ def precision_score( *, labels: None | ArrayLike = None, pos_label: str | int = 1, - average: None | Literal["micro", "macro", "samples", "weighted", "binary", "binary"] = "binary", + average: None | Literal["micro", "macro", "samples", "weighted", "binary"] = "binary", sample_weight: None | ArrayLike = None, - zero_division: Literal["warn", "warn"] | int = "warn", + zero_division: Literal["warn"] | int = "warn", ) -> ndarray | Float: ... def recall_score( y_true: MatrixLike | ArrayLike, @@ -140,9 +140,9 @@ def recall_score( *, labels: None | ArrayLike = None, pos_label: str | int = 1, - average: None | Literal["micro", "macro", "samples", "weighted", "binary", "binary"] = "binary", + average: None | Literal["micro", "macro", "samples", "weighted", "binary"] = "binary", sample_weight: None | ArrayLike = None, - zero_division: Literal["warn", "warn"] | int = "warn", + zero_division: Literal["warn"] | int = "warn", ) -> ndarray | Float: ... def balanced_accuracy_score( y_true: ArrayLike, @@ -160,7 +160,7 @@ def classification_report( sample_weight: None | ArrayLike = None, digits: Int = 2, output_dict: bool = False, - zero_division: Literal["warn", "warn"] | int = "warn", + zero_division: Literal["warn"] | int = "warn", ) -> str | dict: ... def hamming_loss( y_true: MatrixLike | ArrayLike, @@ -172,7 +172,7 @@ def log_loss( y_true: MatrixLike | ArrayLike, y_pred: MatrixLike | ArrayLike, *, - eps: float | Literal["auto", "auto"] = "auto", + eps: float | Literal["auto"] = "auto", normalize: bool = True, sample_weight: None | ArrayLike = None, labels: None | ArrayLike = None, diff --git a/stubs/sklearn/metrics/_plot/confusion_matrix.pyi b/stubs/sklearn/metrics/_plot/confusion_matrix.pyi index e275f4b8..536ae1c1 100644 --- a/stubs/sklearn/metrics/_plot/confusion_matrix.pyi +++ b/stubs/sklearn/metrics/_plot/confusion_matrix.pyi @@ -26,7 +26,7 @@ class ConfusionMatrixDisplay: *, include_values: bool = True, cmap: Colormap | str = "viridis", - xticks_rotation: float | Literal["vertical", "horizontal", "horizontal"] = "horizontal", + xticks_rotation: float | Literal["vertical", "horizontal"] = "horizontal", values_format: None | str = None, ax: None | Axes = None, colorbar: bool = True, @@ -45,7 +45,7 @@ class ConfusionMatrixDisplay: normalize: Literal["true", "pred", "all"] | None = None, display_labels: None | ArrayLike = None, include_values: bool = True, - xticks_rotation: float | Literal["vertical", "horizontal", "horizontal"] = "horizontal", + xticks_rotation: float | Literal["vertical", "horizontal"] = "horizontal", values_format: None | str = None, cmap: Colormap | str = "viridis", ax: None | Axes = None, @@ -64,7 +64,7 @@ class ConfusionMatrixDisplay: normalize: Literal["true", "pred", "all"] | None = None, display_labels: None | ArrayLike = None, include_values: bool = True, - xticks_rotation: float | Literal["vertical", "horizontal", "horizontal"] = "horizontal", + xticks_rotation: float | Literal["vertical", "horizontal"] = "horizontal", values_format: None | str = None, cmap: Colormap | str = "viridis", ax: None | Axes = None, diff --git a/stubs/sklearn/metrics/_plot/det_curve.pyi b/stubs/sklearn/metrics/_plot/det_curve.pyi index 96aec1b1..7873b5da 100644 --- a/stubs/sklearn/metrics/_plot/det_curve.pyi +++ b/stubs/sklearn/metrics/_plot/det_curve.pyi @@ -31,7 +31,7 @@ class DetCurveDisplay: y: ArrayLike, *, sample_weight: None | ArrayLike = None, - response_method: Literal["predict_proba", "decision_function", "auto", "auto"] = "auto", + response_method: Literal["predict_proba", "decision_function", "auto"] = "auto", pos_label: None | str | int = None, name: None | str = None, ax: None | Axes = None, diff --git a/stubs/sklearn/metrics/_plot/precision_recall_curve.pyi b/stubs/sklearn/metrics/_plot/precision_recall_curve.pyi index f1e3456a..b754f3d6 100644 --- a/stubs/sklearn/metrics/_plot/precision_recall_curve.pyi +++ b/stubs/sklearn/metrics/_plot/precision_recall_curve.pyi @@ -34,7 +34,7 @@ class PrecisionRecallDisplay: *, sample_weight: None | ArrayLike = None, pos_label: None | str | int = None, - response_method: Literal["predict_proba", "decision_function", "auto", "auto"] = "auto", + response_method: Literal["predict_proba", "decision_function", "auto"] = "auto", name: None | str = None, ax: None | Axes = None, **kwargs, diff --git a/stubs/sklearn/metrics/_plot/regression.pyi b/stubs/sklearn/metrics/_plot/regression.pyi index 0909d342..93c5c452 100644 --- a/stubs/sklearn/metrics/_plot/regression.pyi +++ b/stubs/sklearn/metrics/_plot/regression.pyi @@ -23,7 +23,7 @@ class PredictionErrorDisplay: self, ax: None | Axes = None, *, - kind: Literal["actual_vs_predicted", "residual_vs_predicted", "residual_vs_predicted"] = "residual_vs_predicted", + kind: Literal["actual_vs_predicted", "residual_vs_predicted"] = "residual_vs_predicted", scatter_kwargs: None | dict = None, line_kwargs: None | dict = None, ) -> PredictionErrorDisplay: ... @@ -34,7 +34,7 @@ class PredictionErrorDisplay: X: MatrixLike | ArrayLike, y: ArrayLike, *, - kind: Literal["actual_vs_predicted", "residual_vs_predicted", "residual_vs_predicted"] = "residual_vs_predicted", + kind: Literal["actual_vs_predicted", "residual_vs_predicted"] = "residual_vs_predicted", subsample: float | None | int = 1_000, random_state: None | RandomState | int = None, ax: None | Axes = None, @@ -47,7 +47,7 @@ class PredictionErrorDisplay: y_true: ArrayLike, y_pred: ArrayLike, *, - kind: Literal["actual_vs_predicted", "residual_vs_predicted", "residual_vs_predicted"] = "residual_vs_predicted", + kind: Literal["actual_vs_predicted", "residual_vs_predicted"] = "residual_vs_predicted", subsample: float | None | int = 1_000, random_state: None | RandomState | int = None, ax: None | Axes = None, diff --git a/stubs/sklearn/metrics/_plot/roc_curve.pyi b/stubs/sklearn/metrics/_plot/roc_curve.pyi index 579c2b5b..765571ce 100644 --- a/stubs/sklearn/metrics/_plot/roc_curve.pyi +++ b/stubs/sklearn/metrics/_plot/roc_curve.pyi @@ -33,7 +33,7 @@ class RocCurveDisplay: *, sample_weight: None | ArrayLike = None, drop_intermediate: bool = True, - response_method: Literal["predict_proba", "decision_function", "auto", "auto"] = "auto", + response_method: Literal["predict_proba", "decision_function", "auto"] = "auto", pos_label: None | str | int = None, name: None | str = None, ax: None | Axes = None, diff --git a/stubs/sklearn/metrics/_ranking.pyi b/stubs/sklearn/metrics/_ranking.pyi index eed132e3..e6a7b77f 100644 --- a/stubs/sklearn/metrics/_ranking.pyi +++ b/stubs/sklearn/metrics/_ranking.pyi @@ -36,7 +36,7 @@ def average_precision_score( y_true: MatrixLike | ArrayLike, y_score: MatrixLike | ArrayLike, *, - average: None | Literal["micro", "samples", "weighted", "macro", "macro"] = "macro", + average: None | Literal["micro", "samples", "weighted", "macro"] = "macro", pos_label: str | Int = 1, sample_weight: None | ArrayLike = None, ) -> Float: ... @@ -50,10 +50,10 @@ def roc_auc_score( y_true: MatrixLike | ArrayLike, y_score: MatrixLike | ArrayLike, *, - average: Literal["micro", "macro", "samples", "weighted", "macro"] | None = "macro", + average: Literal["micro", "macro", "samples", "weighted"] | None = "macro", sample_weight: None | ArrayLike = None, max_fpr: float | None = None, - multi_class: Literal["raise", "ovr", "ovo", "raise"] = "raise", + multi_class: Literal["raise", "ovr", "ovo"] = "raise", labels: None | ArrayLike = None, ) -> Float: ... def precision_recall_curve( diff --git a/stubs/sklearn/metrics/_regression.pyi b/stubs/sklearn/metrics/_regression.pyi index e5329e11..378a782c 100644 --- a/stubs/sklearn/metrics/_regression.pyi +++ b/stubs/sklearn/metrics/_regression.pyi @@ -39,7 +39,7 @@ def mean_absolute_error( y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> ndarray | Float: ... def mean_pinball_loss( y_true: MatrixLike | ArrayLike, @@ -47,14 +47,14 @@ def mean_pinball_loss( *, sample_weight: None | ArrayLike = None, alpha: float = 0.5, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> ndarray | Float: ... def mean_absolute_percentage_error( y_true: MatrixLike | ArrayLike, y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> ndarray | Float: ... @overload def mean_squared_error( @@ -62,7 +62,7 @@ def mean_squared_error( y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> ndarray | Float: ... @deprecated( "`squared` is deprecated in 1.4 and will be removed in 1.6. Use `root_mean_squared_error` instead to calculate the root mean squared error." @@ -73,7 +73,7 @@ def mean_squared_error( y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", squared: bool, ) -> ndarray | Float: ... @overload @@ -82,7 +82,7 @@ def mean_squared_log_error( y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> float | ndarray: ... @deprecated( "`squared` is deprecated in 1.4 and will be removed in 1.6. Use `root_mean_squared_log_error` instead to calculate the root mean squared logarithmic error." @@ -93,14 +93,14 @@ def mean_squared_log_error( y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", squared: bool, ) -> float | ndarray: ... def median_absolute_error( y_true: MatrixLike | ArrayLike, y_pred: MatrixLike | ArrayLike, *, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", sample_weight: None | ArrayLike = None, ) -> ndarray | Float: ... def explained_variance_score( @@ -108,7 +108,7 @@ def explained_variance_score( y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: Literal["raw_values", "uniform_average", "variance_weighted", "uniform_average"] | ArrayLike = "uniform_average", + multioutput: Literal["raw_values", "uniform_average", "variance_weighted"] | ArrayLike = "uniform_average", force_finite: bool = True, ) -> float | ndarray: ... def r2_score( @@ -117,7 +117,7 @@ def r2_score( *, sample_weight: None | ArrayLike = None, multioutput: ( - Literal["raw_values", "uniform_average", "variance_weighted", "uniform_average"] | None | ArrayLike + Literal["raw_values", "uniform_average", "variance_weighted"] | None | ArrayLike ) = "uniform_average", force_finite: bool = True, ) -> ndarray | Float: ... @@ -144,14 +144,14 @@ def d2_pinball_score( *, sample_weight: None | ArrayLike = None, alpha: Float = 0.5, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> float | ndarray: ... def d2_absolute_error_score( y_true: MatrixLike | ArrayLike, y_pred: MatrixLike | ArrayLike, *, sample_weight: None | ArrayLike = None, - multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average", + multioutput: ArrayLike | Literal["raw_values", "uniform_average"] = "uniform_average", ) -> float | ndarray: ... def root_mean_squared_error( y_true: MatrixLike | ArrayLike, diff --git a/stubs/sklearn/metrics/_scorer.pyi b/stubs/sklearn/metrics/_scorer.pyi index b1de461c..1fd6c6ea 100644 --- a/stubs/sklearn/metrics/_scorer.pyi +++ b/stubs/sklearn/metrics/_scorer.pyi @@ -55,7 +55,6 @@ class _MultimetricScorer: class _BaseScorer: def __init__(self, score_func: Callable, sign: int, kwargs) -> None: ... - def __repr__(self) -> str: ... def __call__( self, estimator: Any, diff --git a/stubs/sklearn/metrics/cluster/_bicluster.pyi b/stubs/sklearn/metrics/cluster/_bicluster.pyi index b9acc68f..b1a770a3 100644 --- a/stubs/sklearn/metrics/cluster/_bicluster.pyi +++ b/stubs/sklearn/metrics/cluster/_bicluster.pyi @@ -13,5 +13,5 @@ def consensus_score( a: tuple[ndarray, ndarray] | tuple[int, int], b: tuple[ndarray, ndarray] | tuple[int, int], *, - similarity: Literal["jaccard", "jaccard"] | Callable = "jaccard", + similarity: Literal["jaccard"] | Callable = "jaccard", ) -> Float: ... diff --git a/stubs/sklearn/mixture/_base.pyi b/stubs/sklearn/mixture/_base.pyi index 94ff30c1..35946dc8 100644 --- a/stubs/sklearn/mixture/_base.pyi +++ b/stubs/sklearn/mixture/_base.pyi @@ -16,7 +16,7 @@ from ..utils import check_random_state as check_random_state from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ..utils.validation import check_is_fitted as check_is_fitted -BaseMixture_Self = TypeVar("BaseMixture_Self", bound="BaseMixture") +BaseMixture_Self = TypeVar("BaseMixture_Self", bound=BaseMixture) # Author: Wei Xue # Modified by Thierry Guillemot diff --git a/stubs/sklearn/mixture/_bayesian_mixture.pyi b/stubs/sklearn/mixture/_bayesian_mixture.pyi index a38d3cd4..06c90b6a 100644 --- a/stubs/sklearn/mixture/_bayesian_mixture.pyi +++ b/stubs/sklearn/mixture/_bayesian_mixture.pyi @@ -42,15 +42,13 @@ class BayesianGaussianMixture(BaseMixture): self, *, n_components: Int = 1, - covariance_type: Literal["full", "tied", "diag", "spherical", "full"] = "full", + covariance_type: Literal["full", "tied", "diag", "spherical"] = "full", tol: Float = 1e-3, reg_covar: Float = 1e-6, max_iter: Int = 100, n_init: Int = 1, - init_params: Literal["kmeans", "k-means++", "random", "random_from_data", "kmeans"] = "kmeans", - weight_concentration_prior_type: Literal[ - "dirichlet_process", "dirichlet_distribution", "dirichlet_process" - ] = "dirichlet_process", + init_params: Literal["kmeans", "k-means++", "random", "random_from_data"] = "kmeans", + weight_concentration_prior_type: Literal["dirichlet_process", "dirichlet_distribution"] = "dirichlet_process", weight_concentration_prior: None | Float = None, mean_precision_prior: None | Float = None, mean_prior: None | ArrayLike = None, diff --git a/stubs/sklearn/mixture/_gaussian_mixture.pyi b/stubs/sklearn/mixture/_gaussian_mixture.pyi index 526b8bb4..3761b745 100644 --- a/stubs/sklearn/mixture/_gaussian_mixture.pyi +++ b/stubs/sklearn/mixture/_gaussian_mixture.pyi @@ -33,12 +33,12 @@ class GaussianMixture(BaseMixture): self, n_components: Int = 1, *, - covariance_type: Literal["full", "tied", "diag", "spherical", "full"] = "full", + covariance_type: Literal["full", "tied", "diag", "spherical"] = "full", tol: Float = 1e-3, reg_covar: Float = 1e-6, max_iter: Int = 100, n_init: Int = 1, - init_params: Literal["kmeans", "k-means++", "random", "random_from_data", "kmeans"] = "kmeans", + init_params: Literal["kmeans", "k-means++", "random", "random_from_data"] = "kmeans", weights_init: None | ArrayLike = None, means_init: None | ArrayLike = None, precisions_init: None | ArrayLike = None, diff --git a/stubs/sklearn/model_selection/_plot.pyi b/stubs/sklearn/model_selection/_plot.pyi index 290803d7..52ddfa47 100644 --- a/stubs/sklearn/model_selection/_plot.pyi +++ b/stubs/sklearn/model_selection/_plot.pyi @@ -32,9 +32,9 @@ class LearningCurveDisplay: *, negate_score: bool = False, score_name: None | str = None, - score_type: Literal["test", "train", "both", "test"] = "test", + score_type: Literal["test", "train", "both"] = "test", log_scale: bool = False, - std_display_style: None | Literal["errorbar", "fill_between", "fill_between"] = "fill_between", + std_display_style: None | Literal["errorbar", "fill_between"] = "fill_between", line_kw: None | dict = None, fill_between_kw: None | dict = None, errorbar_kw: None | dict = None, @@ -61,9 +61,9 @@ class LearningCurveDisplay: ax: None | Axes = None, negate_score: bool = False, score_name: None | str = None, - score_type: Literal["test", "train", "both", "test"] = "test", + score_type: Literal["test", "train", "both"] = "test", log_scale: bool = False, - std_display_style: None | Literal["errorbar", "fill_between", "fill_between"] = "fill_between", + std_display_style: None | Literal["errorbar", "fill_between"] = "fill_between", line_kw: None | dict = None, fill_between_kw: None | dict = None, errorbar_kw: None | dict = None, diff --git a/stubs/sklearn/model_selection/_search.pyi b/stubs/sklearn/model_selection/_search.pyi index 10a4efa7..1f400974 100644 --- a/stubs/sklearn/model_selection/_search.pyi +++ b/stubs/sklearn/model_selection/_search.pyi @@ -23,7 +23,7 @@ from ..utils.validation import check_is_fitted as check_is_fitted, indexable as from . import BaseCrossValidator from ._split import BaseShuffleSplit, check_cv as check_cv -BaseSearchCV_Self = TypeVar("BaseSearchCV_Self", bound="BaseSearchCV") +BaseSearchCV_Self = TypeVar("BaseSearchCV_Self", bound=BaseSearchCV) BaseEstimatorT = TypeVar("BaseEstimatorT", bound=BaseEstimator, default=BaseEstimator, covariant=True) import numbers @@ -86,7 +86,7 @@ class BaseSearchCV(MetaEstimatorMixin, BaseEstimator, metaclass=ABCMeta): **fit_params, ) -> BaseSearchCV_Self: ... -class GridSearchCV(Generic[BaseEstimatorT], BaseSearchCV): +class GridSearchCV(BaseSearchCV, Generic[BaseEstimatorT]): feature_names_in_: ndarray = ... n_features_in_: int = ... classes_: ndarray = ... diff --git a/stubs/sklearn/model_selection/_search_successive_halving.pyi b/stubs/sklearn/model_selection/_search_successive_halving.pyi index b41cb5db..debd40f8 100644 --- a/stubs/sklearn/model_selection/_search_successive_halving.pyi +++ b/stubs/sklearn/model_selection/_search_successive_halving.pyi @@ -16,7 +16,7 @@ from . import BaseCrossValidator, ParameterGrid as ParameterGrid, ParameterSampl from ._search import BaseSearchCV from ._split import BaseShuffleSplit, check_cv as check_cv -BaseSuccessiveHalving_Self = TypeVar("BaseSuccessiveHalving_Self", bound="BaseSuccessiveHalving") +BaseSuccessiveHalving_Self = TypeVar("BaseSuccessiveHalving_Self", bound=BaseSuccessiveHalving) import numpy as np @@ -85,7 +85,7 @@ class HalvingGridSearchCV(BaseSuccessiveHalving): factor: float | int = 3, resource: str = "n_samples", max_resources: str | Int = "auto", - min_resources: int | Literal["exhaust", "smallest", "exhaust"] = "exhaust", + min_resources: int | Literal["exhaust", "smallest"] = "exhaust", aggressive_elimination: bool = False, cv: Iterable | int | BaseShuffleSplit | BaseCrossValidator = 5, scoring: None | str | Callable = None, @@ -130,7 +130,7 @@ class HalvingRandomSearchCV(BaseSuccessiveHalving): factor: float | int = 3, resource: str = "n_samples", max_resources: str | Int = "auto", - min_resources: Literal["exhaust", "smallest", "smallest"] | int = "smallest", + min_resources: Literal["exhaust", "smallest"] | int = "smallest", aggressive_elimination: bool = False, cv: Iterable | int | BaseShuffleSplit | BaseCrossValidator = 5, scoring: None | str | Callable = None, diff --git a/stubs/sklearn/model_selection/_split.pyi b/stubs/sklearn/model_selection/_split.pyi index 885d8fa8..3cb8f2f4 100644 --- a/stubs/sklearn/model_selection/_split.pyi +++ b/stubs/sklearn/model_selection/_split.pyi @@ -47,7 +47,6 @@ class BaseCrossValidator(metaclass=ABCMeta): ) -> Iterator[tuple[ndarray, ndarray]]: ... @abstractmethod def get_n_splits(self, X=None, y=None, groups=None): ... - def __repr__(self) -> str: ... class LeaveOneOut(BaseCrossValidator): def get_n_splits(self, X: MatrixLike, y: Any = None, groups: Any = None) -> int: ... @@ -133,7 +132,6 @@ class _RepeatedSplits(metaclass=ABCMeta): self, X: MatrixLike, y: None | ArrayLike = None, groups: None | ArrayLike = None ) -> Iterator[tuple[ndarray, ndarray]]: ... def get_n_splits(self, X: Any = None, y: Any = None, groups: None | ArrayLike = None) -> int: ... - def __repr__(self) -> str: ... class RepeatedKFold(_RepeatedSplits): def __init__( @@ -159,7 +157,6 @@ class BaseShuffleSplit(metaclass=ABCMeta): self, X: MatrixLike, y: None | ArrayLike = None, groups: None | ArrayLike = None ) -> Iterator[tuple[ndarray, ndarray]]: ... def get_n_splits(self, X: Any = None, y: Any = None, groups: Any = None) -> int: ... - def __repr__(self) -> str: ... class ShuffleSplit(BaseShuffleSplit): def __init__( diff --git a/stubs/sklearn/model_selection/_validation.pyi b/stubs/sklearn/model_selection/_validation.pyi index 99301f62..0ebc2a26 100644 --- a/stubs/sklearn/model_selection/_validation.pyi +++ b/stubs/sklearn/model_selection/_validation.pyi @@ -81,7 +81,7 @@ def cross_val_predict( verbose: Int = 0, fit_params: None | dict = None, pre_dispatch: str | Int = "2*n_jobs", - method: Literal["predict", "predict_proba", "predict_log_proba", "decision_function", "predict"] = "predict", + method: Literal["predict", "predict_proba", "predict_log_proba", "decision_function"] = "predict", ) -> ndarray: ... def permutation_test_score( estimator: BaseEstimator | SVC, diff --git a/stubs/sklearn/multiclass.pyi b/stubs/sklearn/multiclass.pyi index 155d53af..4e04edfd 100644 --- a/stubs/sklearn/multiclass.pyi +++ b/stubs/sklearn/multiclass.pyi @@ -23,9 +23,9 @@ from .utils.multiclass import check_classification_targets as check_classificati from .utils.parallel import Parallel as Parallel, delayed as delayed from .utils.validation import check_is_fitted as check_is_fitted -OneVsRestClassifier_Self = TypeVar("OneVsRestClassifier_Self", bound="OneVsRestClassifier") -OneVsOneClassifier_Self = TypeVar("OneVsOneClassifier_Self", bound="OneVsOneClassifier") -OutputCodeClassifier_Self = TypeVar("OutputCodeClassifier_Self", bound="OutputCodeClassifier") +OneVsRestClassifier_Self = TypeVar("OneVsRestClassifier_Self", bound=OneVsRestClassifier) +OneVsOneClassifier_Self = TypeVar("OneVsOneClassifier_Self", bound=OneVsOneClassifier) +OutputCodeClassifier_Self = TypeVar("OutputCodeClassifier_Self", bound=OutputCodeClassifier) # Author: Mathieu Blondel # Author: Hamzeh Alsalhi <93hamsal@gmail.com> diff --git a/stubs/sklearn/multioutput.pyi b/stubs/sklearn/multioutput.pyi index 8283301d..9bd4ad61 100644 --- a/stubs/sklearn/multioutput.pyi +++ b/stubs/sklearn/multioutput.pyi @@ -24,12 +24,12 @@ from .utils.multiclass import check_classification_targets as check_classificati from .utils.parallel import Parallel as Parallel, delayed as delayed from .utils.validation import check_is_fitted as check_is_fitted, has_fit_parameter as has_fit_parameter -MultiOutputClassifier_Self = TypeVar("MultiOutputClassifier_Self", bound="MultiOutputClassifier") -RegressorChain_Self = TypeVar("RegressorChain_Self", bound="RegressorChain") -_BaseChain_Self = TypeVar("_BaseChain_Self", bound="_BaseChain") -_MultiOutputEstimator_Self = TypeVar("_MultiOutputEstimator_Self", bound="_MultiOutputEstimator") -MultiOutputRegressor_Self = TypeVar("MultiOutputRegressor_Self", bound="MultiOutputRegressor") -ClassifierChain_Self = TypeVar("ClassifierChain_Self", bound="ClassifierChain") +MultiOutputClassifier_Self = TypeVar("MultiOutputClassifier_Self", bound=MultiOutputClassifier) +RegressorChain_Self = TypeVar("RegressorChain_Self", bound=RegressorChain) +_BaseChain_Self = TypeVar("_BaseChain_Self", bound=_BaseChain) +_MultiOutputEstimator_Self = TypeVar("_MultiOutputEstimator_Self", bound=_MultiOutputEstimator) +MultiOutputRegressor_Self = TypeVar("MultiOutputRegressor_Self", bound=MultiOutputRegressor) +ClassifierChain_Self = TypeVar("ClassifierChain_Self", bound=ClassifierChain) import numpy as np import scipy.sparse as sp diff --git a/stubs/sklearn/naive_bayes.pyi b/stubs/sklearn/naive_bayes.pyi index 5cd5b7f7..b4017100 100644 --- a/stubs/sklearn/naive_bayes.pyi +++ b/stubs/sklearn/naive_bayes.pyi @@ -12,9 +12,9 @@ from .utils._param_validation import Hidden as Hidden, Interval as Interval, Str from .utils.extmath import safe_sparse_dot as safe_sparse_dot from .utils.validation import check_is_fitted as check_is_fitted, check_non_negative as check_non_negative -_BaseDiscreteNB_Self = TypeVar("_BaseDiscreteNB_Self", bound="_BaseDiscreteNB") -GaussianNB_Self = TypeVar("GaussianNB_Self", bound="GaussianNB") -CategoricalNB_Self = TypeVar("CategoricalNB_Self", bound="CategoricalNB") +_BaseDiscreteNB_Self = TypeVar("_BaseDiscreteNB_Self", bound=_BaseDiscreteNB) +GaussianNB_Self = TypeVar("GaussianNB_Self", bound=GaussianNB) +CategoricalNB_Self = TypeVar("CategoricalNB_Self", bound=CategoricalNB) # Author: Vincent Michel # Minor fixes by Fabian Pedregosa diff --git a/stubs/sklearn/neighbors/_base.pyi b/stubs/sklearn/neighbors/_base.pyi index 69cc0b54..ac04b567 100644 --- a/stubs/sklearn/neighbors/_base.pyi +++ b/stubs/sklearn/neighbors/_base.pyi @@ -65,7 +65,7 @@ class KNeighborsMixin: self, X: None | MatrixLike = None, n_neighbors: None | Int = None, - mode: Literal["connectivity", "connectivity", "distance"] = "connectivity", + mode: Literal["connectivity", "distance"] = "connectivity", ) -> spmatrix: ... class RadiusNeighborsMixin: @@ -80,6 +80,6 @@ class RadiusNeighborsMixin: self, X: None | MatrixLike | ArrayLike = None, radius: None | Float = None, - mode: Literal["connectivity", "distance", "connectivity"] = "connectivity", + mode: Literal["connectivity", "distance"] = "connectivity", sort_results: bool = False, ): ... diff --git a/stubs/sklearn/neighbors/_classification.pyi b/stubs/sklearn/neighbors/_classification.pyi index c779aaf6..32cc0cfd 100644 --- a/stubs/sklearn/neighbors/_classification.pyi +++ b/stubs/sklearn/neighbors/_classification.pyi @@ -9,8 +9,8 @@ from ..utils._param_validation import StrOptions as StrOptions from ..utils.extmath import weighted_mode as weighted_mode from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin -RadiusNeighborsClassifier_Self = TypeVar("RadiusNeighborsClassifier_Self", bound="RadiusNeighborsClassifier") -KNeighborsClassifier_Self = TypeVar("KNeighborsClassifier_Self", bound="KNeighborsClassifier") +RadiusNeighborsClassifier_Self = TypeVar("RadiusNeighborsClassifier_Self", bound=RadiusNeighborsClassifier) +KNeighborsClassifier_Self = TypeVar("KNeighborsClassifier_Self", bound=KNeighborsClassifier) import warnings @@ -31,8 +31,8 @@ class KNeighborsClassifier(KNeighborsMixin, ClassifierMixin, NeighborsBase): self, n_neighbors: Int = 5, *, - weights: None | Literal["uniform", "distance", "uniform"] | Callable = "uniform", - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + weights: None | Literal["uniform", "distance"] | Callable = "uniform", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, p: Int = 2, metric: str | Callable = "minkowski", @@ -59,8 +59,8 @@ class RadiusNeighborsClassifier(RadiusNeighborsMixin, ClassifierMixin, Neighbors self, radius: Float = 1.0, *, - weights: None | Literal["uniform", "distance", "uniform"] | Callable = "uniform", - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + weights: None | Literal["uniform", "distance"] | Callable = "uniform", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, p: Int = 2, metric: str | Callable = "minkowski", diff --git a/stubs/sklearn/neighbors/_graph.pyi b/stubs/sklearn/neighbors/_graph.pyi index 1fdef47c..7cb691b6 100644 --- a/stubs/sklearn/neighbors/_graph.pyi +++ b/stubs/sklearn/neighbors/_graph.pyi @@ -11,14 +11,14 @@ from ._ball_tree import BallTree from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin from ._unsupervised import NearestNeighbors -RadiusNeighborsTransformer_Self = TypeVar("RadiusNeighborsTransformer_Self", bound="RadiusNeighborsTransformer") -KNeighborsTransformer_Self = TypeVar("KNeighborsTransformer_Self", bound="KNeighborsTransformer") +RadiusNeighborsTransformer_Self = TypeVar("RadiusNeighborsTransformer_Self", bound=RadiusNeighborsTransformer) +KNeighborsTransformer_Self = TypeVar("KNeighborsTransformer_Self", bound=KNeighborsTransformer) def kneighbors_graph( X: MatrixLike | BallTree | NearestNeighbors, n_neighbors: Int, *, - mode: Literal["connectivity", "distance", "connectivity"] = "connectivity", + mode: Literal["connectivity", "distance"] = "connectivity", metric: str = "minkowski", p: Int = 2, metric_params: None | dict = None, @@ -29,7 +29,7 @@ def radius_neighbors_graph( X: MatrixLike | BallTree, radius: Float, *, - mode: Literal["connectivity", "distance", "connectivity"] = "connectivity", + mode: Literal["connectivity", "distance"] = "connectivity", metric: str = "minkowski", p: Int = 2, metric_params: None | dict = None, @@ -49,9 +49,9 @@ class KNeighborsTransformer(ClassNamePrefixFeaturesOutMixin, KNeighborsMixin, Tr def __init__( self, *, - mode: Literal["distance", "connectivity", "distance"] = "distance", + mode: Literal["distance", "connectivity"] = "distance", n_neighbors: Int = 5, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, metric: str | Callable = "minkowski", p: Int = 2, @@ -79,9 +79,9 @@ class RadiusNeighborsTransformer( def __init__( self, *, - mode: Literal["distance", "connectivity", "distance"] = "distance", + mode: Literal["distance", "connectivity"] = "distance", radius: Float = 1.0, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, metric: str | Callable = "minkowski", p: Int = 2, diff --git a/stubs/sklearn/neighbors/_kde.pyi b/stubs/sklearn/neighbors/_kde.pyi index 54b27b03..6662c311 100644 --- a/stubs/sklearn/neighbors/_kde.pyi +++ b/stubs/sklearn/neighbors/_kde.pyi @@ -16,7 +16,7 @@ from ._ball_tree import DTYPE as DTYPE, BallTree as BallTree from ._binary_tree import BinaryTree from ._kd_tree import KDTree as KDTree -KernelDensity_Self = TypeVar("KernelDensity_Self", bound="KernelDensity") +KernelDensity_Self = TypeVar("KernelDensity_Self", bound=KernelDensity) # Author: Jake Vanderplas import itertools @@ -41,16 +41,8 @@ class KernelDensity(BaseEstimator): self, *, bandwidth: float | Literal["scott", "silverman"] = 1.0, - algorithm: Literal["kd_tree", "ball_tree", "auto", "auto"] = "auto", - kernel: Literal[ - "gaussian", - "tophat", - "epanechnikov", - "exponential", - "linear", - "cosine", - "gaussian", - ] = "gaussian", + algorithm: Literal["kd_tree", "ball_tree", "auto"] = "auto", + kernel: Literal["gaussian", "tophat", "epanechnikov", "exponential", "linear", "cosine"] = "gaussian", metric: str = "euclidean", atol: Float = 0, rtol: Float = 0, diff --git a/stubs/sklearn/neighbors/_lof.pyi b/stubs/sklearn/neighbors/_lof.pyi index e53d59f3..97dbf13e 100644 --- a/stubs/sklearn/neighbors/_lof.pyi +++ b/stubs/sklearn/neighbors/_lof.pyi @@ -11,7 +11,7 @@ from ..utils.metaestimators import available_if as available_if from ..utils.validation import check_is_fitted as check_is_fitted from ._base import KNeighborsMixin, NeighborsBase -LocalOutlierFactor_Self = TypeVar("LocalOutlierFactor_Self", bound="LocalOutlierFactor") +LocalOutlierFactor_Self = TypeVar("LocalOutlierFactor_Self", bound=LocalOutlierFactor) # Authors: Nicolas Goix # Alexandre Gramfort @@ -39,7 +39,7 @@ class LocalOutlierFactor(KNeighborsMixin, OutlierMixin, NeighborsBase): self, n_neighbors: Int = 20, *, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, metric: str | Callable = "minkowski", p: Int = 2, diff --git a/stubs/sklearn/neighbors/_nca.pyi b/stubs/sklearn/neighbors/_nca.pyi index e9f67814..75c2ba73 100644 --- a/stubs/sklearn/neighbors/_nca.pyi +++ b/stubs/sklearn/neighbors/_nca.pyi @@ -18,7 +18,7 @@ from ..utils.multiclass import check_classification_targets as check_classificat from ..utils.random import check_random_state as check_random_state from ..utils.validation import check_array as check_array, check_is_fitted as check_is_fitted -NeighborhoodComponentsAnalysis_Self = TypeVar("NeighborhoodComponentsAnalysis_Self", bound="NeighborhoodComponentsAnalysis") +NeighborhoodComponentsAnalysis_Self = TypeVar("NeighborhoodComponentsAnalysis_Self", bound=NeighborhoodComponentsAnalysis) import sys import time @@ -38,7 +38,7 @@ class NeighborhoodComponentsAnalysis(ClassNamePrefixFeaturesOutMixin, Transforme self, n_components: None | Int = None, *, - init: Literal["auto", "pca", "lda", "identity", "random", "auto"] | MatrixLike = "auto", + init: Literal["auto", "pca", "lda", "identity", "random"] | MatrixLike = "auto", warm_start: bool = False, max_iter: Int = 50, tol: Float = 1e-5, diff --git a/stubs/sklearn/neighbors/_nearest_centroid.pyi b/stubs/sklearn/neighbors/_nearest_centroid.pyi index d8085f5c..4d498873 100644 --- a/stubs/sklearn/neighbors/_nearest_centroid.pyi +++ b/stubs/sklearn/neighbors/_nearest_centroid.pyi @@ -13,7 +13,7 @@ from ..utils.multiclass import check_classification_targets as check_classificat from ..utils.sparsefuncs import csc_median_axis_0 as csc_median_axis_0 from ..utils.validation import check_is_fitted as check_is_fitted -NearestCentroid_Self = TypeVar("NearestCentroid_Self", bound="NearestCentroid") +NearestCentroid_Self = TypeVar("NearestCentroid_Self", bound=NearestCentroid) # Author: Robert Layton # Olivier Grisel diff --git a/stubs/sklearn/neighbors/_regression.pyi b/stubs/sklearn/neighbors/_regression.pyi index 3dd1869b..5b07fe1e 100644 --- a/stubs/sklearn/neighbors/_regression.pyi +++ b/stubs/sklearn/neighbors/_regression.pyi @@ -7,8 +7,8 @@ from ..base import RegressorMixin from ..utils._param_validation import StrOptions as StrOptions from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin -KNeighborsRegressor_Self = TypeVar("KNeighborsRegressor_Self", bound="KNeighborsRegressor") -RadiusNeighborsRegressor_Self = TypeVar("RadiusNeighborsRegressor_Self", bound="RadiusNeighborsRegressor") +KNeighborsRegressor_Self = TypeVar("KNeighborsRegressor_Self", bound=KNeighborsRegressor) +RadiusNeighborsRegressor_Self = TypeVar("RadiusNeighborsRegressor_Self", bound=RadiusNeighborsRegressor) # Authors: Jake Vanderplas # Fabian Pedregosa @@ -37,8 +37,8 @@ class KNeighborsRegressor(KNeighborsMixin, RegressorMixin, NeighborsBase): self, n_neighbors: Int = 5, *, - weights: None | Literal["uniform", "distance", "uniform"] | Callable = "uniform", - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + weights: None | Literal["uniform", "distance"] | Callable = "uniform", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, p: Int = 2, metric: str | Callable = "minkowski", @@ -61,8 +61,8 @@ class RadiusNeighborsRegressor(RadiusNeighborsMixin, RegressorMixin, NeighborsBa self, radius: Float = 1.0, *, - weights: None | Literal["uniform", "distance", "uniform"] | Callable = "uniform", - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + weights: None | Literal["uniform", "distance"] | Callable = "uniform", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, p: Int = 2, metric: str | Callable = "minkowski", diff --git a/stubs/sklearn/neighbors/_unsupervised.pyi b/stubs/sklearn/neighbors/_unsupervised.pyi index ffa86209..21081306 100644 --- a/stubs/sklearn/neighbors/_unsupervised.pyi +++ b/stubs/sklearn/neighbors/_unsupervised.pyi @@ -5,7 +5,7 @@ from numpy import ndarray from .._typing import Float, Int, MatrixLike from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin -NearestNeighbors_Self = TypeVar("NearestNeighbors_Self", bound="NearestNeighbors") +NearestNeighbors_Self = TypeVar("NearestNeighbors_Self", bound=NearestNeighbors) class NearestNeighbors(KNeighborsMixin, RadiusNeighborsMixin, NeighborsBase): n_samples_fit_: int = ... @@ -19,7 +19,7 @@ class NearestNeighbors(KNeighborsMixin, RadiusNeighborsMixin, NeighborsBase): *, n_neighbors: Int = 5, radius: Float = 1.0, - algorithm: Literal["auto", "ball_tree", "kd_tree", "brute", "auto"] = "auto", + algorithm: Literal["auto", "ball_tree", "kd_tree", "brute"] = "auto", leaf_size: Int = 30, metric: str | Callable = "minkowski", p: Float = 2, diff --git a/stubs/sklearn/neural_network/_multilayer_perceptron.pyi b/stubs/sklearn/neural_network/_multilayer_perceptron.pyi index 8fefc550..7af30044 100644 --- a/stubs/sklearn/neural_network/_multilayer_perceptron.pyi +++ b/stubs/sklearn/neural_network/_multilayer_perceptron.pyi @@ -21,9 +21,9 @@ from ..utils.validation import check_is_fitted as check_is_fitted from ._base import ACTIVATIONS as ACTIVATIONS, DERIVATIVES as DERIVATIVES, LOSS_FUNCTIONS as LOSS_FUNCTIONS from ._stochastic_optimizers import AdamOptimizer as AdamOptimizer, SGDOptimizer as SGDOptimizer -BaseMultilayerPerceptron_Self = TypeVar("BaseMultilayerPerceptron_Self", bound="BaseMultilayerPerceptron") -MLPRegressor_Self = TypeVar("MLPRegressor_Self", bound="MLPRegressor") -MLPClassifier_Self = TypeVar("MLPClassifier_Self", bound="MLPClassifier") +BaseMultilayerPerceptron_Self = TypeVar("BaseMultilayerPerceptron_Self", bound=BaseMultilayerPerceptron) +MLPRegressor_Self = TypeVar("MLPRegressor_Self", bound=MLPRegressor) +MLPClassifier_Self = TypeVar("MLPClassifier_Self", bound=MLPClassifier) import warnings @@ -85,12 +85,12 @@ class MLPClassifier(ClassifierMixin, BaseMultilayerPerceptron): def __init__( self, hidden_layer_sizes: ArrayLike | tuple[int] = ..., - activation: Literal["relu", "identity", "logistic", "tanh", "relu"] = "relu", + activation: Literal["relu", "identity", "logistic", "tanh"] = "relu", *, - solver: Literal["lbfgs", "sgd", "adam", "adam"] = "adam", + solver: Literal["lbfgs", "sgd", "adam"] = "adam", alpha: Float = 0.0001, batch_size: str | Int = "auto", - learning_rate: Literal["constant", "invscaling", "adaptive", "constant"] = "constant", + learning_rate: Literal["constant", "invscaling", "adaptive"] = "constant", learning_rate_init: Float = 0.001, power_t: Float = 0.5, max_iter: Int = 200, @@ -138,12 +138,12 @@ class MLPRegressor(RegressorMixin, BaseMultilayerPerceptron): def __init__( self, hidden_layer_sizes: ArrayLike | tuple[int, int] = ..., - activation: Literal["relu", "identity", "logistic", "tanh", "relu"] = "relu", + activation: Literal["relu", "identity", "logistic", "tanh"] = "relu", *, - solver: Literal["lbfgs", "sgd", "adam", "adam"] = "adam", + solver: Literal["lbfgs", "sgd", "adam"] = "adam", alpha: Float = 0.0001, batch_size: str | Int = "auto", - learning_rate: Literal["constant", "invscaling", "adaptive", "constant"] = "constant", + learning_rate: Literal["constant", "invscaling", "adaptive"] = "constant", learning_rate_init: Float = 0.001, power_t: Float = 0.5, max_iter: Int = 200, diff --git a/stubs/sklearn/neural_network/_rbm.pyi b/stubs/sklearn/neural_network/_rbm.pyi index dac7bf1e..9120b892 100644 --- a/stubs/sklearn/neural_network/_rbm.pyi +++ b/stubs/sklearn/neural_network/_rbm.pyi @@ -12,7 +12,7 @@ from ..utils._param_validation import Interval as Interval from ..utils.extmath import log_logistic as log_logistic, safe_sparse_dot as safe_sparse_dot from ..utils.validation import check_is_fitted as check_is_fitted -BernoulliRBM_Self = TypeVar("BernoulliRBM_Self", bound="BernoulliRBM") +BernoulliRBM_Self = TypeVar("BernoulliRBM_Self", bound=BernoulliRBM) # Authors: Yann N. Dauphin # Vlad Niculae diff --git a/stubs/sklearn/neural_network/_stochastic_optimizers.pyi b/stubs/sklearn/neural_network/_stochastic_optimizers.pyi index fe07ec60..61309348 100644 --- a/stubs/sklearn/neural_network/_stochastic_optimizers.pyi +++ b/stubs/sklearn/neural_network/_stochastic_optimizers.pyi @@ -24,7 +24,7 @@ class SGDOptimizer(BaseOptimizer): self, params: Sequence | list[ndarray], learning_rate_init: Float = 0.1, - lr_schedule: Literal["constant", "adaptive", "invscaling", "constant"] = "constant", + lr_schedule: Literal["constant", "adaptive", "invscaling"] = "constant", momentum: Float = 0.9, nesterov: bool = True, power_t: Float = 0.5, diff --git a/stubs/sklearn/pipeline.pyi b/stubs/sklearn/pipeline.pyi index 7aeec794..486e1eeb 100644 --- a/stubs/sklearn/pipeline.pyi +++ b/stubs/sklearn/pipeline.pyi @@ -19,8 +19,8 @@ from .utils.metaestimators import _BaseComposition, available_if as available_if from .utils.parallel import Parallel as Parallel, delayed as delayed from .utils.validation import check_is_fitted as check_is_fitted, check_memory as check_memory -FeatureUnion_Self = TypeVar("FeatureUnion_Self", bound="FeatureUnion") -Pipeline_Self = TypeVar("Pipeline_Self", bound="Pipeline") +FeatureUnion_Self = TypeVar("FeatureUnion_Self", bound=FeatureUnion) +Pipeline_Self = TypeVar("Pipeline_Self", bound=Pipeline) import numpy as np diff --git a/stubs/sklearn/preprocessing/_data.pyi b/stubs/sklearn/preprocessing/_data.pyi index 48b688b4..bd8f5d46 100644 --- a/stubs/sklearn/preprocessing/_data.pyi +++ b/stubs/sklearn/preprocessing/_data.pyi @@ -31,15 +31,15 @@ from ..utils.validation import ( ) from ._encoders import OneHotEncoder -RobustScaler_Self = TypeVar("RobustScaler_Self", bound="RobustScaler") -KernelCenterer_Self = TypeVar("KernelCenterer_Self", bound="KernelCenterer") -Binarizer_Self = TypeVar("Binarizer_Self", bound="Binarizer") -QuantileTransformer_Self = TypeVar("QuantileTransformer_Self", bound="QuantileTransformer") -MaxAbsScaler_Self = TypeVar("MaxAbsScaler_Self", bound="MaxAbsScaler") -StandardScaler_Self = TypeVar("StandardScaler_Self", bound="StandardScaler") -MinMaxScaler_Self = TypeVar("MinMaxScaler_Self", bound="MinMaxScaler") -Normalizer_Self = TypeVar("Normalizer_Self", bound="Normalizer") -PowerTransformer_Self = TypeVar("PowerTransformer_Self", bound="PowerTransformer") +RobustScaler_Self = TypeVar("RobustScaler_Self", bound=RobustScaler) +KernelCenterer_Self = TypeVar("KernelCenterer_Self", bound=KernelCenterer) +Binarizer_Self = TypeVar("Binarizer_Self", bound=Binarizer) +QuantileTransformer_Self = TypeVar("QuantileTransformer_Self", bound=QuantileTransformer) +MaxAbsScaler_Self = TypeVar("MaxAbsScaler_Self", bound=MaxAbsScaler) +StandardScaler_Self = TypeVar("StandardScaler_Self", bound=StandardScaler) +MinMaxScaler_Self = TypeVar("MinMaxScaler_Self", bound=MinMaxScaler) +Normalizer_Self = TypeVar("Normalizer_Self", bound=Normalizer) +PowerTransformer_Self = TypeVar("PowerTransformer_Self", bound=PowerTransformer) # Authors: Alexandre Gramfort # Mathieu Blondel @@ -242,7 +242,7 @@ def robust_scale( @overload def normalize( X: spmatrix, - norm: Literal["l1", "l2", "max", "l2"] = "l2", + norm: Literal["l1", "l2", "max"] = "l2", *, axis: int = 1, copy: bool = True, @@ -251,7 +251,7 @@ def normalize( @overload def normalize( X: spmatrix, - norm: Literal["l1", "l2", "max", "l2"] = "l2", + norm: Literal["l1", "l2", "max"] = "l2", *, axis: int = 1, copy: bool = True, @@ -260,7 +260,7 @@ def normalize( @overload def normalize( X: ArrayLike, - norm: Literal["l1", "l2", "max", "l2"] = "l2", + norm: Literal["l1", "l2", "max"] = "l2", *, axis: int = 1, copy: bool = True, @@ -269,7 +269,7 @@ def normalize( @overload def normalize( X: ArrayLike, - norm: Literal["l1", "l2", "max", "l2"] = "l2", + norm: Literal["l1", "l2", "max"] = "l2", *, axis: int = 1, copy: bool = True, @@ -277,7 +277,7 @@ def normalize( ) -> ndarray: ... def normalize( X: MatrixLike | ArrayLike, - norm: Literal["l1", "l2", "max", "l2"] = "l2", + norm: Literal["l1", "l2", "max"] = "l2", *, axis: int = 1, copy: bool = True, @@ -290,7 +290,7 @@ class Normalizer(OneToOneFeatureMixin, TransformerMixin, BaseEstimator): _parameter_constraints: ClassVar[dict] = ... - def __init__(self, norm: Literal["l1", "l2", "max", "l2"] = "l2", *, copy: bool = True) -> None: ... + def __init__(self, norm: Literal["l1", "l2", "max"] = "l2", *, copy: bool = True) -> None: ... def fit(self: Normalizer_Self, X: MatrixLike | ArrayLike, y: Any = None) -> Normalizer_Self: ... @overload def transform(self, X: spmatrix, copy: None | bool = None) -> spmatrix: ... @@ -343,7 +343,7 @@ class QuantileTransformer(OneToOneFeatureMixin, TransformerMixin, BaseEstimator) self, *, n_quantiles: Int = 1000, - output_distribution: Literal["uniform", "normal", "uniform"] = "uniform", + output_distribution: Literal["uniform", "normal"] = "uniform", ignore_implicit_zeros: bool = False, subsample: Int = 10_000, random_state: RandomState | None | Int = None, @@ -371,7 +371,7 @@ def quantile_transform( *, axis: Int = 0, n_quantiles: Int = 1000, - output_distribution: Literal["uniform", "normal", "uniform"] = "uniform", + output_distribution: Literal["uniform", "normal"] = "uniform", ignore_implicit_zeros: bool = False, subsample: Int = ..., random_state: RandomState | None | Int = None, @@ -383,7 +383,7 @@ def quantile_transform( *, axis: Int = 0, n_quantiles: Int = 1000, - output_distribution: Literal["uniform", "normal", "uniform"] = "uniform", + output_distribution: Literal["uniform", "normal"] = "uniform", ignore_implicit_zeros: bool = False, subsample: Int = ..., random_state: RandomState | None | Int = None, @@ -394,7 +394,7 @@ def quantile_transform( *, axis: Int = 0, n_quantiles: Int = 1000, - output_distribution: Literal["uniform", "normal", "uniform"] = "uniform", + output_distribution: Literal["uniform", "normal"] = "uniform", ignore_implicit_zeros: bool = False, subsample: Int = ..., random_state: RandomState | None | Int = None, @@ -410,7 +410,7 @@ class PowerTransformer(OneToOneFeatureMixin, TransformerMixin, BaseEstimator): def __init__( self, - method: Literal["yeo-johnson", "box-cox", "yeo-johnson"] = "yeo-johnson", + method: Literal["yeo-johnson", "box-cox"] = "yeo-johnson", *, standardize: bool = True, copy: bool = True, @@ -422,7 +422,7 @@ class PowerTransformer(OneToOneFeatureMixin, TransformerMixin, BaseEstimator): def power_transform( X: MatrixLike, - method: Literal["yeo-johnson", "box-cox", "yeo-johnson"] = "yeo-johnson", + method: Literal["yeo-johnson", "box-cox"] = "yeo-johnson", *, standardize: bool = True, copy: bool = True, diff --git a/stubs/sklearn/preprocessing/_discretization.pyi b/stubs/sklearn/preprocessing/_discretization.pyi index b764636f..bc912dfe 100644 --- a/stubs/sklearn/preprocessing/_discretization.pyi +++ b/stubs/sklearn/preprocessing/_discretization.pyi @@ -17,7 +17,7 @@ from ..utils.validation import ( ) from . import OneHotEncoder as OneHotEncoder -KBinsDiscretizer_Self = TypeVar("KBinsDiscretizer_Self", bound="KBinsDiscretizer") +KBinsDiscretizer_Self = TypeVar("KBinsDiscretizer_Self", bound=KBinsDiscretizer) # Author: Henry Lin # Tom Dupré la Tour @@ -40,10 +40,10 @@ class KBinsDiscretizer(TransformerMixin, BaseEstimator): self, n_bins: ArrayLike | Int = 5, *, - encode: Literal["onehot", "onehot-dense", "ordinal", "onehot"] = "onehot", - strategy: Literal["uniform", "quantile", "kmeans", "quantile"] = "quantile", + encode: Literal["onehot", "onehot-dense", "ordinal"] = "onehot", + strategy: Literal["uniform", "quantile", "kmeans"] = "quantile", dtype: None | Float = None, - subsample: int | None | Literal["warn", "warn"] = "warn", + subsample: int | None | Literal["warn"] = "warn", random_state: RandomState | None | Int = None, ) -> None: ... def fit(self: KBinsDiscretizer_Self, X: MatrixLike, y: Series | None | ndarray = None) -> KBinsDiscretizer_Self: ... diff --git a/stubs/sklearn/preprocessing/_encoders.pyi b/stubs/sklearn/preprocessing/_encoders.pyi index c9312d38..a589bb8a 100644 --- a/stubs/sklearn/preprocessing/_encoders.pyi +++ b/stubs/sklearn/preprocessing/_encoders.pyi @@ -12,8 +12,8 @@ from ..utils import check_array as check_array, is_scalar_nan as is_scalar_nan from ..utils._param_validation import Hidden as Hidden, Interval as Interval, StrOptions as StrOptions from ..utils.validation import check_is_fitted as check_is_fitted -OrdinalEncoder_Self = TypeVar("OrdinalEncoder_Self", bound="OrdinalEncoder") -OneHotEncoder_Self = TypeVar("OneHotEncoder_Self", bound="OneHotEncoder") +OrdinalEncoder_Self = TypeVar("OrdinalEncoder_Self", bound=OrdinalEncoder) +OneHotEncoder_Self = TypeVar("OneHotEncoder_Self", bound=OneHotEncoder) # Authors: Andreas Mueller # Joris Van den Bossche @@ -39,12 +39,12 @@ class OneHotEncoder(_BaseEncoder): def __init__( self, *, - categories: Sequence[ArrayLike] | Literal["auto", "auto"] = "auto", + categories: Sequence[ArrayLike] | Literal["auto"] = "auto", drop: None | ArrayLike | Literal["first", "if_binary"] = None, sparse: str | bool = "deprecated", sparse_output: bool = True, dtype=..., - handle_unknown: Literal["error", "ignore", "infrequent_if_exist", "error"] = "error", + handle_unknown: Literal["error", "ignore", "infrequent_if_exist"] = "error", min_frequency: float | None | int = None, max_categories: None | Int = None, ) -> None: ... @@ -69,9 +69,9 @@ class OrdinalEncoder(OneToOneFeatureMixin, _BaseEncoder): def __init__( self, *, - categories: Sequence[ArrayLike] | Literal["auto", "auto"] = "auto", + categories: Sequence[ArrayLike] | Literal["auto"] = "auto", dtype=..., - handle_unknown: Literal["error", "use_encoded_value", "error"] = "error", + handle_unknown: Literal["error", "use_encoded_value"] = "error", unknown_value: float | None | int = None, encoded_missing_value: float | int = ..., ) -> None: ... diff --git a/stubs/sklearn/preprocessing/_function_transformer.pyi b/stubs/sklearn/preprocessing/_function_transformer.pyi index 8b0e6a24..656fc840 100644 --- a/stubs/sklearn/preprocessing/_function_transformer.pyi +++ b/stubs/sklearn/preprocessing/_function_transformer.pyi @@ -9,7 +9,7 @@ from ..utils._param_validation import StrOptions as StrOptions from ..utils.metaestimators import available_if as available_if from ..utils.validation import check_array as check_array -FunctionTransformer_Self = TypeVar("FunctionTransformer_Self", bound="FunctionTransformer") +FunctionTransformer_Self = TypeVar("FunctionTransformer_Self", bound=FunctionTransformer) import warnings diff --git a/stubs/sklearn/preprocessing/_label.pyi b/stubs/sklearn/preprocessing/_label.pyi index ecb125d4..ff45f62f 100644 --- a/stubs/sklearn/preprocessing/_label.pyi +++ b/stubs/sklearn/preprocessing/_label.pyi @@ -13,9 +13,9 @@ from ..utils.multiclass import type_of_target as type_of_target, unique_labels a from ..utils.sparsefuncs import min_max_axis as min_max_axis from ..utils.validation import check_array as check_array, check_is_fitted as check_is_fitted -MultiLabelBinarizer_Self = TypeVar("MultiLabelBinarizer_Self", bound="MultiLabelBinarizer") -LabelEncoder_Self = TypeVar("LabelEncoder_Self", bound="LabelEncoder") -LabelBinarizer_Self = TypeVar("LabelBinarizer_Self", bound="LabelBinarizer") +MultiLabelBinarizer_Self = TypeVar("MultiLabelBinarizer_Self", bound=MultiLabelBinarizer) +LabelEncoder_Self = TypeVar("LabelEncoder_Self", bound=LabelEncoder) +LabelBinarizer_Self = TypeVar("LabelBinarizer_Self", bound=LabelBinarizer) # Authors: Alexandre Gramfort # Mathieu Blondel diff --git a/stubs/sklearn/preprocessing/_polynomial.pyi b/stubs/sklearn/preprocessing/_polynomial.pyi index 40fee5c5..47685cd9 100644 --- a/stubs/sklearn/preprocessing/_polynomial.pyi +++ b/stubs/sklearn/preprocessing/_polynomial.pyi @@ -15,8 +15,8 @@ from ..utils import check_array as check_array from ..utils._param_validation import Interval as Interval, StrOptions as StrOptions from ..utils.validation import FLOAT_DTYPES as FLOAT_DTYPES, check_is_fitted as check_is_fitted -SplineTransformer_Self = TypeVar("SplineTransformer_Self", bound="SplineTransformer") -PolynomialFeatures_Self = TypeVar("PolynomialFeatures_Self", bound="PolynomialFeatures") +SplineTransformer_Self = TypeVar("SplineTransformer_Self", bound=SplineTransformer) +PolynomialFeatures_Self = TypeVar("PolynomialFeatures_Self", bound=PolynomialFeatures) import collections @@ -40,7 +40,7 @@ class PolynomialFeatures(TransformerMixin, BaseEstimator): *, interaction_only: bool = False, include_bias: bool = True, - order: Literal["C", "F", "C"] = "C", + order: Literal["C", "F"] = "C", ) -> None: ... @property def powers_(self) -> ndarray: ... @@ -63,10 +63,10 @@ class SplineTransformer(TransformerMixin, BaseEstimator): n_knots: Int = 5, degree: Int = 3, *, - knots: Literal["uniform", "quantile", "uniform"] | MatrixLike = "uniform", - extrapolation: Literal["error", "constant", "linear", "continue", "periodic", "constant"] = "constant", + knots: Literal["uniform", "quantile"] | MatrixLike = "uniform", + extrapolation: Literal["error", "constant", "linear", "continue", "periodic"] = "constant", include_bias: bool = True, - order: Literal["C", "F", "C"] = "C", + order: Literal["C", "F"] = "C", sparse_output: bool = False, ) -> None: ... def get_feature_names_out(self, input_features: None | ArrayLike = None) -> ndarray: ... diff --git a/stubs/sklearn/random_projection.pyi b/stubs/sklearn/random_projection.pyi index bc59c8bb..4e33cd03 100644 --- a/stubs/sklearn/random_projection.pyi +++ b/stubs/sklearn/random_projection.pyi @@ -16,7 +16,7 @@ from .utils.extmath import safe_sparse_dot as safe_sparse_dot from .utils.random import sample_without_replacement as sample_without_replacement from .utils.validation import check_array as check_array, check_is_fitted as check_is_fitted -BaseRandomProjection_Self = TypeVar("BaseRandomProjection_Self", bound="BaseRandomProjection") +BaseRandomProjection_Self = TypeVar("BaseRandomProjection_Self", bound=BaseRandomProjection) # Authors: Olivier Grisel , # Arnaud Joly @@ -63,7 +63,7 @@ class GaussianRandomProjection(BaseRandomProjection): def __init__( self, - n_components: Literal["auto", "auto"] | Int = "auto", + n_components: Literal["auto"] | Int = "auto", *, eps: Float = 0.1, compute_inverse_components: bool = False, @@ -83,9 +83,9 @@ class SparseRandomProjection(BaseRandomProjection): def __init__( self, - n_components: Literal["auto", "auto"] | Int = "auto", + n_components: Literal["auto"] | Int = "auto", *, - density: float | Literal["auto", "auto"] = "auto", + density: float | Literal["auto"] = "auto", eps: Float = 0.1, dense_output: bool = False, compute_inverse_components: bool = False, diff --git a/stubs/sklearn/semi_supervised/_label_propagation.pyi b/stubs/sklearn/semi_supervised/_label_propagation.pyi index 542b78ae..ad3f74dd 100644 --- a/stubs/sklearn/semi_supervised/_label_propagation.pyi +++ b/stubs/sklearn/semi_supervised/_label_propagation.pyi @@ -16,8 +16,8 @@ from ..utils.extmath import safe_sparse_dot as safe_sparse_dot from ..utils.multiclass import check_classification_targets as check_classification_targets from ..utils.validation import check_is_fitted as check_is_fitted -BaseLabelPropagation_Self = TypeVar("BaseLabelPropagation_Self", bound="BaseLabelPropagation") -LabelPropagation_Self = TypeVar("LabelPropagation_Self", bound="LabelPropagation") +BaseLabelPropagation_Self = TypeVar("BaseLabelPropagation_Self", bound=BaseLabelPropagation) +LabelPropagation_Self = TypeVar("LabelPropagation_Self", bound=LabelPropagation) # coding=utf8 @@ -30,7 +30,7 @@ class BaseLabelPropagation(ClassifierMixin, BaseEstimator, metaclass=ABCMeta): def __init__( self, - kernel: Callable | Literal["rbf", "knn", "rbf"] = "rbf", + kernel: Callable | Literal["rbf", "knn"] = "rbf", *, gamma: Float = 20, n_neighbors: Int = 7, @@ -58,7 +58,7 @@ class LabelPropagation(BaseLabelPropagation): def __init__( self, - kernel: Callable | Literal["knn", "rbf", "rbf"] = "rbf", + kernel: Callable | Literal["knn", "rbf"] = "rbf", *, gamma: Float = 20, n_neighbors: Int = 7, @@ -83,7 +83,7 @@ class LabelSpreading(BaseLabelPropagation): def __init__( self, - kernel: Callable | Literal["rbf", "knn", "rbf"] = "rbf", + kernel: Callable | Literal["rbf", "knn"] = "rbf", *, gamma: Float = 20, n_neighbors: Int = 7, diff --git a/stubs/sklearn/semi_supervised/_self_training.pyi b/stubs/sklearn/semi_supervised/_self_training.pyi index df135f1d..52eef913 100644 --- a/stubs/sklearn/semi_supervised/_self_training.pyi +++ b/stubs/sklearn/semi_supervised/_self_training.pyi @@ -10,7 +10,7 @@ from ..utils._param_validation import HasMethods as HasMethods, Interval as Inte from ..utils.metaestimators import available_if as available_if from ..utils.validation import check_is_fitted as check_is_fitted -SelfTrainingClassifier_Self = TypeVar("SelfTrainingClassifier_Self", bound="SelfTrainingClassifier") +SelfTrainingClassifier_Self = TypeVar("SelfTrainingClassifier_Self", bound=SelfTrainingClassifier) import warnings @@ -36,7 +36,7 @@ class SelfTrainingClassifier(MetaEstimatorMixin, BaseEstimator): self, base_estimator: BaseEstimator, threshold: Float = 0.75, - criterion: Literal["threshold", "k_best", "threshold"] = "threshold", + criterion: Literal["threshold", "k_best"] = "threshold", k_best: Int = 10, max_iter: None | int = 10, verbose: bool = False, diff --git a/stubs/sklearn/svm/_base.pyi b/stubs/sklearn/svm/_base.pyi index 9747cbca..87796c5c 100644 --- a/stubs/sklearn/svm/_base.pyi +++ b/stubs/sklearn/svm/_base.pyi @@ -21,7 +21,7 @@ from ..utils.metaestimators import available_if as available_if from ..utils.multiclass import check_classification_targets as check_classification_targets from ..utils.validation import check_consistent_length as check_consistent_length, check_is_fitted as check_is_fitted -BaseLibSVM_Self = TypeVar("BaseLibSVM_Self", bound="BaseLibSVM") +BaseLibSVM_Self = TypeVar("BaseLibSVM_Self", bound=BaseLibSVM) import warnings diff --git a/stubs/sklearn/svm/_bounds.pyi b/stubs/sklearn/svm/_bounds.pyi index e7cea061..65936e96 100644 --- a/stubs/sklearn/svm/_bounds.pyi +++ b/stubs/sklearn/svm/_bounds.pyi @@ -13,7 +13,7 @@ def l1_min_c( X: MatrixLike | ArrayLike, y: ArrayLike, *, - loss: Literal["squared_hinge", "log", "squared_hinge"] = "squared_hinge", + loss: Literal["squared_hinge", "log"] = "squared_hinge", fit_intercept: bool = True, intercept_scaling: Float = 1.0, ) -> Float: ... diff --git a/stubs/sklearn/svm/_classes.pyi b/stubs/sklearn/svm/_classes.pyi index b9394c51..5144c41e 100644 --- a/stubs/sklearn/svm/_classes.pyi +++ b/stubs/sklearn/svm/_classes.pyi @@ -12,9 +12,9 @@ from ..utils._param_validation import Interval as Interval, StrOptions as StrOpt from ..utils.multiclass import check_classification_targets as check_classification_targets from ._base import BaseLibSVM, BaseSVC -OneClassSVM_Self = TypeVar("OneClassSVM_Self", bound="OneClassSVM") -LinearSVC_Self = TypeVar("LinearSVC_Self", bound="LinearSVC") -LinearSVR_Self = TypeVar("LinearSVR_Self", bound="LinearSVR") +OneClassSVM_Self = TypeVar("OneClassSVM_Self", bound=OneClassSVM) +LinearSVC_Self = TypeVar("LinearSVC_Self", bound=LinearSVC) +LinearSVR_Self = TypeVar("LinearSVR_Self", bound=LinearSVR) import numpy as np @@ -30,13 +30,13 @@ class LinearSVC(LinearClassifierMixin, SparseCoefMixin, BaseEstimator): def __init__( self, - penalty: Literal["l1", "l2", "l2"] = "l2", - loss: Literal["squared_hinge", "hinge", "squared_hinge"] = "squared_hinge", + penalty: Literal["l1", "l2"] = "l2", + loss: Literal["squared_hinge", "hinge"] = "squared_hinge", *, dual: bool = True, tol: Float = 1e-4, C: Float = 1.0, - multi_class: Literal["ovr", "crammer_singer", "ovr"] = "ovr", + multi_class: Literal["ovr", "crammer_singer"] = "ovr", fit_intercept: bool = True, intercept_scaling: Float = 1, class_weight: None | Mapping | str = None, @@ -66,7 +66,7 @@ class LinearSVR(RegressorMixin, LinearModel): epsilon: Float = 0.0, tol: Float = 1e-4, C: Float = 1.0, - loss: Literal["epsilon_insensitive", "squared_epsilon_insensitive", "epsilon_insensitive"] = "epsilon_insensitive", + loss: Literal["epsilon_insensitive", "squared_epsilon_insensitive"] = "epsilon_insensitive", fit_intercept: bool = True, intercept_scaling: Float = 1.0, dual: bool = True, @@ -104,9 +104,9 @@ class SVC(BaseSVC): self, *, C: Float = 1.0, - kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed", "rbf"] | Callable = "rbf", + kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed"] | Callable = "rbf", degree: Int = 3, - gamma: float | Literal["scale", "auto", "scale"] = "scale", + gamma: float | Literal["scale", "auto"] = "scale", coef0: Float = 0.0, shrinking: bool = True, probability: bool = False, @@ -115,7 +115,7 @@ class SVC(BaseSVC): class_weight: None | Mapping | str = None, verbose: bool = False, max_iter: Int = ..., - decision_function_shape: Literal["ovo", "ovr", "ovr"] = "ovr", + decision_function_shape: Literal["ovo", "ovr"] = "ovr", break_ties: bool = False, random_state: RandomState | None | Int = None, ) -> None: ... @@ -145,9 +145,9 @@ class NuSVC(BaseSVC): self, *, nu: Float = 0.5, - kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed", "rbf"] | Callable = "rbf", + kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed"] | Callable = "rbf", degree: Int = 3, - gamma: float | Literal["scale", "auto", "scale"] = "scale", + gamma: float | Literal["scale", "auto"] = "scale", coef0: Float = 0.0, shrinking: bool = True, probability: bool = False, @@ -156,7 +156,7 @@ class NuSVC(BaseSVC): class_weight: None | Mapping | str = None, verbose: bool = False, max_iter: Int = ..., - decision_function_shape: Literal["ovo", "ovr", "ovr"] = "ovr", + decision_function_shape: Literal["ovo", "ovr"] = "ovr", break_ties: bool = False, random_state: RandomState | None | Int = None, ) -> None: ... @@ -183,9 +183,9 @@ class SVR(RegressorMixin, BaseLibSVM): def __init__( self, *, - kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed", "rbf"] | Callable = "rbf", + kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed"] | Callable = "rbf", degree: Int = 3, - gamma: float | Literal["scale", "auto", "scale"] = "scale", + gamma: float | Literal["scale", "auto"] = "scale", coef0: Float = 0.0, tol: Float = 1e-3, C: Float = 1.0, @@ -197,7 +197,7 @@ class SVR(RegressorMixin, BaseLibSVM): ) -> None: ... # TODO(1.4): Remove - @deprecated("Attribute `class_weight_` was deprecated in version 1.2 and will be removed in 1.4.") # type: ignore + @deprecated(...) # type: ignore @property def class_weight_(self) -> ndarray: ... @@ -225,9 +225,9 @@ class NuSVR(RegressorMixin, BaseLibSVM): *, nu: Float = 0.5, C: Float = 1.0, - kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed", "rbf"] | Callable = "rbf", + kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed"] | Callable = "rbf", degree: Int = 3, - gamma: float | Literal["scale", "auto", "scale"] = "scale", + gamma: float | Literal["scale", "auto"] = "scale", coef0: Float = 0.0, shrinking: bool = True, tol: Float = 1e-3, @@ -237,7 +237,7 @@ class NuSVR(RegressorMixin, BaseLibSVM): ) -> None: ... # TODO(1.4): Remove - @deprecated("Attribute `class_weight_` was deprecated in version 1.2 and will be removed in 1.4.") # type: ignore + @deprecated(...) # type: ignore @property def class_weight_(self) -> ndarray: ... @@ -264,9 +264,9 @@ class OneClassSVM(OutlierMixin, BaseLibSVM): def __init__( self, *, - kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed", "rbf"] | Callable = "rbf", + kernel: Literal["linear", "poly", "rbf", "sigmoid", "precomputed"] | Callable = "rbf", degree: Int = 3, - gamma: float | Literal["scale", "auto", "scale"] = "scale", + gamma: float | Literal["scale", "auto"] = "scale", coef0: Float = 0.0, tol: Float = 1e-3, nu: Float = 0.5, @@ -277,7 +277,7 @@ class OneClassSVM(OutlierMixin, BaseLibSVM): ) -> None: ... # TODO(1.4): Remove - @deprecated("Attribute `class_weight_` was deprecated in version 1.2 and will be removed in 1.4.") # type: ignore + @deprecated(...) # type: ignore @property def class_weight_(self) -> ndarray: ... def fit( diff --git a/stubs/sklearn/tree/_classes.pyi b/stubs/sklearn/tree/_classes.pyi index 52118504..c80ccc1b 100644 --- a/stubs/sklearn/tree/_classes.pyi +++ b/stubs/sklearn/tree/_classes.pyi @@ -30,7 +30,7 @@ from ._tree import ( ccp_pruning_path as ccp_pruning_path, ) -DecisionTreeRegressor_Self = TypeVar("DecisionTreeRegressor_Self", bound="DecisionTreeRegressor") +DecisionTreeRegressor_Self = TypeVar("DecisionTreeRegressor_Self", bound=DecisionTreeRegressor) # Authors: Gilles Louppe # Peter Prettenhofer @@ -134,8 +134,8 @@ class DecisionTreeClassifier(ClassifierMixin, BaseDecisionTree): def __init__( self, *, - criterion: Literal["gini", "entropy", "log_loss", "gini"] = "gini", - splitter: Literal["best", "random", "best"] = "best", + criterion: Literal["gini", "entropy", "log_loss"] = "gini", + splitter: Literal["best", "random"] = "best", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, @@ -170,14 +170,8 @@ class DecisionTreeRegressor(RegressorMixin, BaseDecisionTree): def __init__( self, *, - criterion: Literal[ - "squared_error", - "friedman_mse", - "absolute_error", - "poisson", - "squared_error", - ] = "squared_error", - splitter: Literal["best", "random", "best"] = "best", + criterion: Literal["squared_error", "friedman_mse", "absolute_error", "poisson"] = "squared_error", + splitter: Literal["best", "random"] = "best", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, @@ -209,13 +203,13 @@ class ExtraTreeClassifier(DecisionTreeClassifier): def __init__( self, *, - criterion: Literal["gini", "entropy", "log_loss", "gini"] = "gini", - splitter: Literal["random", "best", "random"] = "random", + criterion: Literal["gini", "entropy", "log_loss"] = "gini", + splitter: Literal["random", "best"] = "random", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, min_weight_fraction_leaf: Float = 0.0, - max_features: float | None | int | Literal["auto", "sqrt", "log2", "sqrt"] = "sqrt", + max_features: float | None | int | Literal["auto", "sqrt", "log2"] = "sqrt", random_state: RandomState | None | Int = None, max_leaf_nodes: None | Int = None, min_impurity_decrease: Float = 0.0, @@ -234,14 +228,8 @@ class ExtraTreeRegressor(DecisionTreeRegressor): def __init__( self, *, - criterion: Literal[ - "squared_error", - "friedman_mse", - "absolute_error", - "poisson", - "squared_error", - ] = "squared_error", - splitter: Literal["random", "best", "random"] = "random", + criterion: Literal["squared_error", "friedman_mse", "absolute_error", "poisson"] = "squared_error", + splitter: Literal["random", "best"] = "random", max_depth: None | Int = None, min_samples_split: float | int = 2, min_samples_leaf: float | int = 1, diff --git a/stubs/sklearn/tree/_export.pyi b/stubs/sklearn/tree/_export.pyi index c384c948..e7fc0a51 100644 --- a/stubs/sklearn/tree/_export.pyi +++ b/stubs/sklearn/tree/_export.pyi @@ -15,7 +15,7 @@ from ._reingold_tilford import buchheim as buchheim from ._tree import Tree class Sentinel: - def __repr__(self) -> str: ... + ... SENTINEL = ... @@ -25,7 +25,7 @@ def plot_tree( max_depth: None | Int = None, feature_names: None | Sequence[str] = None, class_names: Sequence[str | bool] | None = None, - label: Literal["all", "root", "none", "all"] = "all", + label: Literal["all", "root", "none"] = "all", filled: bool = False, impurity: bool = True, node_ids: bool = False, @@ -104,7 +104,7 @@ def export_graphviz( max_depth: None | Int = None, feature_names: None | Sequence[str] = None, class_names: Sequence[str | bool] | None = None, - label: Literal["all", "root", "none", "all"] = "all", + label: Literal["all", "root", "none"] = "all", filled: bool = False, leaves_parallel: bool = False, impurity: bool = True, diff --git a/stubs/sklearn/tree/_reingold_tilford.pyi b/stubs/sklearn/tree/_reingold_tilford.pyi index 976dbcd9..0d6f1fc3 100644 --- a/stubs/sklearn/tree/_reingold_tilford.pyi +++ b/stubs/sklearn/tree/_reingold_tilford.pyi @@ -19,8 +19,6 @@ class DrawTree: lmost_sibling = ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def max_extents(self) -> ndarray: ... def buchheim(tree: Tree) -> DrawTree: ... diff --git a/stubs/sklearn/utils/_mocking.pyi b/stubs/sklearn/utils/_mocking.pyi index 5c09140a..fe84f239 100644 --- a/stubs/sklearn/utils/_mocking.pyi +++ b/stubs/sklearn/utils/_mocking.pyi @@ -6,7 +6,7 @@ from .._typing import ArrayLike, Int, MatrixLike from ..base import BaseEstimator, ClassifierMixin from .validation import check_array as check_array, check_is_fitted as check_is_fitted -CheckingClassifier_Self = TypeVar("CheckingClassifier_Self", bound="CheckingClassifier") +CheckingClassifier_Self = TypeVar("CheckingClassifier_Self", bound=CheckingClassifier) import numpy as np @@ -35,7 +35,7 @@ class CheckingClassifier(ClassifierMixin, BaseEstimator): check_y_params: None | dict = None, check_X: None | Callable = None, check_X_params: None | dict = None, - methods_to_check: Literal["all", "all"] | Sequence[str] = "all", + methods_to_check: Literal["all"] | Sequence[str] = "all", foo_param: Int = 0, expected_sample_weight: None | bool = None, expected_fit_params: None | Sequence[str] = None, diff --git a/stubs/sklearn/utils/_param_validation.pyi b/stubs/sklearn/utils/_param_validation.pyi index 1af70812..0c4b0ef7 100644 --- a/stubs/sklearn/utils/_param_validation.pyi +++ b/stubs/sklearn/utils/_param_validation.pyi @@ -30,30 +30,25 @@ class _Constraint(ABC): class _InstancesOf(_Constraint): def __init__(self, type) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _NoneConstraint(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _NanConstraint(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _PandasNAConstraint(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class Options(_Constraint): def __init__( self, type: Type[str] | Type[type] | Type[Real], - options: set | set[float] | set[str] | set[Type[Float] | Type[Float]], + options: set | set[float] | set[str] | set[Type[Float]], *, deprecated: set | None = None, ) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class StrOptions(Options): def __init__(self, options: set[str], *, deprecated: set[str] | None = None) -> None: ... @@ -69,53 +64,42 @@ class Interval(_Constraint): ) -> None: ... def __contains__(self, val: bool | Float) -> bool: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _ArrayLikes(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _SparseMatrices(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _Callables(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _RandomStates(_Constraint): def __init__(self) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _Booleans(_Constraint): def __init__(self) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _VerboseHelper(_Constraint): def __init__(self) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _MissingValues(_Constraint): def __init__(self) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class HasMethods(_Constraint): def __init__(self, methods: list[str] | str | Sequence[str]) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _IterablesNotString(_Constraint): def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class _CVObjects(_Constraint): def __init__(self) -> None: ... def is_satisfied_by(self, val: Any) -> bool: ... - def __str__(self) -> str: ... class Hidden: def __init__(self, constraint: _Constraint | str) -> None: ... diff --git a/stubs/sklearn/utils/_pprint.pyi b/stubs/sklearn/utils/_pprint.pyi index 356b9b96..ea77fb3a 100644 --- a/stubs/sklearn/utils/_pprint.pyi +++ b/stubs/sklearn/utils/_pprint.pyi @@ -69,7 +69,7 @@ from . import is_scalar_nan as is_scalar_nan # shortened using ellipsis (', ...') at the end. class KeyValTuple(tuple): - def __repr__(self) -> str: ... + ... class KeyValTupleParam(KeyValTuple): ... diff --git a/stubs/sklearn/utils/_testing.pyi b/stubs/sklearn/utils/_testing.pyi index 695a8fa9..98ed7b7d 100644 --- a/stubs/sklearn/utils/_testing.pyi +++ b/stubs/sklearn/utils/_testing.pyi @@ -86,7 +86,6 @@ def ignore_warnings(obj: None | Callable = None, category: Warning = ...) -> _Ig class _IgnoreWarnings: def __init__(self, category: tuple[Warning]) -> None: ... def __call__(self, fn: Callable) -> Callable: ... - def __repr__(self) -> str: ... def __enter__(self) -> None: ... def __exit__(self, *exc_info) -> None: ... diff --git a/stubs/sklearn/utils/extmath.pyi b/stubs/sklearn/utils/extmath.pyi index 3273b9ac..b096f2ba 100644 --- a/stubs/sklearn/utils/extmath.pyi +++ b/stubs/sklearn/utils/extmath.pyi @@ -40,7 +40,7 @@ def randomized_range_finder( *, size: Int, n_iter: Int, - power_iteration_normalizer: Literal["auto", "QR", "LU", "none", "auto"] = "auto", + power_iteration_normalizer: Literal["auto", "QR", "LU", "none"] = "auto", random_state: RandomState | None | Int = None, ) -> ndarray: ... def randomized_svd( @@ -48,12 +48,12 @@ def randomized_svd( n_components: Int, *, n_oversamples: Int = 10, - n_iter: Literal["auto", "auto"] | Int = "auto", - power_iteration_normalizer: Literal["auto", "QR", "LU", "none", "auto"] = "auto", - transpose: Literal["auto", "auto"] | bool = "auto", + n_iter: Literal["auto"] | Int = "auto", + power_iteration_normalizer: Literal["auto", "QR", "LU", "none"] = "auto", + transpose: Literal["auto"] | bool = "auto", flip_sign: bool = True, random_state: RandomState | None | Int = None, - svd_lapack_driver: Literal["gesdd", "gesvd", "gesdd"] = "gesdd", + svd_lapack_driver: Literal["gesdd", "gesvd"] = "gesdd", ) -> tuple[ndarray, ndarray, ndarray]: ... def weighted_mode(a: ArrayLike, w: ArrayLike, *, axis: Int = 0) -> tuple[ndarray, ndarray]: ... def cartesian(arrays: Sequence[ArrayLike] | ArrayLike, out: None | MatrixLike = None) -> ndarray: ... diff --git a/stubs/sklearn/utils/validation.pyi b/stubs/sklearn/utils/validation.pyi index be360ffa..9c5e44a9 100644 --- a/stubs/sklearn/utils/validation.pyi +++ b/stubs/sklearn/utils/validation.pyi @@ -49,7 +49,7 @@ def check_array( accept_sparse: Sequence[str] | tuple[str, str] | list[str] | str | bool = False, *, accept_large_sparse: bool = True, - dtype: None | Sequence[type] | Literal["numeric", "numeric"] | type = "numeric", + dtype: None | Sequence[type] | Literal["numeric"] | type = "numeric", order: Literal["F", "C"] | None = None, copy: bool = False, force_all_finite: str | bool = True, @@ -66,7 +66,7 @@ def check_X_y( accept_sparse: Sequence[str] | tuple[str, str] | list[str] | str | bool = False, *, accept_large_sparse: bool = True, - dtype: None | Sequence[type] | Literal["numeric", "numeric"] | type = "numeric", + dtype: None | Sequence[type] | Literal["numeric"] | type = "numeric", order: Literal["F", "C"] | None = None, copy: bool = False, force_all_finite: str | bool = True, @@ -103,5 +103,5 @@ def check_scalar( *, min_val: None | Float = None, max_val: None | Float = None, - include_boundaries: Literal["left", "right", "both", "neither", "both"] = "both", + include_boundaries: Literal["left", "right", "both", "neither"] = "both", ) -> Number | Float: ... diff --git a/stubs/sympy-stubs/assumptions/cnf.pyi b/stubs/sympy-stubs/assumptions/cnf.pyi index 0618384c..96c957a6 100644 --- a/stubs/sympy-stubs/assumptions/cnf.pyi +++ b/stubs/sympy-stubs/assumptions/cnf.pyi @@ -9,7 +9,6 @@ class Literal: def arg(self): ... def rcall(self, expr) -> Self: ... def __invert__(self) -> Literal: ... - def __str__(self) -> str: ... __repr__ = ... def __eq__(self, other) -> bool: ... @@ -23,7 +22,6 @@ class OR: def __invert__(self) -> AND: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... - def __str__(self) -> str: ... __repr__ = ... @@ -35,7 +33,6 @@ class AND: def rcall(self, expr) -> Self: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... - def __str__(self) -> str: ... __repr__ = ... @@ -45,7 +42,6 @@ def distribute_AND_over_OR(expr) -> CNF | None: ... class CNF: def __init__(self, clauses=...) -> None: ... def add(self, prop) -> None: ... - def __str__(self) -> str: ... def extend(self, props) -> Self: ... def copy(self) -> CNF: ... def add_clauses(self, clauses) -> None: ... diff --git a/stubs/sympy-stubs/categories/diagram_drawing.pyi b/stubs/sympy-stubs/categories/diagram_drawing.pyi index bf8acf73..369f436a 100644 --- a/stubs/sympy-stubs/categories/diagram_drawing.pyi +++ b/stubs/sympy-stubs/categories/diagram_drawing.pyi @@ -26,7 +26,6 @@ class DiagramGrid: def __getitem__(self, i_j): ... @property def morphisms(self) -> dict[Any, Any]: ... - def __str__(self) -> str: ... class ArrowStringDescription: def __init__( @@ -41,7 +40,6 @@ class ArrowStringDescription: label_position, label, ) -> None: ... - def __str__(self) -> str: ... class XypicDiagramDrawer: def __init__(self) -> None: ... diff --git a/stubs/sympy-stubs/combinatorics/coset_table.pyi b/stubs/sympy-stubs/combinatorics/coset_table.pyi index 2b95b99e..4398947e 100644 --- a/stubs/sympy-stubs/combinatorics/coset_table.pyi +++ b/stubs/sympy-stubs/combinatorics/coset_table.pyi @@ -11,7 +11,6 @@ class CosetTable(DefaultPrinting): @property def omega(self) -> list[int]: ... def copy(self) -> Self: ... - def __str__(self) -> str: ... __repr__ = ... @property diff --git a/stubs/sympy-stubs/combinatorics/fp_groups.pyi b/stubs/sympy-stubs/combinatorics/fp_groups.pyi index c4043a8f..829a7835 100644 --- a/stubs/sympy-stubs/combinatorics/fp_groups.pyi +++ b/stubs/sympy-stubs/combinatorics/fp_groups.pyi @@ -33,7 +33,6 @@ class FpGroup(DefaultPrinting): def most_frequent_generator(self): ... def random(self): ... def index(self, H, strategy=...) -> int: ... - def __str__(self) -> str: ... __repr__ = ... def derived_series(self) -> list[Any]: ... @@ -60,7 +59,6 @@ class FpSubgroup(DefaultPrinting): def __contains__(self, g) -> bool: ... def order(self): ... def to_FpGroup(self) -> Any: ... - def __str__(self) -> str: ... __repr__ = ... diff --git a/stubs/sympy-stubs/combinatorics/free_groups.pyi b/stubs/sympy-stubs/combinatorics/free_groups.pyi index ef497073..7e72239e 100644 --- a/stubs/sympy-stubs/combinatorics/free_groups.pyi +++ b/stubs/sympy-stubs/combinatorics/free_groups.pyi @@ -27,7 +27,6 @@ class FreeGroup(DefaultPrinting): def __contains__(self, i) -> Literal[False]: ... def __hash__(self) -> int: ... def __len__(self): ... - def __str__(self) -> str: ... __repr__ = ... def __getitem__(self, index) -> Self: ... @@ -65,7 +64,6 @@ class FreeGroupElement(CantSympify, DefaultPrinting, tuple): @property def ext_rep(self) -> tuple[Any, ...]: ... def __contains__(self, gen) -> bool: ... - def __str__(self) -> str: ... __repr__ = ... def __pow__(self, n) -> Self: ... diff --git a/stubs/sympy-stubs/combinatorics/partitions.pyi b/stubs/sympy-stubs/combinatorics/partitions.pyi index 24cbf3c0..542b1f34 100644 --- a/stubs/sympy-stubs/combinatorics/partitions.pyi +++ b/stubs/sympy-stubs/combinatorics/partitions.pyi @@ -44,7 +44,6 @@ class IntegerPartition(Basic): def __lt__(self, other) -> bool: ... def __le__(self, other) -> bool: ... def as_ferrers(self, char=...) -> LiteralString: ... - def __str__(self) -> str: ... def random_integer_partition(n, seed=...) -> list[Any]: ... def RGS_generalized(m): ... diff --git a/stubs/sympy-stubs/combinatorics/permutations.pyi b/stubs/sympy-stubs/combinatorics/permutations.pyi index 13bac83e..d13b7a74 100644 --- a/stubs/sympy-stubs/combinatorics/permutations.pyi +++ b/stubs/sympy-stubs/combinatorics/permutations.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generator, Literal +from typing import Any, Generator, Iterator, Literal from typing_extensions import Self from sympy.combinatorics.perm_groups import Coset @@ -8,11 +8,9 @@ from sympy.core.numbers import Integer class Cycle(dict): def __missing__(self, arg) -> int: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def __call__(self, *other) -> Cycle: ... def list(self, size=...) -> list[Any]: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __init__(self, *args) -> None: ... @property def size(self) -> Literal[0]: ... @@ -53,7 +51,7 @@ class Permutation(Atom): @classmethod def from_sequence(cls, i, key=...) -> Permutation: ... def __invert__(self) -> Self: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def __repr__(self): ... def __call__(self, *i) -> list[Any] | Coset | Self: ... def atoms(self) -> set[Any]: ... diff --git a/stubs/sympy-stubs/core/containers.pyi b/stubs/sympy-stubs/core/containers.pyi index a35c2ac1..034aef5f 100644 --- a/stubs/sympy-stubs/core/containers.pyi +++ b/stubs/sympy-stubs/core/containers.pyi @@ -52,12 +52,10 @@ class OrderedSet(MutableSet): def add(self, key) -> None: ... def discard(self, key) -> None: ... def pop(self, last=...): ... - def __iter__(self) -> Generator[Any, Any, None]: ... - def __repr__(self) -> str: ... + def __iter__(self) -> Iterator[Any]: ... def intersection(self, other) -> Self: ... def difference(self, other) -> Self: ... def update(self, iterable) -> None: ... class TupleKind(Kind): def __new__(cls, *args) -> Self: ... - def __repr__(self) -> str: ... diff --git a/stubs/sympy-stubs/core/evalf.pyi b/stubs/sympy-stubs/core/evalf.pyi index 643d9910..29f5a3b9 100644 --- a/stubs/sympy-stubs/core/evalf.pyi +++ b/stubs/sympy-stubs/core/evalf.pyi @@ -1,5 +1,5 @@ from typing import Any, Callable, Dict as tDict, List, Optional, Tuple as tTuple, Type, Union as tUnion, overload -from typing_extensions import Self +from typing_extensions import Self, TypeAlias from sympy.concrete.products import Product from sympy.concrete.summations import Sum @@ -26,14 +26,14 @@ DEFAULT_MAXPREC = ... class PrecisionExhausted(ArithmeticError): ... -MPF_TUP = tTuple[int, int, int, int] -TMP_RES = Any -OPT_DICT = tDict[str, Any] +MPF_TUP: TypeAlias = tTuple[int, int, int, int] +TMP_RES: TypeAlias = Any +OPT_DICT: TypeAlias = tDict[str, Any] def fastlog(x: Optional[MPF_TUP]) -> tUnion[int, Any]: ... def pure_complex(v: Expr, or_real=...) -> tuple[Number, Number] | None: ... -SCALED_ZERO_TUP = tTuple[List[int], int, int, int] +SCALED_ZERO_TUP: TypeAlias = tTuple[List[int], int, int, int] @overload def scaled_zero(mag: SCALED_ZERO_TUP, sign=...) -> MPF_TUP: ... diff --git a/stubs/sympy-stubs/core/expr.pyi b/stubs/sympy-stubs/core/expr.pyi index fddb502d..395db89a 100644 --- a/stubs/sympy-stubs/core/expr.pyi +++ b/stubs/sympy-stubs/core/expr.pyi @@ -203,5 +203,4 @@ class ExprBuilder: def build(self, check=...): ... def append_argument(self, arg, check=...) -> None: ... def __getitem__(self, item) -> Any: ... - def __repr__(self) -> str: ... def search_element(self, elem) -> tuple[int] | None: ... diff --git a/stubs/sympy-stubs/core/exprtools.pyi b/stubs/sympy-stubs/core/exprtools.pyi index d1391a6f..730be502 100644 --- a/stubs/sympy-stubs/core/exprtools.pyi +++ b/stubs/sympy-stubs/core/exprtools.pyi @@ -44,7 +44,6 @@ class Term: __slots__ = ... def __init__(self, term, numer=..., denom=...) -> None: ... def __hash__(self) -> int: ... - def __repr__(self) -> str: ... def as_expr(self): ... def mul(self, other) -> Term: ... def inv(self) -> Term: ... diff --git a/stubs/sympy-stubs/core/facts.pyi b/stubs/sympy-stubs/core/facts.pyi index 3ace116c..1df12c5c 100644 --- a/stubs/sympy-stubs/core/facts.pyi +++ b/stubs/sympy-stubs/core/facts.pyi @@ -22,9 +22,8 @@ class FactRules: def print_rules(self) -> Iterator[str]: ... class InconsistentAssumptions(ValueError): - def __str__(self) -> str: ... + ... class FactKB(dict): - def __str__(self) -> str: ... def __init__(self, rules) -> None: ... def deduce_all_facts(self, facts) -> None: ... diff --git a/stubs/sympy-stubs/core/function.pyi b/stubs/sympy-stubs/core/function.pyi index 5704b612..871a3851 100644 --- a/stubs/sympy-stubs/core/function.pyi +++ b/stubs/sympy-stubs/core/function.pyi @@ -17,7 +17,7 @@ from sympy.tensor.array.array_derivatives import ArrayDerivative class PoleError(Exception): ... class ArgumentIndexError(ValueError): - def __str__(self) -> str: ... + ... class BadSignatureError(TypeError): ... class BadArgumentsError(TypeError): ... @@ -35,7 +35,6 @@ class FunctionClass(type): def xreplace(self) -> Callable[..., Any]: ... @property def nargs(self) -> FiniteSet: ... - def __repr__(cls) -> str: ... class Application(Basic, metaclass=FunctionClass): is_Function = ... @@ -125,7 +124,7 @@ class Lambda(Expr): class Subs(Expr): def __new__(cls, expr, variables, point, **assumptions) -> Self: - class CustomStrPrinter(StrPrinter): ... + ... def doit(self, **hints) -> Basic: ... def evalf(self, prec=..., **options): ... diff --git a/stubs/sympy-stubs/core/logic.pyi b/stubs/sympy-stubs/core/logic.pyi index 0583a31e..4f45a183 100644 --- a/stubs/sympy-stubs/core/logic.pyi +++ b/stubs/sympy-stubs/core/logic.pyi @@ -1,7 +1,7 @@ from typing import Any, Optional -from typing_extensions import Self +from typing_extensions import Self, TypeAlias -FuzzyBool = Optional[bool] +FuzzyBool: TypeAlias = Optional[bool] def fuzzy_bool(x) -> bool | None: ... def fuzzy_and(args) -> bool | None: ... @@ -19,7 +19,6 @@ class Logic: def __ne__(self, b) -> bool: ... def __lt__(self, other) -> bool: ... def __cmp__(self, other) -> int: ... - def __str__(self) -> str: ... __repr__ = ... @staticmethod diff --git a/stubs/sympy-stubs/core/sympify.pyi b/stubs/sympy-stubs/core/sympify.pyi index 1be13db6..4a970088 100644 --- a/stubs/sympy-stubs/core/sympify.pyi +++ b/stubs/sympy-stubs/core/sympify.pyi @@ -4,7 +4,6 @@ from sympy.core.basic import Basic class SympifyError(ValueError): def __init__(self, expr, base_exc=...) -> None: ... - def __str__(self) -> str: ... converter: dict[type[Any], Callable[[Any], Basic]] = ... _sympy_converter: dict[type[Any], Callable[[Any], Basic]] = ... diff --git a/stubs/sympy-stubs/crypto/crypto.pyi b/stubs/sympy-stubs/crypto/crypto.pyi index 72be6750..488510df 100644 --- a/stubs/sympy-stubs/crypto/crypto.pyi +++ b/stubs/sympy-stubs/crypto/crypto.pyi @@ -7,7 +7,6 @@ from sympy.matrices import Matrix class NonInvertibleCipherWarning(RuntimeWarning): def __init__(self, msg) -> None: ... - def __str__(self) -> str: ... def warn(self, stacklevel=...) -> None: ... def AZ(s=...) -> LiteralString | str | list[Any | str]: ... diff --git a/stubs/sympy-stubs/external/pythonmpq.pyi b/stubs/sympy-stubs/external/pythonmpq.pyi index 71f4480f..68c8dda2 100644 --- a/stubs/sympy-stubs/external/pythonmpq.pyi +++ b/stubs/sympy-stubs/external/pythonmpq.pyi @@ -14,8 +14,6 @@ class PythonMPQ: def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... def __reduce__(self) -> tuple[type[Self], tuple[Any, Any]]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __lt__(self, other) -> bool: ... def __le__(self, other) -> bool: ... def __gt__(self, other) -> bool: ... diff --git a/stubs/sympy-stubs/functions/elementary/piecewise.pyi b/stubs/sympy-stubs/functions/elementary/piecewise.pyi index 09a9a945..62ca1ec8 100644 --- a/stubs/sympy-stubs/functions/elementary/piecewise.pyi +++ b/stubs/sympy-stubs/functions/elementary/piecewise.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generator +from typing import Any, Generator, Iterator from typing_extensions import Self from sympy.core import Function, Tuple @@ -14,7 +14,7 @@ class ExprCondPair(Tuple): def cond(self) -> Basic: ... @property def is_commutative(self) -> bool | None: ... - def __iter__(self) -> Generator[Basic, Any, None]: ... + def __iter__(self) -> Iterator[Basic]: ... class Piecewise(Function): nargs = ... diff --git a/stubs/sympy-stubs/functions/special/bessel.pyi b/stubs/sympy-stubs/functions/special/bessel.pyi index 7b724c74..be733667 100644 --- a/stubs/sympy-stubs/functions/special/bessel.pyi +++ b/stubs/sympy-stubs/functions/special/bessel.pyi @@ -66,7 +66,7 @@ class hn1(SphericalHankelBase): class hn2(SphericalHankelBase): _hankel_kind_sign = ... -def jn_zeros(n, k, method=..., dps=...) -> list[Any | Float] | list[Any | NDArray[Any, Any] | tuple[Any, Any] | Any]: ... +def jn_zeros(n, k, method=..., dps=...) -> list[Any | Float] | list[Any | NDArray[Any, Any] | tuple[Any, Any]]: ... class AiryBase(Function): def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: ... diff --git a/stubs/sympy-stubs/geometry/entity.pyi b/stubs/sympy-stubs/geometry/entity.pyi index 4b5e3536..f5757499 100644 --- a/stubs/sympy-stubs/geometry/entity.pyi +++ b/stubs/sympy-stubs/geometry/entity.pyi @@ -19,10 +19,8 @@ class GeometryEntity(Basic, EvalfMixin): def __new__(cls, *args, **kwargs) -> Self: ... def __radd__(self, a): ... def __rtruediv__(self, a): ... - def __repr__(self) -> str: ... def __rmul__(self, a): ... def __rsub__(self, a): ... - def __str__(self) -> str: ... @property def ambient_dimension(self): ... @property diff --git a/stubs/sympy-stubs/geometry/polygon.pyi b/stubs/sympy-stubs/geometry/polygon.pyi index 539589f3..f97106bc 100644 --- a/stubs/sympy-stubs/geometry/polygon.pyi +++ b/stubs/sympy-stubs/geometry/polygon.pyi @@ -56,7 +56,6 @@ class RegularPolygon(Polygon): def __new__(cls, c, r, n, rot=..., **kwargs) -> Self: ... @property def args(self) -> tuple[Any, Any, Any, Any]: ... - def __str__(self) -> str: ... def __repr__(self) -> LiteralString: ... @property def area(self): ... diff --git a/stubs/sympy-stubs/holonomic/holonomic.pyi b/stubs/sympy-stubs/holonomic/holonomic.pyi index eec0da5a..777b20bc 100644 --- a/stubs/sympy-stubs/holonomic/holonomic.pyi +++ b/stubs/sympy-stubs/holonomic/holonomic.pyi @@ -7,7 +7,6 @@ def DifferentialOperators(base, generator) -> tuple[DifferentialOperatorAlgebra, class DifferentialOperatorAlgebra: def __init__(self, base, generator) -> None: ... - def __str__(self) -> str: ... __repr__ = ... def __eq__(self, other) -> bool: ... @@ -25,7 +24,6 @@ class DifferentialOperator: def __neg__(self) -> DifferentialOperator | None: ... def __truediv__(self, other): ... def __pow__(self, n) -> Self | DifferentialOperator | None: ... - def __str__(self) -> str: ... __repr__ = ... def __eq__(self, other) -> bool: ... @@ -34,7 +32,6 @@ class DifferentialOperator: class HolonomicFunction: _op_priority = ... def __init__(self, annihilator, x, x0=..., y0=...) -> None: ... - def __str__(self) -> str: ... __repr__ = ... def unify(self, other) -> tuple[Self, Any] | tuple[HolonomicFunction, HolonomicFunction]: ... diff --git a/stubs/sympy-stubs/holonomic/recurrence.pyi b/stubs/sympy-stubs/holonomic/recurrence.pyi index 17c72659..b4fb91fc 100644 --- a/stubs/sympy-stubs/holonomic/recurrence.pyi +++ b/stubs/sympy-stubs/holonomic/recurrence.pyi @@ -4,7 +4,6 @@ def RecurrenceOperators(base, generator) -> tuple[RecurrenceOperatorAlgebra, Rec class RecurrenceOperatorAlgebra: def __init__(self, base, generator) -> None: ... - def __str__(self) -> str: ... __repr__ = ... def __eq__(self, other) -> bool: ... @@ -20,7 +19,6 @@ class RecurrenceOperator: def __sub__(self, other): ... def __rsub__(self, other): ... def __pow__(self, n) -> Self | RecurrenceOperator | None: ... - def __str__(self) -> str: ... __repr__ = ... def __eq__(self, other) -> bool: ... diff --git a/stubs/sympy-stubs/integrals/manualintegrate.pyi b/stubs/sympy-stubs/integrals/manualintegrate.pyi index c73fb174..e4facb88 100644 --- a/stubs/sympy-stubs/integrals/manualintegrate.pyi +++ b/stubs/sympy-stubs/integrals/manualintegrate.pyi @@ -223,7 +223,6 @@ class ArctanRule(AtomicRule): @dataclass class OrthogonalPolyRule(AtomicRule, ABC): n: Expr - ... @dataclass class JacobiRule(OrthogonalPolyRule): @@ -265,7 +264,6 @@ class AssocLaguerreRule(OrthogonalPolyRule): class IRule(AtomicRule, ABC): a: Expr b: Expr - ... @dataclass class CiRule(IRule): @@ -339,7 +337,6 @@ class EllipticERule(AtomicRule): class IntegralInfo(NamedTuple): integrand: Expr symbol: Symbol - ... def manual_diff(f, symbol) -> int | ArrayDerivative | Derivative: ... def manual_subs(expr, *args): ... @@ -362,7 +359,7 @@ _symbol = ... def special_function_rule(integral) -> None: ... def nested_pow_rule(integral: IntegralInfo) -> Rule | None: - class NoMatch(Exception): ... + ... def inverse_trig_rule(integral: IntegralInfo, degenerate=...) -> NestedPowRule | Rule | None: ... def add_rule(integral) -> AddRule | None: ... diff --git a/stubs/sympy-stubs/integrals/risch.pyi b/stubs/sympy-stubs/integrals/risch.pyi index 331c5707..9ab181df 100644 --- a/stubs/sympy-stubs/integrals/risch.pyi +++ b/stubs/sympy-stubs/integrals/risch.pyi @@ -9,8 +9,6 @@ class DifferentialExtension: __slots__ = ... def __init__(self, f=..., x=..., handle_first=..., dummy=..., extension=..., rewrite_complex=...) -> None: ... def __getattr__(self, attr) -> None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __eq__(self, other) -> bool: ... def reset(self) -> None: ... def indices(self, extension) -> list[int]: ... diff --git a/stubs/sympy-stubs/interactive/session.pyi b/stubs/sympy-stubs/interactive/session.pyi index 34dce9c8..4baf99c3 100644 --- a/stubs/sympy-stubs/interactive/session.pyi +++ b/stubs/sympy-stubs/interactive/session.pyi @@ -10,7 +10,7 @@ def enable_automatic_int_sympification(shell) -> None: ... def enable_automatic_symbols(shell) -> None: ... def init_ipython_session(shell=..., argv=..., auto_symbols=..., auto_int_to_Integer=...) -> Any: ... def init_python_session() -> InteractiveConsole: - class SymPyConsole(InteractiveConsole): ... + ... def init_session( ipython=..., diff --git a/stubs/sympy-stubs/matrices/expressions/matexpr.pyi b/stubs/sympy-stubs/matrices/expressions/matexpr.pyi index d50fff95..9a8357fa 100644 --- a/stubs/sympy-stubs/matrices/expressions/matexpr.pyi +++ b/stubs/sympy-stubs/matrices/expressions/matexpr.pyi @@ -148,7 +148,6 @@ class _LeftRightArgs: def second_pointer(self): ... @second_pointer.setter def second_pointer(self, value) -> None: ... - def __repr__(self) -> str: ... def transpose(self) -> Self: ... def build(self) -> list[Any]: ... def matrix_form(self) -> Literal[1]: ... diff --git a/stubs/sympy-stubs/multipledispatch/dispatcher.pyi b/stubs/sympy-stubs/multipledispatch/dispatcher.pyi index 9d96073b..aaea7628 100644 --- a/stubs/sympy-stubs/multipledispatch/dispatcher.pyi +++ b/stubs/sympy-stubs/multipledispatch/dispatcher.pyi @@ -30,7 +30,6 @@ class Dispatcher: def add(self, signature, func, on_ambiguity=...) -> None: ... def reorder(self, on_ambiguity=...) -> None: ... def __call__(self, *args, **kwargs): ... - def __str__(self) -> str: ... __repr__ = ... def dispatch(self, *types) -> None: ... diff --git a/stubs/sympy-stubs/ntheory/generate.pyi b/stubs/sympy-stubs/ntheory/generate.pyi index 7cf088fc..de878ac3 100644 --- a/stubs/sympy-stubs/ntheory/generate.pyi +++ b/stubs/sympy-stubs/ntheory/generate.pyi @@ -1,5 +1,5 @@ from array import array -from typing import Any, Generator, Literal +from typing import Any, Generator, Iterator, Literal from sympy import Function from sympy.core.function import UndefinedFunction @@ -7,7 +7,6 @@ from sympy.utilities.decorator import deprecated class Sieve: def __init__(self) -> None: ... - def __repr__(self) -> str: ... def extend(self, n) -> None: ... def extend_to_no(self, i) -> None: ... def primerange(self, a, b=...) -> Generator[Any, Any, None]: ... @@ -15,7 +14,7 @@ class Sieve: def mobiusrange(self, a, b) -> Generator[int, Any, None]: ... def search(self, n) -> tuple[int, int]: ... def __contains__(self, n) -> bool: ... - def __iter__(self) -> Generator[array[int] | int, Any, None]: ... + def __iter__(self) -> Iterator[array[int] | int]: ... def __getitem__(self, n) -> array[int] | int: ... sieve = ... diff --git a/stubs/sympy-stubs/parsing/sympy_parser.pyi b/stubs/sympy-stubs/parsing/sympy_parser.pyi index 4deb61e5..3b2df798 100644 --- a/stubs/sympy-stubs/parsing/sympy_parser.pyi +++ b/stubs/sympy-stubs/parsing/sympy_parser.pyi @@ -1,10 +1,11 @@ import ast +import typing_extensions from typing import Any, Callable, Dict as tDict, List, Optional, Tuple as tTuple, Union as tUnion null = ... -TOKEN = tTuple[int, str] -DICT = tDict[str, Any] -TRANS = Callable[[List[TOKEN], DICT, DICT], List[TOKEN]] +TOKEN: typing_extensions.TypeAlias = tTuple[int, str] +DICT: typing_extensions.TypeAlias = tDict[str, Any] +TRANS: typing_extensions.TypeAlias = Callable[[List[TOKEN], DICT, DICT], List[TOKEN]] class ParenthesisGroup(List[TOKEN]): ... @@ -12,7 +13,6 @@ class AppliedFunction: def __init__(self, function: TOKEN, args: ParenthesisGroup, exponent=...) -> None: ... def expand(self) -> List[TOKEN]: ... def __getitem__(self, index) -> Any: ... - def __repr__(self) -> str: ... def function_exponentiation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... def split_symbols_custom(predicate: Callable[[str], bool]) -> Callable[..., list[TOKEN]]: ... @@ -58,7 +58,6 @@ transformations = ... class _T: def __init__(self) -> None: ... - def __str__(self) -> str: ... def __getitem__(self, t) -> tuple[Any, ...]: ... T = ... diff --git a/stubs/sympy-stubs/physics/units/dimensions.pyi b/stubs/sympy-stubs/physics/units/dimensions.pyi index 3a92461e..7cfbc1f6 100644 --- a/stubs/sympy-stubs/physics/units/dimensions.pyi +++ b/stubs/sympy-stubs/physics/units/dimensions.pyi @@ -27,7 +27,6 @@ class Dimension(Expr): def name(self): ... @property def symbol(self): ... - def __str__(self) -> str: ... def __repr__(self) -> LiteralString: ... def __neg__(self) -> Self: ... def __add__(self, other) -> Self: ... diff --git a/stubs/sympy-stubs/physics/units/prefixes.pyi b/stubs/sympy-stubs/physics/units/prefixes.pyi index 391e3f06..ebc4bbe3 100644 --- a/stubs/sympy-stubs/physics/units/prefixes.pyi +++ b/stubs/sympy-stubs/physics/units/prefixes.pyi @@ -15,8 +15,6 @@ class Prefix(Expr): def scale_factor(self): ... @property def base(self): ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __mul__(self, other) -> Prefix | Literal[1]: ... def __truediv__(self, other) -> Prefix | Literal[1]: ... def __rtruediv__(self, other) -> Prefix: ... diff --git a/stubs/sympy-stubs/physics/units/unitsystem.pyi b/stubs/sympy-stubs/physics/units/unitsystem.pyi index 95b44c68..3f896068 100644 --- a/stubs/sympy-stubs/physics/units/unitsystem.pyi +++ b/stubs/sympy-stubs/physics/units/unitsystem.pyi @@ -11,8 +11,6 @@ class UnitSystem(_QuantityMapper): def __init__( self, base_units, units=..., name=..., descr=..., dimension_system=..., derived_units: tDict[Dimension, Quantity] = ... ) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def extend( self, base, units=..., name=..., description=..., dimension_system=..., derived_units: tDict[Dimension, Quantity] = ... ) -> UnitSystem: ... diff --git a/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi b/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi index 4f40d131..b11a6fd7 100644 --- a/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi +++ b/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi @@ -7,8 +7,6 @@ class interval: def mid(self) -> float: ... @property def width(self) -> float: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __lt__(self, other) -> bool: ... def __gt__(self, other) -> bool: ... def __eq__(self, other) -> bool: ... diff --git a/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi b/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi index 02663e64..7aeac91e 100644 --- a/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi +++ b/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi @@ -5,7 +5,6 @@ class intervalMembership: def __getitem__(self, i) -> Any: ... def __len__(self) -> Literal[2]: ... def __iter__(self) -> Iterator[Any]: ... - def __str__(self) -> str: ... __repr__ = ... def __and__(self, other) -> intervalMembership: ... diff --git a/stubs/sympy-stubs/plotting/plot.pyi b/stubs/sympy-stubs/plotting/plot.pyi index 85c067ab..57ae47da 100644 --- a/stubs/sympy-stubs/plotting/plot.pyi +++ b/stubs/sympy-stubs/plotting/plot.pyi @@ -33,7 +33,6 @@ class Plot: ) -> None: ... def show(self) -> None: ... def save(self, path) -> None: ... - def __str__(self) -> str: ... def __getitem__(self, index): ... def __setitem__(self, index, *args) -> None: ... def __delitem__(self, index) -> None: ... @@ -44,7 +43,6 @@ class PlotGrid: def __init__(self, nrows, ncolumns, *args, show=..., size=..., **kwargs) -> None: ... def show(self) -> None: ... def save(self, path) -> None: ... - def __str__(self) -> str: ... class BaseSeries: is_2Dline = ... @@ -69,18 +67,15 @@ class Line2DBaseSeries(BaseSeries): class List2DSeries(Line2DBaseSeries): def __init__(self, list_x, list_y) -> None: ... - def __str__(self) -> str: ... def get_points(self) -> tuple[Any, Any]: ... class LineOver1DRangeSeries(Line2DBaseSeries): def __init__(self, expr, var_start_end, **kwargs) -> None: ... - def __str__(self) -> str: ... def get_points(self) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: ... class Parametric2DLineSeries(Line2DBaseSeries): is_parametric = ... def __init__(self, expr_x, expr_y, var_start_end, **kwargs) -> None: ... - def __str__(self) -> str: ... def get_parameter_points(self): ... def get_points(self) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: ... @@ -93,7 +88,6 @@ class Line3DBaseSeries(Line2DBaseSeries): class Parametric3DLineSeries(Line3DBaseSeries): is_parametric = ... def __init__(self, expr_x, expr_y, expr_z, var_start_end, **kwargs) -> None: ... - def __str__(self) -> str: ... def get_parameter_points(self): ... def get_points(self) -> tuple[Any, Any, Any]: ... @@ -104,20 +98,17 @@ class SurfaceBaseSeries(BaseSeries): class SurfaceOver2DRangeSeries(SurfaceBaseSeries): def __init__(self, expr, var_start_end_x, var_start_end_y, **kwargs) -> None: ... - def __str__(self) -> str: ... def get_meshes(self) -> tuple[Any, Any, Any]: ... class ParametricSurfaceSeries(SurfaceBaseSeries): is_parametric = ... def __init__(self, expr_x, expr_y, expr_z, var_start_end_u, var_start_end_v, **kwargs) -> None: ... - def __str__(self) -> str: ... def get_parameter_meshes(self): ... def get_meshes(self) -> tuple[Any, Any, Any]: ... class ContourSeries(BaseSeries): is_contour = ... def __init__(self, expr, var_start_end_x, var_start_end_y) -> None: ... - def __str__(self) -> str: ... def get_meshes(self) -> tuple[Any, Any, Any]: ... class BaseBackend: diff --git a/stubs/sympy-stubs/plotting/plot_implicit.pyi b/stubs/sympy-stubs/plotting/plot_implicit.pyi index 03a13ccf..0120853a 100644 --- a/stubs/sympy-stubs/plotting/plot_implicit.pyi +++ b/stubs/sympy-stubs/plotting/plot_implicit.pyi @@ -8,7 +8,6 @@ class ImplicitSeries(BaseSeries): def __init__( self, expr, var_start_end_x, var_start_end_y, has_equality, use_interval_math, depth, nb_of_points, line_color ) -> None: ... - def __str__(self) -> str: ... def get_raster( self, ) -> ( diff --git a/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi b/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi index 6972a354..a3bef3ec 100644 --- a/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi +++ b/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi @@ -15,4 +15,3 @@ class ColorScheme: def apply_to_curve(self, verts, u_set, set_len=..., inc_pos=...) -> list[Any]: ... def apply_to_surface(self, verts, u_set, v_set, set_len=..., inc_pos=...) -> list[Any]: ... def str_base(self) -> str: ... - def __repr__(self) -> str: ... diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot.pyi index edcafd20..c09f6b48 100644 --- a/stubs/sympy-stubs/plotting/pygletplot/plot.pyi +++ b/stubs/sympy-stubs/plotting/pygletplot/plot.pyi @@ -15,8 +15,6 @@ class PygletPlot: def append(self, *args) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def adjust_all_bounds(self) -> None: ... def wait_for_calculations(self) -> None: ... diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi index b59d5b2f..9b91f8da 100644 --- a/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi @@ -26,8 +26,6 @@ class PlotInterval: def fill_from(self, b) -> None: ... @staticmethod def try_parse(*args) -> PlotInterval | None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... @require_all_args def assert_complete(self) -> None: ... @require_all_args diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi index d1512a2c..3c697d49 100644 --- a/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi @@ -29,5 +29,3 @@ class PlotModeBase(PlotMode): calculating_cverts = ... calculating_cverts_pos = ... calculating_cverts_len = ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... diff --git a/stubs/sympy-stubs/polys/agca/extensions.pyi b/stubs/sympy-stubs/polys/agca/extensions.pyi index 7994647d..69e935cf 100644 --- a/stubs/sympy-stubs/polys/agca/extensions.pyi +++ b/stubs/sympy-stubs/polys/agca/extensions.pyi @@ -34,7 +34,6 @@ class ExtensionElement(DomainElement, DefaultPrinting): # type: ignore def __eq__(self, g) -> bool: ... def __ne__(self, g) -> bool: ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... __repr__ = ... @property @@ -50,7 +49,6 @@ class MonogenicFiniteExtension(Domain): # type: ignore def new(self, arg) -> ExtElem: ... def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... __repr__ = ... def convert(self, f, base=...) -> ExtElem: ... diff --git a/stubs/sympy-stubs/polys/agca/homomorphisms.pyi b/stubs/sympy-stubs/polys/agca/homomorphisms.pyi index a5691601..d5d7b760 100644 --- a/stubs/sympy-stubs/polys/agca/homomorphisms.pyi +++ b/stubs/sympy-stubs/polys/agca/homomorphisms.pyi @@ -25,7 +25,6 @@ class ModuleHomomorphism: class MatrixHomomorphism(ModuleHomomorphism): def __init__(self, domain, codomain, matrix) -> None: ... - def __repr__(self) -> str: ... class FreeModuleHomomorphism(MatrixHomomorphism): ... class SubModuleHomomorphism(MatrixHomomorphism): ... diff --git a/stubs/sympy-stubs/polys/agca/modules.pyi b/stubs/sympy-stubs/polys/agca/modules.pyi index 9715d89b..cf939d10 100644 --- a/stubs/sympy-stubs/polys/agca/modules.pyi +++ b/stubs/sympy-stubs/polys/agca/modules.pyi @@ -54,7 +54,6 @@ class FreeModuleElement(ModuleElement): class FreeModule(Module): dtype = FreeModuleElement def __init__(self, ring, rank) -> None: ... - def __repr__(self) -> str: ... def is_submodule(self, other) -> Literal[False]: ... def convert(self, elem, M=...) -> FreeModuleElement: ... def is_zero(self): ... @@ -69,14 +68,12 @@ class FreeModulePolyRing(FreeModule): class FreeModuleQuotientRing(FreeModule): def __init__(self, ring, rank) -> None: ... - def __repr__(self) -> str: ... def submodule(self, *gens, **opts) -> SubModuleQuotientRing: ... def lift(self, elem): ... def unlift(self, elem) -> FreeModuleElement: ... class SubModule(Module): def __init__(self, gens, container) -> None: ... - def __repr__(self) -> str: ... def convert(self, elem, M=...): ... def intersect(self, other, **options): ... def module_quotient(self, other, **options): ... @@ -117,12 +114,10 @@ class SubModuleQuotientRing(SubModule): class QuotientModuleElement(ModuleElement): def eq(self, d1, d2): ... - def __repr__(self) -> str: ... class QuotientModule(Module): dtype = QuotientModuleElement def __init__(self, ring, base, submodule) -> None: ... - def __repr__(self) -> str: ... def is_zero(self): ... def is_submodule(self, other) -> Literal[False]: ... def submodule(self, *gens, **opts) -> SubQuotientModule: ... diff --git a/stubs/sympy-stubs/polys/domains/algebraicfield.pyi b/stubs/sympy-stubs/polys/domains/algebraicfield.pyi index 8390019e..a0e13fc0 100644 --- a/stubs/sympy-stubs/polys/domains/algebraicfield.pyi +++ b/stubs/sympy-stubs/polys/domains/algebraicfield.pyi @@ -16,7 +16,6 @@ class AlgebraicField(Field, CharacteristicZero, SimpleDomain): has_assoc_Field = ... def __init__(self, dom, *ext, alias=...) -> None: ... def new(self, element) -> dtype: ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... def algebraic_field(self, *extension, alias=...) -> Any: ... diff --git a/stubs/sympy-stubs/polys/domains/domain.pyi b/stubs/sympy-stubs/polys/domains/domain.pyi index 70c4376c..ea38ee57 100644 --- a/stubs/sympy-stubs/polys/domains/domain.pyi +++ b/stubs/sympy-stubs/polys/domains/domain.pyi @@ -31,8 +31,6 @@ class Domain: rep: str | None = ... alias: str | None = ... def __init__(self) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __hash__(self) -> int: ... def new(self, *args): ... @property diff --git a/stubs/sympy-stubs/polys/domains/expressiondomain.pyi b/stubs/sympy-stubs/polys/domains/expressiondomain.pyi index e3085ab8..3ac0e8c7 100644 --- a/stubs/sympy-stubs/polys/domains/expressiondomain.pyi +++ b/stubs/sympy-stubs/polys/domains/expressiondomain.pyi @@ -17,8 +17,6 @@ class ExpressionDomain(Field, CharacteristicZero, SimpleDomain): class Expression(PicklableWithSlots): __slots__ = ... def __init__(self, ex) -> None: ... - def __repr__(f) -> str: ... - def __str__(f) -> str: ... def __hash__(self) -> int: ... def as_expr(f): ... def numer(f) -> Self: ... diff --git a/stubs/sympy-stubs/polys/domains/finitefield.pyi b/stubs/sympy-stubs/polys/domains/finitefield.pyi index 72f4e78f..61ef99bd 100644 --- a/stubs/sympy-stubs/polys/domains/finitefield.pyi +++ b/stubs/sympy-stubs/polys/domains/finitefield.pyi @@ -15,7 +15,6 @@ class FiniteField(Field, SimpleDomain): # type: ignore dom = ... mod = ... def __init__(self, mod, symmetric=...) -> None: ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... def characteristic(self) -> Any | None: ... diff --git a/stubs/sympy-stubs/polys/domains/fractionfield.pyi b/stubs/sympy-stubs/polys/domains/fractionfield.pyi index 8bbdd79b..37081376 100644 --- a/stubs/sympy-stubs/polys/domains/fractionfield.pyi +++ b/stubs/sympy-stubs/polys/domains/fractionfield.pyi @@ -20,7 +20,6 @@ class FractionField(Field, CompositeDomain): @property def is_Exact(self): ... def get_exact(self) -> Any: ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... def to_sympy(self, a): ... diff --git a/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi b/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi index 91deebc4..2a0811ec 100644 --- a/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi +++ b/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi @@ -23,7 +23,6 @@ class GaussianElement(DomainElement): # type: ignore def __pos__(self) -> Self: ... def __neg__(self): ... def __repr__(self) -> LiteralString: ... - def __str__(self) -> str: ... def __add__(self, other) -> NotImplementedType: ... __radd__ = ... diff --git a/stubs/sympy-stubs/polys/domains/modularinteger.pyi b/stubs/sympy-stubs/polys/domains/modularinteger.pyi index 87535724..f2b1c882 100644 --- a/stubs/sympy-stubs/polys/domains/modularinteger.pyi +++ b/stubs/sympy-stubs/polys/domains/modularinteger.pyi @@ -13,7 +13,6 @@ class ModularInteger(PicklableWithSlots, DomainElement): def __init__(self, val) -> None: ... def __hash__(self) -> int: ... def __repr__(self) -> LiteralString: ... - def __str__(self) -> str: ... def __int__(self) -> int: ... def to_int(self): ... def __pos__(self) -> Self: ... diff --git a/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi b/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi index 85f88fd5..8a85a77d 100644 --- a/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi +++ b/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi @@ -12,7 +12,6 @@ class FractionField(Field, CharacteristicZero, CompositeDomain): has_assoc_Field = ... def __init__(self, dom, *gens) -> None: ... def new(self, element) -> dtype: ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... def to_sympy(self, a): ... diff --git a/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi b/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi index 42b33945..54201867 100644 --- a/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi +++ b/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi @@ -14,7 +14,6 @@ class PolynomialRingBase(Ring, CharacteristicZero, CompositeDomain): default_order = ... def __init__(self, dom, *gens, **opts) -> None: ... def new(self, element): ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... def from_ZZ(K1, a, K0): ... diff --git a/stubs/sympy-stubs/polys/domains/polynomialring.pyi b/stubs/sympy-stubs/polys/domains/polynomialring.pyi index a859eb2f..15b43b0f 100644 --- a/stubs/sympy-stubs/polys/domains/polynomialring.pyi +++ b/stubs/sympy-stubs/polys/domains/polynomialring.pyi @@ -17,7 +17,6 @@ class PolynomialRing(Ring, CompositeDomain): def one(self): ... @property def order(self): ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __eq__(self, other) -> bool: ... def is_unit(self, a) -> Literal[False]: ... diff --git a/stubs/sympy-stubs/polys/domains/quotientring.pyi b/stubs/sympy-stubs/polys/domains/quotientring.pyi index 42113c6c..482c5136 100644 --- a/stubs/sympy-stubs/polys/domains/quotientring.pyi +++ b/stubs/sympy-stubs/polys/domains/quotientring.pyi @@ -7,7 +7,6 @@ from sympy.utilities import public class QuotientRingElement: def __init__(self, ring, data) -> None: ... - def __str__(self) -> str: ... __repr__ = ... def __bool__(self) -> bool: ... @@ -31,7 +30,6 @@ class QuotientRing(Ring): has_assoc_Field = ... dtype = ... def __init__(self, ring, ideal) -> None: ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def new(self, a) -> Any: ... def __eq__(self, other) -> bool: ... diff --git a/stubs/sympy-stubs/polys/matrices/ddm.pyi b/stubs/sympy-stubs/polys/matrices/ddm.pyi index 65d5fd8c..787147c1 100644 --- a/stubs/sympy-stubs/polys/matrices/ddm.pyi +++ b/stubs/sympy-stubs/polys/matrices/ddm.pyi @@ -20,8 +20,6 @@ class DDM(list): def to_ddm(self) -> Self: ... def to_sdm(self) -> SDM: ... def convert_to(self, K) -> DDM: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... @classmethod diff --git a/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi b/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi index c72e5781..450e601c 100644 --- a/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi +++ b/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi @@ -43,7 +43,6 @@ class DomainMatrix: def to_list(self) -> list[Any]: ... def to_list_flat(self) -> list[Any]: ... def to_dok(self) -> dict[tuple[int, int], Any] | dict[tuple[Any, Any], Any]: ... - def __repr__(self) -> str: ... def transpose(self) -> Self: ... def flat(self) -> list[Any]: ... @property diff --git a/stubs/sympy-stubs/polys/matrices/domainscalar.pyi b/stubs/sympy-stubs/polys/matrices/domainscalar.pyi index 3d019366..aab75eac 100644 --- a/stubs/sympy-stubs/polys/matrices/domainscalar.pyi +++ b/stubs/sympy-stubs/polys/matrices/domainscalar.pyi @@ -6,7 +6,6 @@ class DomainScalar: def __new__(cls, element, domain) -> Self: ... @classmethod def new(cls, element, domain) -> Self: ... - def __repr__(self) -> str: ... @classmethod def from_sympy(cls, expr) -> Self: ... def to_sympy(self): ... diff --git a/stubs/sympy-stubs/polys/matrices/sdm.pyi b/stubs/sympy-stubs/polys/matrices/sdm.pyi index 6eefb38e..6fd89d6f 100644 --- a/stubs/sympy-stubs/polys/matrices/sdm.pyi +++ b/stubs/sympy-stubs/polys/matrices/sdm.pyi @@ -11,8 +11,6 @@ class SDM(dict): def setitem(self, i, j, value) -> None: ... def extract_slice(self, slice1, slice2) -> Self: ... def extract(self, rows, cols) -> Self: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... @classmethod def new(cls, sdm, shape, domain) -> Self: ... def copy(A) -> Self: ... diff --git a/stubs/sympy-stubs/polys/monomials.pyi b/stubs/sympy-stubs/polys/monomials.pyi index 67fc3c58..0266cb9e 100644 --- a/stubs/sympy-stubs/polys/monomials.pyi +++ b/stubs/sympy-stubs/polys/monomials.pyi @@ -39,7 +39,6 @@ class Monomial(PicklableWithSlots): def __iter__(self) -> Iterator[int]: ... def __getitem__(self, item): ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... def as_expr(self, *gens) -> Order: ... def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... diff --git a/stubs/sympy-stubs/polys/numberfields/modules.pyi b/stubs/sympy-stubs/polys/numberfields/modules.pyi index 97aa1edd..f1b0156c 100644 --- a/stubs/sympy-stubs/polys/numberfields/modules.pyi +++ b/stubs/sympy-stubs/polys/numberfields/modules.pyi @@ -36,7 +36,6 @@ class PowerBasis(Module): def __init__(self, T) -> None: ... @property def number_field(self) -> Any | None: ... - def __repr__(self) -> str: ... def __eq__(self, other) -> bool: ... @property def n(self): ... @@ -51,7 +50,6 @@ class PowerBasis(Module): class Submodule(Module, IntegerPowerable): def __init__(self, parent, matrix, denom=..., mult_tab=...) -> None: ... - def __repr__(self) -> str: ... def reduced(self) -> Self: ... def discard_before(self, r) -> Submodule: ... @property @@ -91,7 +89,6 @@ def make_mod_elt(module, col, denom=...) -> PowerBasisElement | ModuleElement: . class ModuleElement(IntegerPowerable): def __init__(self, module, col, denom=...) -> None: ... - def __repr__(self) -> str: ... def reduced(self) -> Self: ... def reduced_mod_p(self, p) -> PowerBasisElement | ModuleElement: ... @classmethod diff --git a/stubs/sympy-stubs/polys/numberfields/primes.pyi b/stubs/sympy-stubs/polys/numberfields/primes.pyi index 72b854ce..66e5b68e 100644 --- a/stubs/sympy-stubs/polys/numberfields/primes.pyi +++ b/stubs/sympy-stubs/polys/numberfields/primes.pyi @@ -5,11 +5,9 @@ from sympy.utilities.decorator import public class PrimeIdeal(IntegerPowerable): def __init__(self, ZK, p, alpha, f, e=...) -> None: ... - def __str__(self) -> str: ... @property def is_inert(self): ... def repr(self, field_gen=..., just_gens=...) -> str: ... - def __repr__(self) -> str: ... def as_submodule(self): ... def __eq__(self, other) -> bool: ... def __add__(self, other): ... diff --git a/stubs/sympy-stubs/polys/orderings.pyi b/stubs/sympy-stubs/polys/orderings.pyi index a0eb5522..8b64f602 100644 --- a/stubs/sympy-stubs/polys/orderings.pyi +++ b/stubs/sympy-stubs/polys/orderings.pyi @@ -6,8 +6,6 @@ class MonomialOrder: alias: str | None = ... is_global: bool | None = ... is_default = ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __call__(self, monomial): ... def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... @@ -32,8 +30,6 @@ class ReversedGradedLexOrder(MonomialOrder): class ProductOrder(MonomialOrder): def __init__(self, *args) -> None: ... def __call__(self, monomial) -> tuple[Any, ...]: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... @property @@ -41,7 +37,6 @@ class ProductOrder(MonomialOrder): class InverseOrder(MonomialOrder): def __init__(self, O) -> None: ... - def __str__(self) -> str: ... def __call__(self, monomial) -> tuple[Any, ...]: ... @property def is_global(self) -> bool | None: ... diff --git a/stubs/sympy-stubs/polys/polyclasses.pyi b/stubs/sympy-stubs/polys/polyclasses.pyi index c001c44f..93761b80 100644 --- a/stubs/sympy-stubs/polys/polyclasses.pyi +++ b/stubs/sympy-stubs/polys/polyclasses.pyi @@ -17,7 +17,6 @@ def init_normal_DMP(rep, lev, dom) -> DMP: ... class DMP(PicklableWithSlots, CantSympify): __slots__ = ... def __init__(self, rep, dom, lev=..., ring=...) -> None: ... - def __repr__(f) -> str: ... def __hash__(f) -> int: ... def unify( f, g @@ -135,9 +134,8 @@ class DMP(PicklableWithSlots, CantSympify): list[Any] | list[tuple[tuple[Any, Any], Any, Any] | tuple[Any, Any]] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] - | list[Any] | tuple[list[tuple[tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]], Any]], list[tuple[tuple[Any, Any], Any]]] - | tuple[list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[Any], Any] + | tuple[list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]], Any] ): ... def refine_root( f, s, t, eps=..., steps=..., fast=... @@ -199,7 +197,6 @@ class DMF(PicklableWithSlots, CantSympify): def __init__(self, rep, dom, lev=..., ring=...) -> None: ... @classmethod def new(cls, rep, dom, lev=..., ring=...) -> Self: ... - def __repr__(f) -> str: ... def __hash__(f) -> int: ... def poly_unify( f, g @@ -266,7 +263,6 @@ def init_normal_ANP(rep, mod, dom) -> ANP: ... class ANP(PicklableWithSlots, CantSympify): __slots__ = ... def __init__(self, rep, mod, dom) -> None: ... - def __repr__(f) -> str: ... def __hash__(f) -> int: ... def unify( f, g diff --git a/stubs/sympy-stubs/polys/polyerrors.pyi b/stubs/sympy-stubs/polys/polyerrors.pyi index 449fe7f9..4de08fa2 100644 --- a/stubs/sympy-stubs/polys/polyerrors.pyi +++ b/stubs/sympy-stubs/polys/polyerrors.pyi @@ -9,18 +9,15 @@ class BasePolynomialError(Exception): @public class ExactQuotientFailed(BasePolynomialError): def __init__(self, f, g, dom=...) -> None: ... - def __str__(self) -> str: ... def new(self, f, g) -> Self: ... @public class PolynomialDivisionFailed(BasePolynomialError): def __init__(self, f, g, domain) -> None: ... - def __str__(self) -> str: ... @public class OperationNotSupported(BasePolynomialError): def __init__(self, poly, func) -> None: ... - def __str__(self) -> str: ... @public class HeuristicGCDFailed(BasePolynomialError): ... @@ -74,7 +71,6 @@ class GeneratorsNeeded(GeneratorsError): ... @public class ComputationFailed(BasePolynomialError): def __init__(self, func, nargs, exc) -> None: ... - def __str__(self) -> str: ... @public class UnivariatePolynomialError(PolynomialError): ... @@ -85,7 +81,6 @@ class MultivariatePolynomialError(PolynomialError): ... @public class PolificationFailed(PolynomialError): def __init__(self, opt, origs, exprs, seq=...) -> None: ... - def __str__(self) -> str: ... @public class OptionError(BasePolynomialError): ... diff --git a/stubs/sympy-stubs/polys/polymatrix.pyi b/stubs/sympy-stubs/polys/polymatrix.pyi index f4c9ddee..d1f262e1 100644 --- a/stubs/sympy-stubs/polys/polymatrix.pyi +++ b/stubs/sympy-stubs/polys/polymatrix.pyi @@ -12,7 +12,6 @@ class MutablePolyDenseMatrix: @classmethod def from_Matrix(cls, other, *gens, ring=...) -> Self: ... def set_gens(self, gens) -> Self: ... - def __repr__(self) -> str: ... @property def shape(self): ... @property diff --git a/stubs/sympy-stubs/printing/mathml.pyi b/stubs/sympy-stubs/printing/mathml.pyi index 47fd9cf4..ee2938df 100644 --- a/stubs/sympy-stubs/printing/mathml.pyi +++ b/stubs/sympy-stubs/printing/mathml.pyi @@ -6,7 +6,7 @@ from sympy.printing.printer import Printer, print_function class MathMLPrinterBase(Printer): _default_settings: dict[str, Any] = ... def __init__(self, settings=...) -> None: - class RawText(Text): ... + ... def doprint(self, expr): ... def apply_patch(self) -> None: ... diff --git a/stubs/sympy-stubs/printing/pretty/stringpict.pyi b/stubs/sympy-stubs/printing/pretty/stringpict.pyi index d7792dc0..024e99aa 100644 --- a/stubs/sympy-stubs/printing/pretty/stringpict.pyi +++ b/stubs/sympy-stubs/printing/pretty/stringpict.pyi @@ -23,8 +23,6 @@ class stringPict: def terminal_width(self) -> Any | Literal[0]: ... def __eq__(self, o) -> bool: ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __getitem__(self, index): ... def __len__(self) -> int: ... @@ -35,7 +33,6 @@ class prettyForm(stringPict): def __add__(self, *others) -> prettyForm: ... def __truediv__(self, den, slashed=...) -> prettyForm: ... def __mul__(self, *others) -> Self | prettyForm: ... - def __repr__(self) -> str: ... def __pow__(self, b) -> prettyForm: ... simpleFunctions = ... diff --git a/stubs/sympy-stubs/printing/tableform.pyi b/stubs/sympy-stubs/printing/tableform.pyi index c70d10a3..a5915a50 100644 --- a/stubs/sympy-stubs/printing/tableform.pyi +++ b/stubs/sympy-stubs/printing/tableform.pyi @@ -3,7 +3,6 @@ from sympy.matrices import Matrix class TableForm: def __init__(self, data, **kwarg) -> None: ... def __repr__(self): ... - def __str__(self) -> str: ... def as_matrix(self) -> Matrix: ... def as_str(self) -> str: ... def as_latex(self): ... diff --git a/stubs/sympy-stubs/series/gruntz.pyi b/stubs/sympy-stubs/series/gruntz.pyi index 88e96228..40d19490 100644 --- a/stubs/sympy-stubs/series/gruntz.pyi +++ b/stubs/sympy-stubs/series/gruntz.pyi @@ -11,7 +11,6 @@ def compare(a, b, x) -> Literal["<", ">", "="]: ... class SubsSet(dict): def __init__(self) -> None: ... - def __repr__(self) -> str: ... def __getitem__(self, key): ... def do_subs(self, e): ... def meets(self, s2) -> bool: ... @@ -49,7 +48,7 @@ def calculate_series(e, x, logx=...) -> bool | Basic: ... @cacheit def mrv_leadterm(e, x) -> tuple[Any, Any] | tuple[Basic | Any | type[UndefinedFunction] | Literal[1], Any]: ... def build_expression_tree(Omega, rewrites) -> dict[Any, Any]: - class Node: ... + ... @debug @timeit diff --git a/stubs/sympy-stubs/series/sequences.pyi b/stubs/sympy-stubs/series/sequences.pyi index 7a0124f0..a8134147 100644 --- a/stubs/sympy-stubs/series/sequences.pyi +++ b/stubs/sympy-stubs/series/sequences.pyi @@ -39,7 +39,7 @@ class SeqBase(Basic): def __mul__(self, other) -> SeqMul: ... @call_highest_priority("__mul__") def __rmul__(self, other): ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def __getitem__(self, index) -> list[Any] | None: ... def find_linear_recurrence(self, n, d=..., gfvar=...) -> list[Any] | tuple[list[Any], None] | tuple[Any | list[Any], Any]: ... diff --git a/stubs/sympy-stubs/series/series_class.pyi b/stubs/sympy-stubs/series/series_class.pyi index dc1d9ee5..3208a888 100644 --- a/stubs/sympy-stubs/series/series_class.pyi +++ b/stubs/sympy-stubs/series/series_class.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generator +from typing import Any, Generator, Iterator from sympy.core.basic import Basic from sympy.core.cache import cacheit @@ -19,5 +19,5 @@ class SeriesBase(Expr): def free_symbols(self) -> set[Basic]: ... @cacheit def term(self, pt): ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def __getitem__(self, index) -> list[Any] | None: ... diff --git a/stubs/sympy-stubs/sets/fancysets.pyi b/stubs/sympy-stubs/sets/fancysets.pyi index 87dc58b2..22cdfa43 100644 --- a/stubs/sympy-stubs/sets/fancysets.pyi +++ b/stubs/sympy-stubs/sets/fancysets.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generator, Literal, NoReturn +from typing import Any, Generator, Iterator, Literal, NoReturn from typing_extensions import Self from sympy.core.basic import Basic @@ -55,7 +55,7 @@ class ImageSet(Set): def base_set(self) -> Any | FiniteSet | ProductSet: ... @property def base_pset(self) -> FiniteSet | ProductSet: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... @property def is_iterable(self) -> bool: ... def doit(self, **hints) -> Any | FiniteSet | Self: ... @@ -68,7 +68,7 @@ class Range(Set): step = ... @property def reversed(self) -> Self: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... @property def is_iterable(self) -> bool: ... def __len__(self) -> int: ... diff --git a/stubs/sympy-stubs/sets/ordinals.pyi b/stubs/sympy-stubs/sets/ordinals.pyi index 5ee7dd1e..7876a303 100644 --- a/stubs/sympy-stubs/sets/ordinals.pyi +++ b/stubs/sympy-stubs/sets/ordinals.pyi @@ -36,7 +36,6 @@ class Ordinal(Basic): def __le__(self, other) -> bool: ... def __gt__(self, other) -> bool: ... def __ge__(self, other) -> bool: ... - def __str__(self) -> str: ... __repr__ = ... def __add__(self, other) -> NotImplementedType | Self | Ordinal: ... diff --git a/stubs/sympy-stubs/sets/powerset.pyi b/stubs/sympy-stubs/sets/powerset.pyi index b81c5349..8ff03c48 100644 --- a/stubs/sympy-stubs/sets/powerset.pyi +++ b/stubs/sympy-stubs/sets/powerset.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generator +from typing import Any, Generator, Iterator from typing_extensions import Self from sympy.core.basic import Basic @@ -9,6 +9,6 @@ class PowerSet(Set): @property def arg(self) -> Basic: ... def __len__(self) -> Any: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... @property def kind(self) -> SetKind: ... diff --git a/stubs/sympy-stubs/sets/sets.pyi b/stubs/sympy-stubs/sets/sets.pyi index 7161e86f..5ade7de3 100644 --- a/stubs/sympy-stubs/sets/sets.pyi +++ b/stubs/sympy-stubs/sets/sets.pyi @@ -93,7 +93,7 @@ class ProductSet(Set): def as_relational(self, *symbols) -> And: ... @property def is_iterable(self) -> bool: ... - def __iter__(self) -> Generator[tuple[()] | tuple[Any] | tuple[Any, Any] | Any, Any, None]: ... + def __iter__(self) -> Iterator[tuple[()] | tuple[Any] | tuple[Any, Any] | Any]: ... @property def is_empty(self) -> bool | None: ... @property @@ -150,7 +150,7 @@ class Union(Set, LatticeOp): def as_relational(self, symbol) -> And | Or: ... @property def is_iterable(self) -> bool: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... class Intersection(Set, LatticeOp): is_Intersection = ... @@ -165,7 +165,7 @@ class Intersection(Set, LatticeOp): def is_iterable(self) -> bool: ... @property def is_finite_set(self) -> Literal[True] | None: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def as_relational(self, symbol) -> And: ... class Complement(Set): @@ -178,7 +178,7 @@ class Complement(Set): def is_iterable(self) -> Literal[True] | None: ... @property def is_finite_set(self) -> bool | None: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... class EmptySet(Set, metaclass=Singleton): is_empty = ... @@ -224,7 +224,7 @@ class SymmetricDifference(Set): def as_relational(self, symbol) -> BooleanFalse | Not | Xor: ... @property def is_iterable(self) -> Literal[True] | None: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... class DisjointUnion(Set): def __new__(cls, *sets) -> Self: ... @@ -236,7 +236,7 @@ class DisjointUnion(Set): def is_finite_set(self) -> bool | None: ... @property def is_iterable(self) -> bool: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def __len__(self) -> int: ... def imageset(*args) -> Basic | ImageSet | FiniteSet: ... diff --git a/stubs/sympy-stubs/simplify/cse_main.pyi b/stubs/sympy-stubs/simplify/cse_main.pyi index f2586e70..1e4a2aea 100644 --- a/stubs/sympy-stubs/simplify/cse_main.pyi +++ b/stubs/sympy-stubs/simplify/cse_main.pyi @@ -22,7 +22,6 @@ class FuncArgTracker: class Unevaluated: def __init__(self, func, args) -> None: ... - def __str__(self) -> str: ... def as_unevaluated_basic(self): ... @property def free_symbols(self) -> set[Any]: ... diff --git a/stubs/sympy-stubs/simplify/epathtools.pyi b/stubs/sympy-stubs/simplify/epathtools.pyi index 90450fac..22be197f 100644 --- a/stubs/sympy-stubs/simplify/epathtools.pyi +++ b/stubs/sympy-stubs/simplify/epathtools.pyi @@ -6,7 +6,6 @@ from sympy.core.basic import Basic class EPath: __slots__ = ... def __new__(cls, path) -> EPath | Self: ... - def __repr__(self) -> str: ... def apply(self, expr, func, args=..., kwargs=...) -> Basic: ... def select(self, expr) -> list[Any]: ... diff --git a/stubs/sympy-stubs/simplify/hyperexpand.pyi b/stubs/sympy-stubs/simplify/hyperexpand.pyi index 7413afa0..e6d0c64f 100644 --- a/stubs/sympy-stubs/simplify/hyperexpand.pyi +++ b/stubs/sympy-stubs/simplify/hyperexpand.pyi @@ -60,51 +60,39 @@ class MultOperator(Operator): class ShiftA(Operator): def __init__(self, ai) -> None: ... - def __str__(self) -> str: ... class ShiftB(Operator): def __init__(self, bi) -> None: ... - def __str__(self) -> str: ... class UnShiftA(Operator): def __init__(self, ap, bq, i, z) -> None: ... - def __str__(self) -> str: ... class UnShiftB(Operator): def __init__(self, ap, bq, i, z) -> None: ... - def __str__(self) -> str: ... class MeijerShiftA(Operator): def __init__(self, bi) -> None: ... - def __str__(self) -> str: ... class MeijerShiftB(Operator): def __init__(self, bi) -> None: ... - def __str__(self) -> str: ... class MeijerShiftC(Operator): def __init__(self, bi) -> None: ... - def __str__(self) -> str: ... class MeijerShiftD(Operator): def __init__(self, bi) -> None: ... - def __str__(self) -> str: ... class MeijerUnShiftA(Operator): def __init__(self, an, ap, bm, bq, i, z) -> None: ... - def __str__(self) -> str: ... class MeijerUnShiftB(Operator): def __init__(self, an, ap, bm, bq, i, z) -> None: ... - def __str__(self) -> str: ... class MeijerUnShiftC(Operator): def __init__(self, an, ap, bm, bq, i, z) -> None: ... - def __str__(self) -> str: ... class MeijerUnShiftD(Operator): def __init__(self, an, ap, bm, bq, i, z) -> None: ... - def __str__(self) -> str: ... class ReduceOrder(Operator): def __new__(cls, ai, bj) -> Self | None: ... @@ -112,7 +100,6 @@ class ReduceOrder(Operator): def meijer_minus(cls, b, a) -> Self | None: ... @classmethod def meijer_plus(cls, a, b) -> Self | None: ... - def __str__(self) -> str: ... def reduce_order(func) -> tuple[Hyper_Function, list[Any]]: ... def reduce_order_meijer(func) -> tuple[G_Function, list[Any]]: ... diff --git a/stubs/sympy-stubs/stats/frv.pyi b/stubs/sympy-stubs/stats/frv.pyi index 1c598f3b..33da0c20 100644 --- a/stubs/sympy-stubs/stats/frv.pyi +++ b/stubs/sympy-stubs/stats/frv.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Generator, Literal +from typing import Any, Dict, Generator, Iterator, Literal from typing_extensions import Self from sympy import Basic, Equality, FiniteSet, Ne, Piecewise, Sum @@ -48,18 +48,18 @@ class SingleFiniteDomain(FiniteDomain): def set(self) -> Basic: ... @property def elements(self) -> FiniteSet: ... - def __iter__(self) -> Generator[frozenset[tuple[Basic, Any]], None, None]: ... + def __iter__(self) -> Iterator[frozenset[tuple[Basic, Any]]]: ... def __contains__(self, other) -> bool: ... class ProductFiniteDomain(ProductDomain, FiniteDomain): - def __iter__(self) -> Generator[frozenset[Any], None, None]: ... + def __iter__(self) -> Iterator[frozenset[Any]]: ... @property def elements(self) -> FiniteSet: ... class ConditionalFiniteDomain(ConditionalDomain, ProductFiniteDomain): def __new__(cls, domain, condition) -> Self: ... def __contains__(self, other) -> Basic | Literal[False]: ... - def __iter__(self) -> Generator[Any, None, None]: ... + def __iter__(self) -> Iterator[Any]: ... @property def set(self) -> FiniteSet: ... def as_boolean(self) -> Or: ... diff --git a/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi b/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi index 4a30f77d..a4da7e31 100644 --- a/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi +++ b/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi @@ -31,7 +31,7 @@ scipy = ... def do_sample_scipy(dist, size, seed) -> None | int: ... @do_sample_scipy.register(SingleContinuousDistribution) def _(dist: SingleContinuousDistribution, size, seed) -> int: - class scipy_pdf(scipy.stats.rv_continuous): ... + ... @do_sample_scipy.register(ChiSquaredDistribution) def _(dist: ChiSquaredDistribution, size, seed): ... @@ -55,7 +55,7 @@ def _(dist: BetaDistribution, size, seed): ... def _(dist: CauchyDistribution, size, seed): ... @do_sample_scipy.register(DiscreteDistributionHandmade) def _(dist: DiscreteDistributionHandmade, size, seed) -> int: - class scipy_pmf: ... + ... @do_sample_scipy.register(GeometricDistribution) def _(dist: GeometricDistribution, size, seed): ... diff --git a/stubs/sympy-stubs/tensor/array/array_comprehension.pyi b/stubs/sympy-stubs/tensor/array/array_comprehension.pyi index db673f02..8f60d072 100644 --- a/stubs/sympy-stubs/tensor/array/array_comprehension.pyi +++ b/stubs/sympy-stubs/tensor/array/array_comprehension.pyi @@ -33,4 +33,4 @@ class ArrayComprehensionMap(ArrayComprehension): def __new__(cls, function, *symbols, **assumptions) -> Self: ... @property def func(self) -> type[Any]: - class _(ArrayComprehensionMap): ... + ... diff --git a/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi b/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi index b31102c0..5e8d2173 100644 --- a/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi +++ b/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi @@ -149,16 +149,14 @@ class Reshape(_CodegenArrayAbstract): class _ArgE: indices: List[Optional[int]] def __init__(self, element, indices: Optional[List[Optional[int]]] = ...) -> None: ... - def __str__(self) -> str: ... __repr__ = ... class _IndPos: def __init__(self, arg: int, rel: int) -> None: ... - def __str__(self) -> str: ... __repr__ = ... - def __iter__(self) -> Generator[int, Any, None]: ... + def __iter__(self) -> typing.Iterator[int]: ... class _EditArrayContraction: def __init__(self, base_array: typing.Union[ArrayContraction, ArrayDiagonal, ArrayTensorProduct]) -> None: ... diff --git a/stubs/sympy-stubs/tensor/array/ndim_array.pyi b/stubs/sympy-stubs/tensor/array/ndim_array.pyi index 23d6de47..e1f197b2 100644 --- a/stubs/sympy-stubs/tensor/array/ndim_array.pyi +++ b/stubs/sympy-stubs/tensor/array/ndim_array.pyi @@ -1,5 +1,5 @@ from types import NotImplementedType -from typing import Any, Generator +from typing import Any, Generator, Iterator from typing_extensions import Self from sympy import ImmutableDenseNDimArray, ImmutableSparseNDimArray @@ -33,7 +33,7 @@ class NDimArray(Printable): def __truediv__(self, other) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: ... def __rtruediv__(self, other): ... def __neg__(self) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: ... - def __iter__(self) -> Generator[Any, Any, None]: ... + def __iter__(self) -> Iterator[Any]: ... def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... def transpose( diff --git a/stubs/sympy-stubs/tensor/tensor.pyi b/stubs/sympy-stubs/tensor/tensor.pyi index 8cb21406..3309b5ec 100644 --- a/stubs/sympy-stubs/tensor/tensor.pyi +++ b/stubs/sympy-stubs/tensor/tensor.pyi @@ -33,7 +33,6 @@ class _IndexStructure(CantSympify): @staticmethod def generate_indices_from_free_dum_index_types(free, dum, index_types) -> list[Any]: ... def get_free_indices(self) -> list[TensorIndex]: ... - def __str__(self) -> str: ... def __repr__(self) -> LiteralString: ... def perm2tensor(self, g, is_canon_bp=...) -> _IndexStructure: ... def indices_canon_args(self) -> tuple[Perm, list[Any], list[Any]]: ... @@ -104,7 +103,6 @@ class TensorIndexType(Basic): def epsilon(self) -> TensorHead | None: ... def set_metric(self, tensor) -> None: ... def __lt__(self, other) -> bool: ... - def __str__(self) -> str: ... __repr__ = ... @property @@ -152,7 +150,7 @@ class TensorSymmetry(Basic): def tensorsymmetry(*args) -> TensorSymmetry: ... @deprecated( - "TensorType is deprecated. Use tensor_heads() instead.", + ..., deprecated_since_version="1.5", active_deprecations_target="deprecated-tensortype", ) @@ -165,7 +163,6 @@ class TensorType(Basic): def symmetry(self) -> Basic: ... @property def types(self): ... - def __str__(self) -> str: ... def __call__(self, s, comm=...) -> TensorHead | list[TensorHead]: ... def tensorhead(name, typ, sym=..., comm=...) -> TensorHead: ... diff --git a/stubs/sympy-stubs/unify/core.pyi b/stubs/sympy-stubs/unify/core.pyi index 5cea44a7..e7e72721 100644 --- a/stubs/sympy-stubs/unify/core.pyi +++ b/stubs/sympy-stubs/unify/core.pyi @@ -4,19 +4,16 @@ class Compound: def __init__(self, op, args) -> None: ... def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... class Variable: def __init__(self, arg) -> None: ... def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... class CondVariable: def __init__(self, arg, valid) -> None: ... def __eq__(self, other) -> bool: ... def __hash__(self) -> int: ... - def __str__(self) -> str: ... def unify(x, y, s=..., **fns) -> Generator[Any | dict[Any, Any], Any, None]: ... def unify_var(var, x, s, **fns) -> Generator[Any, Any, None]: ... diff --git a/stubs/sympy-stubs/utilities/enumerative.pyi b/stubs/sympy-stubs/utilities/enumerative.pyi index a07005e5..4d927fa9 100644 --- a/stubs/sympy-stubs/utilities/enumerative.pyi +++ b/stubs/sympy-stubs/utilities/enumerative.pyi @@ -3,9 +3,6 @@ from typing import Any, Generator class PartComponent: __slots__ = ... def __init__(self) -> None: ... - def __repr__(self) -> str: - "for debug/algorithm animation purposes" - ... def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... diff --git a/stubs/sympy-stubs/utilities/exceptions.pyi b/stubs/sympy-stubs/utilities/exceptions.pyi index 6bd4f55e..09e4f42e 100644 --- a/stubs/sympy-stubs/utilities/exceptions.pyi +++ b/stubs/sympy-stubs/utilities/exceptions.pyi @@ -4,8 +4,6 @@ from typing_extensions import Self class SymPyDeprecationWarning(DeprecationWarning): def __init__(self, message, *, deprecated_since_version, active_deprecations_target) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __eq__(self, other) -> bool: ... def __reduce__(self) -> tuple[Callable[..., Self], tuple[Any, str, Any]]: ... diff --git a/stubs/vispy/_typing.pyi b/stubs/vispy/_typing.pyi index efac7656..48eb475c 100644 --- a/stubs/vispy/_typing.pyi +++ b/stubs/vispy/_typing.pyi @@ -1,20 +1,21 @@ import decimal import io +import typing_extensions import numpy.typing import pandas as pd Decimal = decimal.Decimal -PythonScalar = str | int | float | bool +PythonScalar: typing_extensions.TypeAlias = str | int | float | bool ArrayLike = numpy.typing.ArrayLike FileLike = io.IOBase PathLike = str -PandasScalar = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval -Scalar = PythonScalar | PandasScalar +PandasScalar: typing_extensions.TypeAlias = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval +Scalar: typing_extensions.TypeAlias = PythonScalar | PandasScalar -Color = tuple[float, float, float] | str +Color: typing_extensions.TypeAlias = tuple[float, float, float] | str __all__ = [ "ArrayLike", diff --git a/stubs/vispy/gloo/texture.pyi b/stubs/vispy/gloo/texture.pyi index ec83fb1f..56a9f312 100644 --- a/stubs/vispy/gloo/texture.pyi +++ b/stubs/vispy/gloo/texture.pyi @@ -33,12 +33,12 @@ class BaseTexture(GLObject): def __init__( self, - data: ndarray | tuple | None | None = None, + data: ndarray | tuple | None = None, format=None, resizable: bool = True, interpolation: str | None = None, wrapping: str | None = None, - shape: tuple | None | None = None, + shape: tuple | None = None, internalformat: str | None = None, resizeable=None, ): ... @@ -78,12 +78,12 @@ class Texture1D(BaseTexture): def __init__( self, - data: ndarray | tuple | None | None = None, + data: ndarray | tuple | None = None, format=None, resizable: bool = True, interpolation: str | None = None, wrapping: str | None = None, - shape: tuple | None | None = None, + shape: tuple | None = None, internalformat: str | None = None, resizeable=None, ): ... @@ -130,12 +130,12 @@ class Texture3D(BaseTexture): def __init__( self, - data: ndarray | tuple | None | None = None, + data: ndarray | tuple | None = None, format=None, resizable: bool = True, interpolation: str | None = None, wrapping: str | None = None, - shape: tuple | None | None = None, + shape: tuple | None = None, internalformat: str | None = None, resizeable=None, ): ... @@ -159,12 +159,12 @@ class TextureCube(BaseTexture): def __init__( self, - data: ndarray | tuple | None | None = None, + data: ndarray | tuple | None = None, format=None, resizable: bool = True, interpolation: str | None = None, wrapping: str | None = None, - shape: tuple | None | None = None, + shape: tuple | None = None, internalformat: str | None = None, resizeable=None, ): ... @@ -192,12 +192,12 @@ class TextureEmulated3D(Texture2D): def __init__( self, - data: ndarray | tuple | None | None = None, + data: ndarray | tuple | None = None, format=None, resizable: bool = True, interpolation: str | None = None, wrapping: str | None = None, - shape: tuple | None | None = None, + shape: tuple | None = None, internalformat: str | None = None, resizeable=None, ): ... diff --git a/stubs/vispy/io/stl.pyi b/stubs/vispy/io/stl.pyi index 52bbf015..c85a51ce 100644 --- a/stubs/vispy/io/stl.pyi +++ b/stubs/vispy/io/stl.pyi @@ -13,7 +13,7 @@ from .._typing import FileLike # the license. class HeaderError(Exception): - pass + ... # define a numpy datatype for the data section of a binary STL file _stl_dtype = ... diff --git a/stubs/vispy/scene/cameras/base_camera.pyi b/stubs/vispy/scene/cameras/base_camera.pyi index d6d4e419..afe23ae3 100644 --- a/stubs/vispy/scene/cameras/base_camera.pyi +++ b/stubs/vispy/scene/cameras/base_camera.pyi @@ -66,9 +66,9 @@ class BaseCamera(Node): def set_range( self, - x: tuple | None | None = None, - y: tuple | None | None = None, - z: tuple | None | None = None, + x: tuple | None = None, + y: tuple | None = None, + z: tuple | None = None, margin: float = 0.05, ): ... def _set_range(self, init): ... diff --git a/stubs/vispy/scene/canvas.pyi b/stubs/vispy/scene/canvas.pyi index 9ce7edee..91d72f53 100644 --- a/stubs/vispy/scene/canvas.pyi +++ b/stubs/vispy/scene/canvas.pyi @@ -64,8 +64,8 @@ class SceneCanvas(app.Canvas, Frozen): def on_draw(self, event: Event): ... def render( self, - region: tuple | None | None = None, - size: tuple | None | None = None, + region: tuple | None = None, + size: tuple | None = None, bgcolor: None | Color = None, crop: ArrayLike | None = None, alpha: bool = True, diff --git a/stubs/vispy/scene/widgets/anchor.pyi b/stubs/vispy/scene/widgets/anchor.pyi index a542ab94..2db47b49 100644 --- a/stubs/vispy/scene/widgets/anchor.pyi +++ b/stubs/vispy/scene/widgets/anchor.pyi @@ -1,4 +1,4 @@ from ..node import Node class Anchor(Node): - pass + ... diff --git a/stubs/vispy/util/profiler.pyi b/stubs/vispy/util/profiler.pyi index 27f05c8b..3f8c49bf 100644 --- a/stubs/vispy/util/profiler.pyi +++ b/stubs/vispy/util/profiler.pyi @@ -14,7 +14,6 @@ class Profiler(object): _msgs: list = ... # set this flag to disable all or individual profilers at runtime disable: bool = ... - ... _disabled_profiler = ... diff --git a/stubs/vispy/visuals/_scalable_textures.pyi b/stubs/vispy/visuals/_scalable_textures.pyi index 007d9d24..eb698467 100644 --- a/stubs/vispy/visuals/_scalable_textures.pyi +++ b/stubs/vispy/visuals/_scalable_textures.pyi @@ -13,7 +13,7 @@ def get_default_clim_from_dtype(dtype): ... def get_default_clim_from_data(data): ... class _ScaledTextureMixin: - def __init__(self, data: np.ndarray | tuple | None | None = None, **texture_kwargs): ... + def __init__(self, data: np.ndarray | tuple | None = None, **texture_kwargs): ... def init_scaling_texture(self, data=None, internalformat=None, **texture_kwargs): ... def _get_texture_format_for_data(self, data, internalformat): ... @property @@ -56,13 +56,13 @@ class GPUScaledTextureMixin(_ScaledTextureMixin): def scale_and_set_data(self, data, offset=None, copy=False): ... class CPUScaledTexture2D(CPUScaledTextureMixin, Texture2D): - pass + ... class GPUScaledTexture2D(GPUScaledTextureMixin, Texture2D): - pass + ... class CPUScaledTexture3D(CPUScaledTextureMixin, Texture3D): - pass + ... class GPUScaledTextured3D(GPUScaledTextureMixin, Texture3D): - pass + ... diff --git a/stubs/vispy/visuals/filters/clipping_planes.pyi b/stubs/vispy/visuals/filters/clipping_planes.pyi index 23ac120a..3d98bc96 100644 --- a/stubs/vispy/visuals/filters/clipping_planes.pyi +++ b/stubs/vispy/visuals/filters/clipping_planes.pyi @@ -2,7 +2,6 @@ # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import annotations from functools import lru_cache from typing import Optional diff --git a/stubs/vispy/visuals/volume.pyi b/stubs/vispy/visuals/volume.pyi index 9c6aa6f5..9d1f7e1d 100644 --- a/stubs/vispy/visuals/volume.pyi +++ b/stubs/vispy/visuals/volume.pyi @@ -2,7 +2,6 @@ # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import annotations from functools import lru_cache from typing import Literal, Optional