diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 991328db..5a1b6412 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,5 +48,5 @@ jobs: - name: Run Ruff Linter uses: astral-sh/ruff-action@v3 with: - version: "0.9.*" + version: "0.11.*" - run: ruff format --check diff --git a/pyproject.toml b/pyproject.toml index c4d168b4..e837975c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,11 +32,13 @@ select = [ "FA", # flake8-future-annotations "I", # isort "PYI", # flake8-pyi + "UP", # pyupgrade ] ignore = [ ### # Rules we don't want or don't agree with ### + # Typeshed doesn't want complex or non-literal defaults, or long strings, for maintenance and testing reasons. # This doesn't affect us, let's have more complete stubs. "PYI011", diff --git a/stubs/matplotlib/__init__.pyi b/stubs/matplotlib/__init__.pyi index e090c4fb..f536c4bd 100644 --- a/stubs/matplotlib/__init__.pyi +++ b/stubs/matplotlib/__init__.pyi @@ -1,5 +1,6 @@ import contextlib -from typing import Generator, Literal +from collections.abc import Generator +from typing import Literal import numpy as np from packaging.version import parse as parse_version diff --git a/stubs/matplotlib/_api/__init__.pyi b/stubs/matplotlib/_api/__init__.pyi index 9d20e293..03675f85 100644 --- a/stubs/matplotlib/_api/__init__.pyi +++ b/stubs/matplotlib/_api/__init__.pyi @@ -1,5 +1,6 @@ import functools -from typing import Any, Callable, Generator, Iterable, Type +from collections.abc import Generator, Iterable +from typing import Callable from .deprecation import MatplotlibDeprecationWarning @@ -19,5 +20,5 @@ def select_matching_signature(funcs: list[Callable], *args, **kwargs): ... def recursive_subclasses(cls) -> Generator: ... def warn_external( message: MatplotlibDeprecationWarning | PendingDeprecationWarning | str, - category: None | Type[MatplotlibDeprecationWarning] = ..., + category: None | type[MatplotlibDeprecationWarning] = ..., ) -> None: ... diff --git a/stubs/matplotlib/_api/deprecation.pyi b/stubs/matplotlib/_api/deprecation.pyi index 90d2c3fc..484d956c 100644 --- a/stubs/matplotlib/_api/deprecation.pyi +++ b/stubs/matplotlib/_api/deprecation.pyi @@ -1,6 +1,7 @@ import contextlib +from collections.abc import Iterator from functools import partial -from typing import Callable, Iterator +from typing import Callable class MatplotlibDeprecationWarning(DeprecationWarning): ... diff --git a/stubs/matplotlib/_mathtext.pyi b/stubs/matplotlib/_mathtext.pyi index f2c2c8b7..ab52796f 100644 --- a/stubs/matplotlib/_mathtext.pyi +++ b/stubs/matplotlib/_mathtext.pyi @@ -64,7 +64,7 @@ class DejaVuSansFonts(DejaVuFonts): ... class StixFonts(UnicodeFonts): def __init__(self, *args, **kwargs) -> None: ... - @functools.lru_cache() + @functools.lru_cache def get_sized_alternatives_for_symbol(self, fontname, sym) -> list[tuple]: ... class StixSansFonts(StixFonts): ... diff --git a/stubs/matplotlib/_pylab_helpers.pyi b/stubs/matplotlib/_pylab_helpers.pyi index 73d0b974..27780b4b 100644 --- a/stubs/matplotlib/_pylab_helpers.pyi +++ b/stubs/matplotlib/_pylab_helpers.pyi @@ -1,4 +1,4 @@ -from typing import Any, List, OrderedDict +from collections import OrderedDict from .backend_bases import FigureManagerBase from .figure import Figure diff --git a/stubs/matplotlib/_text_helpers.pyi b/stubs/matplotlib/_text_helpers.pyi index ea7d46d7..2f0c50cc 100644 --- a/stubs/matplotlib/_text_helpers.pyi +++ b/stubs/matplotlib/_text_helpers.pyi @@ -1,4 +1,4 @@ -from typing import Generator +from collections.abc import Generator LayoutItem = ... diff --git a/stubs/matplotlib/_tight_layout.pyi b/stubs/matplotlib/_tight_layout.pyi index 663dc10d..2b149301 100644 --- a/stubs/matplotlib/_tight_layout.pyi +++ b/stubs/matplotlib/_tight_layout.pyi @@ -1,4 +1,4 @@ -from typing import Sequence +from collections.abc import Sequence from .axes import Axes, SubplotBase from .backend_bases import RendererBase diff --git a/stubs/matplotlib/afm.pyi b/stubs/matplotlib/afm.pyi index 072bbfcc..bf1472da 100644 --- a/stubs/matplotlib/afm.pyi +++ b/stubs/matplotlib/afm.pyi @@ -1,11 +1,11 @@ # COMPLETE -from typing import BinaryIO, List, Literal, NamedTuple, Optional, Tuple, Union, overload +from typing import BinaryIO, Literal, NamedTuple, overload class CharMetrics(NamedTuple): width: float name: str - bbox: List[int] + bbox: list[int] class CompositePart(NamedTuple): name: str @@ -20,11 +20,11 @@ class AFM: def family_name(self) -> str: ... def get_angle(self) -> float: ... @overload - def get_bbox_char(self, c: str, isord: Literal[False] = ...) -> List[int]: ... + def get_bbox_char(self, c: str, isord: Literal[False] = ...) -> list[int]: ... @overload - def get_bbox_char(self, c: int, isord: Literal[True] = ...) -> List[int]: ... + def get_bbox_char(self, c: int, isord: Literal[True] = ...) -> list[int]: ... @overload - def get_bbox_char(self, c: Union[str, int], isord: bool = ...) -> List[int]: ... + def get_bbox_char(self, c: str | int, isord: bool = ...) -> list[int]: ... def get_capheight(self) -> float: ... def get_familyname(self) -> str: ... def get_fontname(self) -> str: ... @@ -34,27 +34,27 @@ class AFM: @overload def get_height_char(self, c: int, isord: Literal[True] = ...) -> int: ... @overload - def get_height_char(self, c: Union[str, int], isord: bool = ...) -> int: ... + def get_height_char(self, c: str | int, isord: bool = ...) -> int: ... def get_horizontal_stem_width(self) -> float: ... - def get_kern_dist(self, c1: Union[str, int], c2: Union[str, int]) -> float: ... + def get_kern_dist(self, c1: str | int, c2: str | int) -> float: ... def get_kern_dist_from_name(self, name1: str, name2: str) -> float: ... @overload def get_name_char(self, c: str, isord: Literal[False] = ...) -> str: ... @overload def get_name_char(self, c: int, isord: Literal[True] = ...) -> str: ... @overload - def get_name_char(self, c: Union[str, int], isord: bool = ...) -> str: ... - def get_str_bbox(self, s: Union[str, bytes]) -> Tuple[float, float, float, float, float]: ... - def get_str_bbox_and_descent(self, s: Union[str, bytes]) -> Tuple[float, float, float, float, float]: ... + def get_name_char(self, c: str | int, isord: bool = ...) -> str: ... + def get_str_bbox(self, s: str | bytes) -> tuple[float, float, float, float, float]: ... + def get_str_bbox_and_descent(self, s: str | bytes) -> tuple[float, float, float, float, float]: ... def get_underline_thickness(self) -> float: ... - def get_vertical_stem_width(self) -> Optional[float]: ... + def get_vertical_stem_width(self) -> float | None: ... def get_weight(self) -> str: ... @overload def get_width_char(self, c: str, isord: Literal[False] = ...) -> float: ... @overload def get_width_char(self, c: int, isord: Literal[True] = ...) -> float: ... @overload - def get_width_char(self, c: Union[str, int], isord: bool = ...) -> float: ... + def get_width_char(self, c: str | int, isord: bool = ...) -> float: ... def get_width_from_char_name(self, name: str) -> float: ... def get_xheight(self) -> float: ... - def string_width_height(self, s: str) -> Tuple[float, float]: ... + def string_width_height(self, s: str) -> tuple[float, float]: ... diff --git a/stubs/matplotlib/animation.pyi b/stubs/matplotlib/animation.pyi index 1da46a16..44cedb32 100644 --- a/stubs/matplotlib/animation.pyi +++ b/stubs/matplotlib/animation.pyi @@ -1,7 +1,8 @@ import abc import contextlib +from collections.abc import Generator, Iterable, Iterator from itertools import count -from typing import Callable, Generator, Iterable, Iterator, List +from typing import Callable from matplotlib.backend_bases import NonGuiException diff --git a/stubs/matplotlib/axes/_axes.pyi b/stubs/matplotlib/axes/_axes.pyi index c019b273..d3642a97 100644 --- a/stubs/matplotlib/axes/_axes.pyi +++ b/stubs/matplotlib/axes/_axes.pyi @@ -1,6 +1,7 @@ import datetime +from collections.abc import Sequence from re import L -from typing import Callable, Literal, Sequence, overload +from typing import Callable, Literal, overload import matplotlib.tri as mtri import numpy as np diff --git a/stubs/matplotlib/axes/_base.pyi b/stubs/matplotlib/axes/_base.pyi index fdc0fb97..0f9d9c1d 100644 --- a/stubs/matplotlib/axes/_base.pyi +++ b/stubs/matplotlib/axes/_base.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Collection, Literal, MutableSequence, Sequence, overload +from collections.abc import Collection, MutableSequence, Sequence +from typing import Any, Callable, Literal, overload import numpy as np from matplotlib._typing import * diff --git a/stubs/matplotlib/axis.pyi b/stubs/matplotlib/axis.pyi index cf4b1afc..4f2fc535 100644 --- a/stubs/matplotlib/axis.pyi +++ b/stubs/matplotlib/axis.pyi @@ -1,6 +1,6 @@ import datetime from datetime import timezone -from typing import Any, Callable, Literal, Type +from typing import Any, Callable, Literal import numpy as np @@ -94,7 +94,7 @@ class Ticker: class _LazyTickList: def __init__(self, major: bool) -> None: ... - def __get__(self, instance: XAxis | YAxis, cls: Type[XAxis] | Type[YAxis]) -> list[XTick | YTick]: ... + def __get__(self, instance: XAxis | YAxis, cls: type[XAxis | YAxis]) -> list[XTick | YTick]: ... class Axis(Artist): isDefault_label: bool diff --git a/stubs/matplotlib/backends/_backend_tk.pyi b/stubs/matplotlib/backends/_backend_tk.pyi index f190eac0..07dc409d 100644 --- a/stubs/matplotlib/backends/_backend_tk.pyi +++ b/stubs/matplotlib/backends/_backend_tk.pyi @@ -1,5 +1,6 @@ import tkinter as tk -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal from matplotlib._api import classproperty from matplotlib._typing import * diff --git a/stubs/matplotlib/backends/backend_agg.pyi b/stubs/matplotlib/backends/backend_agg.pyi index 6320e1cf..99ba1cd3 100644 --- a/stubs/matplotlib/backends/backend_agg.pyi +++ b/stubs/matplotlib/backends/backend_agg.pyi @@ -1,6 +1,6 @@ import threading from io import BufferedWriter, BytesIO -from typing import Any, Tuple +from typing import Any import numpy as np from matplotlib._typing import * diff --git a/stubs/matplotlib/backends/backend_gtk3.pyi b/stubs/matplotlib/backends/backend_gtk3.pyi index 70f36944..81268103 100644 --- a/stubs/matplotlib/backends/backend_gtk3.pyi +++ b/stubs/matplotlib/backends/backend_gtk3.pyi @@ -1,4 +1,4 @@ -from typing import Callable, Type +from typing import Callable # PyGObject is not easily installable on Windows, let tests pass as-is from gi.repository import Gtk # pyright: ignore[reportMissingImports] @@ -17,7 +17,7 @@ class __getattr__: class FigureCanvasGTK3(Gtk.DrawingArea, FigureCanvasBase): required_interactive_framework: str = ... - _timer_cls: Type[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] = ... +Toolbar: type[ToolbarGTK3] = ... class FigureManagerGTK3(_FigureManagerGTK): ... class _BackendGTK3(_BackendGTK): - FigureCanvas: Type[FigureCanvasGTK3] = ... - FigureManager: Type[FigureManagerGTK3] = ... + FigureCanvas: type[FigureCanvasGTK3] = ... + FigureManager: type[FigureManagerGTK3] = ... diff --git a/stubs/matplotlib/backends/backend_pdf.pyi b/stubs/matplotlib/backends/backend_pdf.pyi index c84f2f4e..0968492c 100644 --- a/stubs/matplotlib/backends/backend_pdf.pyi +++ b/stubs/matplotlib/backends/backend_pdf.pyi @@ -1,7 +1,7 @@ from enum import Enum from functools import total_ordering from io import BytesIO -from typing import Any, Callable, Optional, Set +from typing import Any from typing_extensions import Self import numpy as np @@ -115,7 +115,7 @@ class PdfFile: | dict[str, Name | int | Verbatim] | dict[str, Name | int | Verbatim | Reference] ) = ..., - png: Optional[dict[str, int]] = ..., + png: dict[str, int] | None = ..., ) -> None: ... def endStream(self) -> None: ... def outputStream(self, ref: Reference, data: bytes, *, extra=...) -> None: ... @@ -123,7 +123,7 @@ class PdfFile: def dviFontName(self, dvifont) -> Name: ... def writeFonts(self) -> None: ... def createType1Descriptor(self, t1font, fontfile) -> Reference: ... - def embedTTF(self, filename: str, characters: Set[int]) -> Reference: ... + def embedTTF(self, filename: str, characters: set[int]) -> Reference: ... def alphaState(self, alpha: tuple[float, float]) -> Name: ... def writeExtGSTates(self) -> None: ... def hatchPattern(self, hatch_style) -> Name: ... diff --git a/stubs/matplotlib/backends/backend_ps.pyi b/stubs/matplotlib/backends/backend_ps.pyi index cd6ae50d..420efda2 100644 --- a/stubs/matplotlib/backends/backend_ps.pyi +++ b/stubs/matplotlib/backends/backend_ps.pyi @@ -1,5 +1,4 @@ from enum import Enum -from typing import Type from matplotlib._typing import * from matplotlib.backend_bases import FigureCanvasBase, FigureManagerBase, GraphicsContextBase, _Backend @@ -106,7 +105,7 @@ def xpdf_distill(tmpfile, eps=..., ptype=..., bbox=..., rotated=...) -> None: .. def get_bbox_header(lbrt, rotated=...) -> tuple[str, str]: ... def pstoeps(tmpfile, bbox=..., rotated=...) -> None: ... -FigureManagerPS: Type[FigureManagerBase] = ... +FigureManagerPS: type[FigureManagerBase] = ... psDefs: list[str] = ... class _BackendPS(_Backend): diff --git a/stubs/matplotlib/backends/backend_qt.pyi b/stubs/matplotlib/backends/backend_qt.pyi index d8d0c8a8..74801430 100644 --- a/stubs/matplotlib/backends/backend_qt.pyi +++ b/stubs/matplotlib/backends/backend_qt.pyi @@ -1,4 +1,4 @@ -from typing import Any, Type +from typing import Any from matplotlib._api import classproperty from matplotlib.backend_bases import ( @@ -29,7 +29,7 @@ class TimerQT(TimerBase): class FigureCanvasQT(QtWidgets.QWidget, FigureCanvasBase): required_interactive_framework: str = ... - _timer_cls: Type[TimerQT] = ... + _timer_cls: type[TimerQT] = ... manager_class: classproperty = ... buttond: dict[str, MouseButton] = ... diff --git a/stubs/matplotlib/backends/backend_svg.pyi b/stubs/matplotlib/backends/backend_svg.pyi index dd3a3797..8d486c7d 100644 --- a/stubs/matplotlib/backends/backend_svg.pyi +++ b/stubs/matplotlib/backends/backend_svg.pyi @@ -1,6 +1,6 @@ from encodings.utf_8 import StreamWriter from io import BytesIO, TextIOWrapper -from typing import Any, Type +from typing import Any from matplotlib._typing import * from matplotlib.backend_bases import FigureCanvasBase, FigureManagerBase, GraphicsContextBase, RendererBase, _Backend @@ -97,7 +97,7 @@ class FigureCanvasSVG(FigureCanvasBase): def get_default_filetype(self) -> str: ... def draw(self) -> None: ... -FigureManagerSVG: Type[FigureManagerBase] = ... +FigureManagerSVG: type[FigureManagerBase] = ... svgProlog: str = ... class _BackendSVG(_Backend): diff --git a/stubs/matplotlib/backends/backend_tkagg.pyi b/stubs/matplotlib/backends/backend_tkagg.pyi index cb5663ff..d3ce11f4 100644 --- a/stubs/matplotlib/backends/backend_tkagg.pyi +++ b/stubs/matplotlib/backends/backend_tkagg.pyi @@ -1,5 +1,3 @@ -from typing import Type - from matplotlib.transforms import Bbox from ._backend_tk import FigureCanvasTk, _BackendTk @@ -10,4 +8,4 @@ class FigureCanvasTkAgg(FigureCanvasAgg, FigureCanvasTk): def blit(self, bbox: Bbox = ...) -> None: ... class _BackendTkAgg(_BackendTk): - FigureCanvas: Type[FigureCanvasAgg] = ... + FigureCanvas: type[FigureCanvasAgg] = ... diff --git a/stubs/matplotlib/category.pyi b/stubs/matplotlib/category.pyi index 1fe30a40..046b4148 100644 --- a/stubs/matplotlib/category.pyi +++ b/stubs/matplotlib/category.pyi @@ -1,4 +1,5 @@ -from typing import Any, Iterable +from collections.abc import Iterable +from typing import Any import numpy as np diff --git a/stubs/matplotlib/cbook/__init__.pyi b/stubs/matplotlib/cbook/__init__.pyi index 88e61c5f..8c879618 100644 --- a/stubs/matplotlib/cbook/__init__.pyi +++ b/stubs/matplotlib/cbook/__init__.pyi @@ -1,7 +1,8 @@ import collections import collections.abc import contextlib -from typing import Any, Callable, Generator, Iterator, overload +from collections.abc import Generator, Iterator +from typing import Any, Callable, overload import numpy as np from matplotlib._typing import * diff --git a/stubs/matplotlib/collections.pyi b/stubs/matplotlib/collections.pyi index d5283100..53425cb7 100644 --- a/stubs/matplotlib/collections.pyi +++ b/stubs/matplotlib/collections.pyi @@ -1,5 +1,6 @@ +from collections.abc import Sequence from tkinter.messagebox import NO -from typing import Callable, Literal, Sequence +from typing import Callable, Literal import numpy as np from matplotlib._enums import CapStyle, JoinStyle diff --git a/stubs/matplotlib/colorbar.pyi b/stubs/matplotlib/colorbar.pyi index 747987e6..95179927 100644 --- a/stubs/matplotlib/colorbar.pyi +++ b/stubs/matplotlib/colorbar.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence, Type +from collections.abc import Sequence +from typing import Literal from .axes import Axes from .axis import Tick @@ -82,7 +83,7 @@ class Colorbar: def remove(self) -> None: ... def drag_pan(self, button, key, x, y) -> None: ... -ColorbarBase: Type[Colorbar] = ... +ColorbarBase: type[Colorbar] = ... def make_axes( parents: Axes | list[Axes], diff --git a/stubs/matplotlib/colors.pyi b/stubs/matplotlib/colors.pyi index 24a1a643..a1e38290 100644 --- a/stubs/matplotlib/colors.pyi +++ b/stubs/matplotlib/colors.pyi @@ -1,8 +1,8 @@ import functools -from collections.abc import Mapping +from collections.abc import Iterator, Mapping from email.errors import NonPrintableDefect from re import Pattern -from typing import Callable, Iterator, Literal +from typing import Callable, Literal import numpy as np from matplotlib._typing import * diff --git a/stubs/matplotlib/container.pyi b/stubs/matplotlib/container.pyi index 277f5be1..0042e4a3 100644 --- a/stubs/matplotlib/container.pyi +++ b/stubs/matplotlib/container.pyi @@ -1,4 +1,4 @@ -from typing import Literal, Type +from typing import Literal from typing_extensions import Self from matplotlib.artist import Artist diff --git a/stubs/matplotlib/contour.pyi b/stubs/matplotlib/contour.pyi index 5f127425..e039f7f0 100644 --- a/stubs/matplotlib/contour.pyi +++ b/stubs/matplotlib/contour.pyi @@ -1,5 +1,6 @@ +from collections.abc import Iterable, Sequence from tkinter import Label -from typing import Callable, Iterable, Literal, Sequence +from typing import Callable, Literal from matplotlib.collections import Collection diff --git a/stubs/matplotlib/dviread.pyi b/stubs/matplotlib/dviread.pyi index 6a7a8890..92d7d3e1 100644 --- a/stubs/matplotlib/dviread.pyi +++ b/stubs/matplotlib/dviread.pyi @@ -40,12 +40,12 @@ class Tfm: PsFont = ... class PsfontsMap: - @lru_cache() + @lru_cache def __new__(cls, filename): ... def __getitem__(self, texname): ... class _LuatexKpsewhich: - @lru_cache() + @lru_cache def __new__(cls): ... def search(self, filename): ... diff --git a/stubs/matplotlib/font_manager.pyi b/stubs/matplotlib/font_manager.pyi index a084353b..6331017d 100644 --- a/stubs/matplotlib/font_manager.pyi +++ b/stubs/matplotlib/font_manager.pyi @@ -209,7 +209,7 @@ class FontManager: ) -> str: ... def get_font_names(self) -> list: ... -@lru_cache() +@lru_cache def is_opentype_cff_font(filename): ... def get_font(filename, hinting_factor=...): ... diff --git a/stubs/matplotlib/ft2font.pyi b/stubs/matplotlib/ft2font.pyi index 76c260c8..29716b42 100644 --- a/stubs/matplotlib/ft2font.pyi +++ b/stubs/matplotlib/ft2font.pyi @@ -10,7 +10,7 @@ FAST_GLYPHS: int FIXED_SIZES: int FIXED_WIDTH: int -class FT2Font(_mod_builtins.object): +class FT2Font: def __init__(self, *args, **kwargs) -> None: ... @classmethod def __init_subclass__(cls) -> None: ... @@ -82,7 +82,7 @@ class FT2Font(_mod_builtins.object): def units_per_EM(self) -> typing.Any: ... def __getattr__(self, name) -> typing.Any: ... -class FT2Image(_mod_builtins.object): +class FT2Image: def __init__(self, *args, **kwargs) -> None: ... @classmethod def __init_subclass__(cls) -> None: ... diff --git a/stubs/matplotlib/gridspec.pyi b/stubs/matplotlib/gridspec.pyi index 8a6cccbd..898a4a7a 100644 --- a/stubs/matplotlib/gridspec.pyi +++ b/stubs/matplotlib/gridspec.pyi @@ -1,4 +1,4 @@ -from typing import Sequence +from collections.abc import Sequence from ._typing import * from .backend_bases import RendererBase diff --git a/stubs/matplotlib/image.pyi b/stubs/matplotlib/image.pyi index 48bae13d..68be3d36 100644 --- a/stubs/matplotlib/image.pyi +++ b/stubs/matplotlib/image.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal import numpy as np from PIL.Image import Image diff --git a/stubs/matplotlib/layout_engine.pyi b/stubs/matplotlib/layout_engine.pyi index 4995faaf..14d22dd2 100644 --- a/stubs/matplotlib/layout_engine.pyi +++ b/stubs/matplotlib/layout_engine.pyi @@ -1,4 +1,4 @@ -from typing import Sequence +from collections.abc import Sequence from ._layoutgrid import LayoutGrid from .figure import Figure, FigureBase diff --git a/stubs/matplotlib/legend.pyi b/stubs/matplotlib/legend.pyi index e8e55bd0..d2f5a8d0 100644 --- a/stubs/matplotlib/legend.pyi +++ b/stubs/matplotlib/legend.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal from .artist import Artist, allow_rasterization from .axes import Axes diff --git a/stubs/matplotlib/legend_handler.pyi b/stubs/matplotlib/legend_handler.pyi index d3349acb..227e0d4e 100644 --- a/stubs/matplotlib/legend_handler.pyi +++ b/stubs/matplotlib/legend_handler.pyi @@ -1,5 +1,5 @@ from collections.abc import Sequence -from typing import Callable, Sequence +from typing import Callable from .artist import Artist from .container import BarContainer diff --git a/stubs/matplotlib/lines.pyi b/stubs/matplotlib/lines.pyi index b3122a4e..6443dfff 100644 --- a/stubs/matplotlib/lines.pyi +++ b/stubs/matplotlib/lines.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Literal, Sequence +from collections.abc import Sequence +from typing import Any, Callable, Literal import numpy as np from matplotlib.markers import MarkerStyle diff --git a/stubs/matplotlib/mlab.pyi b/stubs/matplotlib/mlab.pyi index 28807864..61f191fb 100644 --- a/stubs/matplotlib/mlab.pyi +++ b/stubs/matplotlib/mlab.pyi @@ -1,4 +1,5 @@ -from typing import Callable, Literal, Sequence +from collections.abc import Sequence +from typing import Callable, Literal import numpy as np diff --git a/stubs/matplotlib/offsetbox.pyi b/stubs/matplotlib/offsetbox.pyi index d058d9b5..b26321ad 100644 --- a/stubs/matplotlib/offsetbox.pyi +++ b/stubs/matplotlib/offsetbox.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Literal, Sequence +from collections.abc import Sequence +from typing import Any, Callable, Literal from ._typing import * from .artist import Artist diff --git a/stubs/matplotlib/patches.pyi b/stubs/matplotlib/patches.pyi index 76423e00..1867a90e 100644 --- a/stubs/matplotlib/patches.pyi +++ b/stubs/matplotlib/patches.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal import numpy as np diff --git a/stubs/matplotlib/path.pyi b/stubs/matplotlib/path.pyi index 60194e62..ad305c4a 100644 --- a/stubs/matplotlib/path.pyi +++ b/stubs/matplotlib/path.pyi @@ -1,5 +1,5 @@ +from collections.abc import Sequence from functools import lru_cache -from typing import Sequence import numpy as np diff --git a/stubs/matplotlib/patheffects.pyi b/stubs/matplotlib/patheffects.pyi index cfc84042..54875387 100644 --- a/stubs/matplotlib/patheffects.pyi +++ b/stubs/matplotlib/patheffects.pyi @@ -1,4 +1,5 @@ -from typing import Callable, Iterable, Sequence +from collections.abc import Iterable, Sequence +from typing import Callable from ._typing import * from .backend_bases import GraphicsContextBase, RendererBase diff --git a/stubs/matplotlib/projections/geo.pyi b/stubs/matplotlib/projections/geo.pyi index 2fa3e5ad..9f5521ba 100644 --- a/stubs/matplotlib/projections/geo.pyi +++ b/stubs/matplotlib/projections/geo.pyi @@ -1,5 +1,5 @@ -from typing import Sequence -from typing_extensions import NoReturn +from collections.abc import Sequence +from typing import NoReturn import numpy as np from matplotlib.axes import Axes diff --git a/stubs/matplotlib/projections/polar.pyi b/stubs/matplotlib/projections/polar.pyi index 233dbd91..d5687f25 100644 --- a/stubs/matplotlib/projections/polar.pyi +++ b/stubs/matplotlib/projections/polar.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence, Type +from collections.abc import Sequence +from typing import Literal import numpy as np from matplotlib._typing import * @@ -53,7 +54,7 @@ class ThetaTick(XTick): class ThetaAxis(Axis): axis_name: str = ... - _tick_class: Type[ThetaTick] = ... + _tick_class: type[ThetaTick] = ... def clear(self) -> None: ... class RadialLocator(Locator): @@ -73,7 +74,7 @@ class RadialTick(YTick): class RadialAxis(Axis): axis_name: str = ... - _tick_class: Type[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 c9718094..22889073 100644 --- a/stubs/matplotlib/pyplot.pyi +++ b/stubs/matplotlib/pyplot.pyi @@ -1,6 +1,8 @@ import datetime from array import array -from typing import Callable, ContextManager, Literal, Sequence, overload +from collections.abc import Sequence +from contextlib import AbstractContextManager +from typing import Callable, Literal, overload from typing_extensions import Self import matplotlib @@ -58,7 +60,7 @@ def ioff() -> _IoffContext: ... def ion() -> _IonContext: ... def pause(interval) -> None: ... def rc(group, **kwargs) -> None: ... -def rc_context(rc: dict = ..., fname: str | PathLike = ...) -> ContextManager: ... +def rc_context(rc: dict = ..., fname: str | PathLike = ...) -> AbstractContextManager: ... def rcdefaults() -> None: ... def getp(obj: Artist, *args, **kwargs): ... def get(obj: Artist, *args, **kwargs): ... diff --git a/stubs/matplotlib/rcsetup.pyi b/stubs/matplotlib/rcsetup.pyi index d8add6ca..99f1632a 100644 --- a/stubs/matplotlib/rcsetup.pyi +++ b/stubs/matplotlib/rcsetup.pyi @@ -1,5 +1,5 @@ import ast -from typing import Sequence +from collections.abc import Sequence from cycler import Cycler diff --git a/stubs/matplotlib/sankey.pyi b/stubs/matplotlib/sankey.pyi index fd6102da..5948fe04 100644 --- a/stubs/matplotlib/sankey.pyi +++ b/stubs/matplotlib/sankey.pyi @@ -1,5 +1,5 @@ +from collections.abc import Sequence from types import SimpleNamespace -from typing import Sequence from .axes import Axes diff --git a/stubs/matplotlib/scale.pyi b/stubs/matplotlib/scale.pyi index 6e76a5ec..b89e88d7 100644 --- a/stubs/matplotlib/scale.pyi +++ b/stubs/matplotlib/scale.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Literal, Sequence +from collections.abc import Sequence +from typing import Any, Callable, Literal from ._typing import * from .axis import Axis diff --git a/stubs/matplotlib/spines.pyi b/stubs/matplotlib/spines.pyi index 110d148a..81687859 100644 --- a/stubs/matplotlib/spines.pyi +++ b/stubs/matplotlib/spines.pyi @@ -1,7 +1,6 @@ from collections import OrderedDict -from collections.abc import MutableMapping +from collections.abc import MutableMapping, Sequence from functools import partial -from typing import Sequence from ._typing import * from .artist import allow_rasterization diff --git a/stubs/matplotlib/stackplot.pyi b/stubs/matplotlib/stackplot.pyi index 39d78f21..280af8eb 100644 --- a/stubs/matplotlib/stackplot.pyi +++ b/stubs/matplotlib/stackplot.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal from ._typing import * from .collections import PolyCollection diff --git a/stubs/matplotlib/streamplot.pyi b/stubs/matplotlib/streamplot.pyi index 16848cd1..e722c63d 100644 --- a/stubs/matplotlib/streamplot.pyi +++ b/stubs/matplotlib/streamplot.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal from ._typing import * from .axes import Axes diff --git a/stubs/matplotlib/style/__init__.pyi b/stubs/matplotlib/style/__init__.pyi index 366c305d..c123ca27 100644 --- a/stubs/matplotlib/style/__init__.pyi +++ b/stubs/matplotlib/style/__init__.pyi @@ -1,15 +1,16 @@ # COMPLETE import typing_extensions +from collections.abc import Mapping from pathlib import Path -from typing import Any, Dict, List, Mapping, Union +from typing import Any -_Style: typing_extensions.TypeAlias = Union[str, Path, Mapping[str, Any]] -_StyleOrList: typing_extensions.TypeAlias = Union[_Style, List[_Style]] +_Style: typing_extensions.TypeAlias = str | Path | Mapping[str, Any] +_StyleOrList: typing_extensions.TypeAlias = _Style | list[_Style] def context(style: _StyleOrList, after_reset: bool = ...) -> None: ... def reload_library() -> None: ... def use(style: _StyleOrList) -> None: ... -library: Dict[str, Any] -available: List[str] +library: dict[str, Any] +available: list[str] diff --git a/stubs/matplotlib/style/core.pyi b/stubs/matplotlib/style/core.pyi index bec1f709..8e0c37e0 100644 --- a/stubs/matplotlib/style/core.pyi +++ b/stubs/matplotlib/style/core.pyi @@ -1,5 +1,5 @@ import contextlib -from typing import Generator +from collections.abc import Generator __all__ = ["use", "context", "available", "library", "reload_library"] diff --git a/stubs/matplotlib/table.pyi b/stubs/matplotlib/table.pyi index b85625b2..b918d407 100644 --- a/stubs/matplotlib/table.pyi +++ b/stubs/matplotlib/table.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal from ._typing import * from .artist import Artist, allow_rasterization diff --git a/stubs/matplotlib/texmanager.pyi b/stubs/matplotlib/texmanager.pyi index 97ae1ff4..e276406b 100644 --- a/stubs/matplotlib/texmanager.pyi +++ b/stubs/matplotlib/texmanager.pyi @@ -10,7 +10,7 @@ class TexManager: font_family = ... font_families = ... font_info = ... - @functools.lru_cache() + @functools.lru_cache def __new__(cls) -> Self: ... def get_font_config(self): ... @classmethod diff --git a/stubs/matplotlib/text.pyi b/stubs/matplotlib/text.pyi index e1c3b6c7..b140475b 100644 --- a/stubs/matplotlib/text.pyi +++ b/stubs/matplotlib/text.pyi @@ -1,6 +1,7 @@ import pathlib +from collections.abc import Sequence from pathlib import PosixPath -from typing import Any, Callable, Literal, Sequence +from typing import Any, Callable, Literal from matplotlib.path import Path diff --git a/stubs/matplotlib/textpath.pyi b/stubs/matplotlib/textpath.pyi index 1a8448c0..012ee71f 100644 --- a/stubs/matplotlib/textpath.pyi +++ b/stubs/matplotlib/textpath.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal from matplotlib.texmanager import TexManager diff --git a/stubs/matplotlib/ticker.pyi b/stubs/matplotlib/ticker.pyi index 2ad53b7a..3665fb8f 100644 --- a/stubs/matplotlib/ticker.pyi +++ b/stubs/matplotlib/ticker.pyi @@ -1,5 +1,6 @@ +from collections.abc import Sequence from functools import partial -from typing import Any, Callable, Literal, Sequence +from typing import Any, Callable, Literal from ._typing import * from .axis import Axis diff --git a/stubs/matplotlib/transforms.pyi b/stubs/matplotlib/transforms.pyi index db28ac4d..37276d46 100644 --- a/stubs/matplotlib/transforms.pyi +++ b/stubs/matplotlib/transforms.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal import numpy as np from matplotlib._typing import * diff --git a/stubs/matplotlib/units.pyi b/stubs/matplotlib/units.pyi index 1b85a305..f9b1ca0c 100644 --- a/stubs/matplotlib/units.pyi +++ b/stubs/matplotlib/units.pyi @@ -1,5 +1,5 @@ +from collections.abc import Iterable, Sequence from datetime import date -from typing import Iterable, Sequence from ._typing import * from .axis import Axis diff --git a/stubs/matplotlib/widgets.pyi b/stubs/matplotlib/widgets.pyi index 91a6ed17..cda2b3c3 100644 --- a/stubs/matplotlib/widgets.pyi +++ b/stubs/matplotlib/widgets.pyi @@ -1,7 +1,8 @@ import copy +from collections.abc import Mapping, Sequence from contextlib import ExitStack from numbers import Integral, Number -from typing import Any, Callable, Dict, List, Literal, Mapping, Optional, Sequence, Tuple, Union +from typing import Callable, Literal import matplotlib as mpl import numpy as np diff --git a/stubs/networkx/algorithms/approximation/connectivity.pyi b/stubs/networkx/algorithms/approximation/connectivity.pyi index 869aa72b..1359a74c 100644 --- a/stubs/networkx/algorithms/approximation/connectivity.pyi +++ b/stubs/networkx/algorithms/approximation/connectivity.pyi @@ -1,6 +1,6 @@ import itertools +from collections.abc import Mapping from operator import itemgetter -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/approximation/kcomponents.pyi b/stubs/networkx/algorithms/approximation/kcomponents.pyi index 87a521fa..c0e0a1e2 100644 --- a/stubs/networkx/algorithms/approximation/kcomponents.pyi +++ b/stubs/networkx/algorithms/approximation/kcomponents.pyi @@ -2,7 +2,6 @@ import itertools from collections import defaultdict from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...classes.graph import Graph from ...exception import NetworkXError diff --git a/stubs/networkx/algorithms/approximation/traveling_salesman.pyi b/stubs/networkx/algorithms/approximation/traveling_salesman.pyi index e7cff9dc..5175236b 100644 --- a/stubs/networkx/algorithms/approximation/traveling_salesman.pyi +++ b/stubs/networkx/algorithms/approximation/traveling_salesman.pyi @@ -1,5 +1,6 @@ import math -from typing import Literal, Mapping +from collections.abc import Mapping +from typing import Literal from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/assortativity/connectivity.pyi b/stubs/networkx/algorithms/assortativity/connectivity.pyi index 03c8f350..86bba7b8 100644 --- a/stubs/networkx/algorithms/assortativity/connectivity.pyi +++ b/stubs/networkx/algorithms/assortativity/connectivity.pyi @@ -1,5 +1,6 @@ from collections import defaultdict -from typing import Literal, Mapping +from collections.abc import Mapping +from typing import Literal from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/assortativity/mixing.pyi b/stubs/networkx/algorithms/assortativity/mixing.pyi index 6b448adb..573b38f5 100644 --- a/stubs/networkx/algorithms/assortativity/mixing.pyi +++ b/stubs/networkx/algorithms/assortativity/mixing.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import dict_to_numpy_array diff --git a/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi b/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi index 494d5560..5c66e4bd 100644 --- a/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi +++ b/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/asteroidal.pyi b/stubs/networkx/algorithms/asteroidal.pyi index 6b340671..3632aad6 100644 --- a/stubs/networkx/algorithms/asteroidal.pyi +++ b/stubs/networkx/algorithms/asteroidal.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ..classes.graph import Graph from ..utils import not_implemented_for diff --git a/stubs/networkx/algorithms/bipartite/basic.pyi b/stubs/networkx/algorithms/bipartite/basic.pyi index 0f0fe823..989d2dad 100644 --- a/stubs/networkx/algorithms/bipartite/basic.pyi +++ b/stubs/networkx/algorithms/bipartite/basic.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...algorithms.components import connected_components from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/bipartite/centrality.pyi b/stubs/networkx/algorithms/bipartite/centrality.pyi index 91b3c19f..6d6a17aa 100644 --- a/stubs/networkx/algorithms/bipartite/centrality.pyi +++ b/stubs/networkx/algorithms/bipartite/centrality.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/bipartite/cluster.pyi b/stubs/networkx/algorithms/bipartite/cluster.pyi index 639c6a5b..2a331049 100644 --- a/stubs/networkx/algorithms/bipartite/cluster.pyi +++ b/stubs/networkx/algorithms/bipartite/cluster.pyi @@ -1,6 +1,5 @@ import itertools -from collections.abc import Iterable -from typing import Mapping +from collections.abc import Iterable, Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/bipartite/matching.pyi b/stubs/networkx/algorithms/bipartite/matching.pyi index bcfdd9ab..8d9c502b 100644 --- a/stubs/networkx/algorithms/bipartite/matching.pyi +++ b/stubs/networkx/algorithms/bipartite/matching.pyi @@ -10,7 +10,7 @@ # proof, see ). import collections import itertools -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from .matrix import biadjacency_matrix diff --git a/stubs/networkx/algorithms/bipartite/redundancy.pyi b/stubs/networkx/algorithms/bipartite/redundancy.pyi index 11ba3487..b8b2957c 100644 --- a/stubs/networkx/algorithms/bipartite/redundancy.pyi +++ b/stubs/networkx/algorithms/bipartite/redundancy.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from itertools import combinations -from typing import Mapping from networkx import NetworkXError diff --git a/stubs/networkx/algorithms/centrality/betweenness.pyi b/stubs/networkx/algorithms/centrality/betweenness.pyi index 7023e82e..5b76c540 100644 --- a/stubs/networkx/algorithms/centrality/betweenness.pyi +++ b/stubs/networkx/algorithms/centrality/betweenness.pyi @@ -1,8 +1,8 @@ import warnings from collections import deque +from collections.abc import Mapping from heapq import heappop, heappush from itertools import count -from typing import Mapping from ...classes.graph import Graph from ...utils import py_random_state diff --git a/stubs/networkx/algorithms/centrality/betweenness_subset.pyi b/stubs/networkx/algorithms/centrality/betweenness_subset.pyi index 24f6ff91..40f42f73 100644 --- a/stubs/networkx/algorithms/centrality/betweenness_subset.pyi +++ b/stubs/networkx/algorithms/centrality/betweenness_subset.pyi @@ -1,5 +1,5 @@ import warnings -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/centrality/closeness.pyi b/stubs/networkx/algorithms/centrality/closeness.pyi index 055b52c1..435d1d46 100644 --- a/stubs/networkx/algorithms/centrality/closeness.pyi +++ b/stubs/networkx/algorithms/centrality/closeness.pyi @@ -1,5 +1,5 @@ import functools -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...exception import NetworkXError diff --git a/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi b/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi index 0e0aaa8f..2f61694d 100644 --- a/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi +++ b/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for, py_random_state, reverse_cuthill_mckee_ordering diff --git a/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi b/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi index 32a41ab8..4ec8c04a 100644 --- a/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi +++ b/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for, reverse_cuthill_mckee_ordering diff --git a/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi b/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi index 4689c363..f92215f4 100644 --- a/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi +++ b/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for, reverse_cuthill_mckee_ordering diff --git a/stubs/networkx/algorithms/centrality/degree_alg.pyi b/stubs/networkx/algorithms/centrality/degree_alg.pyi index 94b2dfb4..809aa1c5 100644 --- a/stubs/networkx/algorithms/centrality/degree_alg.pyi +++ b/stubs/networkx/algorithms/centrality/degree_alg.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils.decorators import not_implemented_for diff --git a/stubs/networkx/algorithms/centrality/dispersion.pyi b/stubs/networkx/algorithms/centrality/dispersion.pyi index d66ed20d..e001c8f5 100644 --- a/stubs/networkx/algorithms/centrality/dispersion.pyi +++ b/stubs/networkx/algorithms/centrality/dispersion.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from itertools import combinations -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/centrality/eigenvector.pyi b/stubs/networkx/algorithms/centrality/eigenvector.pyi index 5da96546..f70c344d 100644 --- a/stubs/networkx/algorithms/centrality/eigenvector.pyi +++ b/stubs/networkx/algorithms/centrality/eigenvector.pyi @@ -1,5 +1,5 @@ import math -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for diff --git a/stubs/networkx/algorithms/centrality/harmonic.pyi b/stubs/networkx/algorithms/centrality/harmonic.pyi index 26ee9e87..4368ead2 100644 --- a/stubs/networkx/algorithms/centrality/harmonic.pyi +++ b/stubs/networkx/algorithms/centrality/harmonic.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from functools import partial -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/centrality/katz.pyi b/stubs/networkx/algorithms/centrality/katz.pyi index 093a9217..b35850ee 100644 --- a/stubs/networkx/algorithms/centrality/katz.pyi +++ b/stubs/networkx/algorithms/centrality/katz.pyi @@ -1,5 +1,5 @@ import math -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for diff --git a/stubs/networkx/algorithms/centrality/load.pyi b/stubs/networkx/algorithms/centrality/load.pyi index c95d1f34..4d9c096b 100644 --- a/stubs/networkx/algorithms/centrality/load.pyi +++ b/stubs/networkx/algorithms/centrality/load.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from operator import itemgetter -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/centrality/percolation.pyi b/stubs/networkx/algorithms/centrality/percolation.pyi index 5bc49d80..5f3c3ec1 100644 --- a/stubs/networkx/algorithms/centrality/percolation.pyi +++ b/stubs/networkx/algorithms/centrality/percolation.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/centrality/second_order.pyi b/stubs/networkx/algorithms/centrality/second_order.pyi index 928abe3c..3140d0ed 100644 --- a/stubs/networkx/algorithms/centrality/second_order.pyi +++ b/stubs/networkx/algorithms/centrality/second_order.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for diff --git a/stubs/networkx/algorithms/centrality/subgraph_alg.pyi b/stubs/networkx/algorithms/centrality/subgraph_alg.pyi index c58a6b18..14d6d104 100644 --- a/stubs/networkx/algorithms/centrality/subgraph_alg.pyi +++ b/stubs/networkx/algorithms/centrality/subgraph_alg.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph from ...utils import not_implemented_for diff --git a/stubs/networkx/algorithms/centrality/trophic.pyi b/stubs/networkx/algorithms/centrality/trophic.pyi index 5f7b14ad..a777102e 100644 --- a/stubs/networkx/algorithms/centrality/trophic.pyi +++ b/stubs/networkx/algorithms/centrality/trophic.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.digraph import DiGraph from ...utils import not_implemented_for diff --git a/stubs/networkx/algorithms/cluster.pyi b/stubs/networkx/algorithms/cluster.pyi index 550636a6..ce35a47a 100644 --- a/stubs/networkx/algorithms/cluster.pyi +++ b/stubs/networkx/algorithms/cluster.pyi @@ -1,6 +1,6 @@ from collections import Counter +from collections.abc import Mapping from itertools import chain, combinations -from typing import Mapping from ..classes.graph import Graph from ..utils import not_implemented_for diff --git a/stubs/networkx/algorithms/communicability_alg.pyi b/stubs/networkx/algorithms/communicability_alg.pyi index 37dbd30a..ca3f2eba 100644 --- a/stubs/networkx/algorithms/communicability_alg.pyi +++ b/stubs/networkx/algorithms/communicability_alg.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ..classes.graph import Graph from ..utils import not_implemented_for diff --git a/stubs/networkx/algorithms/community/quality.pyi b/stubs/networkx/algorithms/community/quality.pyi index ddb7fb2b..a3de5f46 100644 --- a/stubs/networkx/algorithms/community/quality.pyi +++ b/stubs/networkx/algorithms/community/quality.pyi @@ -1,5 +1,5 @@ +from collections.abc import Sequence from itertools import combinations -from typing import Sequence from networkx import NetworkXError diff --git a/stubs/networkx/algorithms/connectivity/connectivity.pyi b/stubs/networkx/algorithms/connectivity/connectivity.pyi index 11cc0532..bfdd7b83 100644 --- a/stubs/networkx/algorithms/connectivity/connectivity.pyi +++ b/stubs/networkx/algorithms/connectivity/connectivity.pyi @@ -1,6 +1,6 @@ import itertools +from collections.abc import Mapping from operator import itemgetter -from typing import Mapping # Define the default maximum flow function to use in all flow based # connectivity algorithms. diff --git a/stubs/networkx/algorithms/connectivity/kcomponents.pyi b/stubs/networkx/algorithms/connectivity/kcomponents.pyi index aea85fe6..01751f99 100644 --- a/stubs/networkx/algorithms/connectivity/kcomponents.pyi +++ b/stubs/networkx/algorithms/connectivity/kcomponents.pyi @@ -1,7 +1,7 @@ from collections import defaultdict +from collections.abc import Mapping from itertools import combinations from operator import itemgetter -from typing import Mapping # Define the default maximum flow function. from ...algorithms.flow import edmonds_karp diff --git a/stubs/networkx/algorithms/core.pyi b/stubs/networkx/algorithms/core.pyi index 5b8896c1..dba7cfc7 100644 --- a/stubs/networkx/algorithms/core.pyi +++ b/stubs/networkx/algorithms/core.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ..classes.graph import Graph from ..exception import NetworkXError diff --git a/stubs/networkx/algorithms/distance_measures.pyi b/stubs/networkx/algorithms/distance_measures.pyi index 26aa5328..f33fe690 100644 --- a/stubs/networkx/algorithms/distance_measures.pyi +++ b/stubs/networkx/algorithms/distance_measures.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/flow/mincost.pyi b/stubs/networkx/algorithms/flow/mincost.pyi index 35375e6c..87453fa6 100644 --- a/stubs/networkx/algorithms/flow/mincost.pyi +++ b/stubs/networkx/algorithms/flow/mincost.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/graph_hashing.pyi b/stubs/networkx/algorithms/graph_hashing.pyi index 8c6c416b..7777170c 100644 --- a/stubs/networkx/algorithms/graph_hashing.pyi +++ b/stubs/networkx/algorithms/graph_hashing.pyi @@ -1,6 +1,6 @@ from collections import Counter, defaultdict +from collections.abc import Mapping from hashlib import blake2b -from typing import Mapping from ..classes.graph import Graph diff --git a/stubs/networkx/algorithms/isomorphism/ismags.pyi b/stubs/networkx/algorithms/isomorphism/ismags.pyi index b3ef4f27..af69cdac 100644 --- a/stubs/networkx/algorithms/isomorphism/ismags.pyi +++ b/stubs/networkx/algorithms/isomorphism/ismags.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/link_analysis/hits_alg.pyi b/stubs/networkx/algorithms/link_analysis/hits_alg.pyi index 29174769..ae1b7344 100644 --- a/stubs/networkx/algorithms/link_analysis/hits_alg.pyi +++ b/stubs/networkx/algorithms/link_analysis/hits_alg.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi b/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi index 5751a764..65ff7cca 100644 --- a/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi +++ b/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from warnings import warn from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/matching.pyi b/stubs/networkx/algorithms/matching.pyi index 9426401c..795a0965 100644 --- a/stubs/networkx/algorithms/matching.pyi +++ b/stubs/networkx/algorithms/matching.pyi @@ -1,6 +1,6 @@ from collections import Counter +from collections.abc import Mapping from itertools import combinations, repeat -from typing import Mapping from ..classes.graph import Graph from ..utils import not_implemented_for diff --git a/stubs/networkx/algorithms/planar_drawing.pyi b/stubs/networkx/algorithms/planar_drawing.pyi index 1bfaa1b2..9af7f867 100644 --- a/stubs/networkx/algorithms/planar_drawing.pyi +++ b/stubs/networkx/algorithms/planar_drawing.pyi @@ -1,5 +1,5 @@ from collections import defaultdict -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/planarity.pyi b/stubs/networkx/algorithms/planarity.pyi index d104ac32..b1d05e0e 100644 --- a/stubs/networkx/algorithms/planarity.pyi +++ b/stubs/networkx/algorithms/planarity.pyi @@ -1,5 +1,5 @@ from collections import defaultdict -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/reciprocity.pyi b/stubs/networkx/algorithms/reciprocity.pyi index 3e62beb1..3966f04c 100644 --- a/stubs/networkx/algorithms/reciprocity.pyi +++ b/stubs/networkx/algorithms/reciprocity.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from networkx import NetworkXError diff --git a/stubs/networkx/algorithms/richclub.pyi b/stubs/networkx/algorithms/richclub.pyi index f25f1d47..957209e3 100644 --- a/stubs/networkx/algorithms/richclub.pyi +++ b/stubs/networkx/algorithms/richclub.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from itertools import accumulate -from typing import Mapping from ..classes.graph import Graph from ..utils import not_implemented_for diff --git a/stubs/networkx/algorithms/shortest_paths/dense.pyi b/stubs/networkx/algorithms/shortest_paths/dense.pyi index b0574294..84ee24cd 100644 --- a/stubs/networkx/algorithms/shortest_paths/dense.pyi +++ b/stubs/networkx/algorithms/shortest_paths/dense.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/shortest_paths/unweighted.pyi b/stubs/networkx/algorithms/shortest_paths/unweighted.pyi index 83013f24..bd40b033 100644 --- a/stubs/networkx/algorithms/shortest_paths/unweighted.pyi +++ b/stubs/networkx/algorithms/shortest_paths/unweighted.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/shortest_paths/weighted.pyi b/stubs/networkx/algorithms/shortest_paths/weighted.pyi index 6c0cfa86..7e758d2d 100644 --- a/stubs/networkx/algorithms/shortest_paths/weighted.pyi +++ b/stubs/networkx/algorithms/shortest_paths/weighted.pyi @@ -1,7 +1,7 @@ from collections import deque +from collections.abc import Mapping from heapq import heappop, heappush from itertools import count -from typing import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/similarity.pyi b/stubs/networkx/algorithms/similarity.pyi index 0fd6583f..a0f28002 100644 --- a/stubs/networkx/algorithms/similarity.pyi +++ b/stubs/networkx/algorithms/similarity.pyi @@ -1,10 +1,11 @@ import math import time import warnings +from collections.abc import Mapping from functools import reduce from itertools import product from operator import mul -from typing import Callable, Mapping +from typing import Callable from ..classes.graph import Graph diff --git a/stubs/networkx/algorithms/structuralholes.pyi b/stubs/networkx/algorithms/structuralholes.pyi index 43394184..15a0e933 100644 --- a/stubs/networkx/algorithms/structuralholes.pyi +++ b/stubs/networkx/algorithms/structuralholes.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ..classes.graph import Graph diff --git a/stubs/networkx/algorithms/traversal/depth_first_search.pyi b/stubs/networkx/algorithms/traversal/depth_first_search.pyi index b6625845..ccbb5736 100644 --- a/stubs/networkx/algorithms/traversal/depth_first_search.pyi +++ b/stubs/networkx/algorithms/traversal/depth_first_search.pyi @@ -1,5 +1,5 @@ from collections import defaultdict -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/triads.pyi b/stubs/networkx/algorithms/triads.pyi index 2074e961..b7c489a2 100644 --- a/stubs/networkx/algorithms/triads.pyi +++ b/stubs/networkx/algorithms/triads.pyi @@ -1,7 +1,7 @@ from collections import defaultdict +from collections.abc import Mapping from itertools import combinations, permutations from random import sample -from typing import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/algorithms/voronoi.pyi b/stubs/networkx/algorithms/voronoi.pyi index b96a4341..821d1eda 100644 --- a/stubs/networkx/algorithms/voronoi.pyi +++ b/stubs/networkx/algorithms/voronoi.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ..classes.graph import Graph from ..utils import groups diff --git a/stubs/networkx/classes/graph.pyi b/stubs/networkx/classes/graph.pyi index 87a5a855..02aaa6f5 100644 --- a/stubs/networkx/classes/graph.pyi +++ b/stubs/networkx/classes/graph.pyi @@ -1,7 +1,6 @@ -from collections.abc import Iterable +from collections.abc import Iterable, Mapping from copy import deepcopy from functools import cached_property -from typing import Mapping import networkx.convert as convert from numpy.typing import ArrayLike diff --git a/stubs/networkx/classes/multigraph.pyi b/stubs/networkx/classes/multigraph.pyi index 5fcfc0c7..58ed6804 100644 --- a/stubs/networkx/classes/multigraph.pyi +++ b/stubs/networkx/classes/multigraph.pyi @@ -1,6 +1,6 @@ +from collections.abc import Mapping from copy import deepcopy from functools import cached_property -from typing import Mapping import networkx.convert as convert from networkx import NetworkXError diff --git a/stubs/networkx/convert.pyi b/stubs/networkx/convert.pyi index e29d0e42..ec398e3a 100644 --- a/stubs/networkx/convert.pyi +++ b/stubs/networkx/convert.pyi @@ -1,6 +1,5 @@ import warnings -from collections.abc import Collection, Generator, Iterator -from typing import Mapping +from collections.abc import Collection, Generator, Iterator, Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/drawing/layout.pyi b/stubs/networkx/drawing/layout.pyi index 67cdf970..8b4dfecb 100644 --- a/stubs/networkx/drawing/layout.pyi +++ b/stubs/networkx/drawing/layout.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/drawing/nx_agraph.pyi b/stubs/networkx/drawing/nx_agraph.pyi index 4c31092b..1ccd1f83 100644 --- a/stubs/networkx/drawing/nx_agraph.pyi +++ b/stubs/networkx/drawing/nx_agraph.pyi @@ -1,6 +1,7 @@ import os import tempfile -from typing import Callable, Mapping +from collections.abc import Mapping +from typing import Callable from ..classes.graph import Graph diff --git a/stubs/networkx/drawing/nx_pydot.pyi b/stubs/networkx/drawing/nx_pydot.pyi index 9c1f5f40..f792a014 100644 --- a/stubs/networkx/drawing/nx_pydot.pyi +++ b/stubs/networkx/drawing/nx_pydot.pyi @@ -1,6 +1,6 @@ import warnings +from collections.abc import Mapping from locale import getpreferredencoding -from typing import Mapping from ..classes.graph import Graph from ..classes.multidigraph import MultiDiGraph diff --git a/stubs/networkx/drawing/nx_pylab.pyi b/stubs/networkx/drawing/nx_pylab.pyi index fcd12935..3545ae53 100644 --- a/stubs/networkx/drawing/nx_pylab.pyi +++ b/stubs/networkx/drawing/nx_pylab.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from numbers import Number -from typing import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/generators/geometric.pyi b/stubs/networkx/generators/geometric.pyi index dd8e3ca5..ba2432ac 100644 --- a/stubs/networkx/generators/geometric.pyi +++ b/stubs/networkx/generators/geometric.pyi @@ -1,8 +1,7 @@ import math from bisect import bisect_left -from collections.abc import Iterable +from collections.abc import Iterable, Mapping from itertools import accumulate, combinations, product -from typing import Mapping from numpy.typing import ArrayLike diff --git a/stubs/networkx/generators/internet_as_graphs.pyi b/stubs/networkx/generators/internet_as_graphs.pyi index a8ccd6cc..9a917700 100644 --- a/stubs/networkx/generators/internet_as_graphs.pyi +++ b/stubs/networkx/generators/internet_as_graphs.pyi @@ -1,4 +1,5 @@ -from typing import Any, Mapping +from collections.abc import Mapping +from typing import Any from ..classes.graph import Graph from ..utils import py_random_state diff --git a/stubs/networkx/lazy_imports.pyi b/stubs/networkx/lazy_imports.pyi index e3df3c67..a091fabe 100644 --- a/stubs/networkx/lazy_imports.pyi +++ b/stubs/networkx/lazy_imports.pyi @@ -4,7 +4,7 @@ import inspect import os import sys import types -from typing import Mapping +from collections.abc import Mapping __all__ = ["attach"] diff --git a/stubs/networkx/readwrite/json_graph/adjacency.pyi b/stubs/networkx/readwrite/json_graph/adjacency.pyi index 4a32caae..ab450016 100644 --- a/stubs/networkx/readwrite/json_graph/adjacency.pyi +++ b/stubs/networkx/readwrite/json_graph/adjacency.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from itertools import chain -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/readwrite/json_graph/cytoscape.pyi b/stubs/networkx/readwrite/json_graph/cytoscape.pyi index 9f396638..32722248 100644 --- a/stubs/networkx/readwrite/json_graph/cytoscape.pyi +++ b/stubs/networkx/readwrite/json_graph/cytoscape.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/readwrite/json_graph/node_link.pyi b/stubs/networkx/readwrite/json_graph/node_link.pyi index f564d36a..c774da72 100644 --- a/stubs/networkx/readwrite/json_graph/node_link.pyi +++ b/stubs/networkx/readwrite/json_graph/node_link.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from itertools import chain, count -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/readwrite/json_graph/tree.pyi b/stubs/networkx/readwrite/json_graph/tree.pyi index 665370a3..c8ac60a9 100644 --- a/stubs/networkx/readwrite/json_graph/tree.pyi +++ b/stubs/networkx/readwrite/json_graph/tree.pyi @@ -1,5 +1,5 @@ +from collections.abc import Mapping from itertools import chain -from typing import Mapping from ...classes.graph import Graph diff --git a/stubs/networkx/relabel.pyi b/stubs/networkx/relabel.pyi index cdbcaabe..9fc84ed5 100644 --- a/stubs/networkx/relabel.pyi +++ b/stubs/networkx/relabel.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping from .classes.graph import Graph diff --git a/stubs/networkx/utils/decorators.pyi b/stubs/networkx/utils/decorators.pyi index 621f2b4a..c5862001 100644 --- a/stubs/networkx/utils/decorators.pyi +++ b/stubs/networkx/utils/decorators.pyi @@ -5,10 +5,11 @@ import inspect import itertools import re from collections import defaultdict +from collections.abc import Sequence from contextlib import contextmanager from os.path import splitext from pathlib import Path -from typing import Callable, Sequence +from typing import Callable from ..classes.graph import Graph from ..utils import create_py_random_state, create_random_state diff --git a/stubs/skimage/_shared/lazy.pyi b/stubs/skimage/_shared/lazy.pyi index 5e03b583..7fd2b0c5 100644 --- a/stubs/skimage/_shared/lazy.pyi +++ b/stubs/skimage/_shared/lazy.pyi @@ -2,7 +2,7 @@ import importlib import importlib.util import os import sys -from typing import Mapping +from collections.abc import Mapping def attach( package_name: str, diff --git a/stubs/skimage/_shared/tester.pyi b/stubs/skimage/_shared/tester.pyi index 5d2e45c7..68d3872e 100644 --- a/stubs/skimage/_shared/tester.pyi +++ b/stubs/skimage/_shared/tester.pyi @@ -6,7 +6,7 @@ from numpy.typing import ArrayLike def _show_skimage_info(): ... -class PytestTester(object): +class PytestTester: def __init__(self, module_name): ... def __call__( self, diff --git a/stubs/skimage/_shared/utils.pyi b/stubs/skimage/_shared/utils.pyi index 47362126..6982371a 100644 --- a/stubs/skimage/_shared/utils.pyi +++ b/stubs/skimage/_shared/utils.pyi @@ -2,8 +2,8 @@ import functools import inspect import sys import warnings -from collections.abc import Iterable -from typing import Any, Literal, Mapping +from collections.abc import Iterable, Mapping +from typing import Any, Literal import numpy as np import scipy diff --git a/stubs/skimage/feature/util.pyi b/stubs/skimage/feature/util.pyi index 6bd2c684..49fb16b3 100644 --- a/stubs/skimage/feature/util.pyi +++ b/stubs/skimage/feature/util.pyi @@ -4,11 +4,11 @@ import numpy as np from .._shared.utils import _supported_float_type, check_nD -class FeatureDetector(object): +class FeatureDetector: def __init__(self): ... def detect(self, image): ... -class DescriptorExtractor(object): +class DescriptorExtractor: def __init__(self): ... def extract(self, image, keypoints): ... diff --git a/stubs/skimage/future/graph/rag.pyi b/stubs/skimage/future/graph/rag.pyi index f5f0dfa9..04b27563 100644 --- a/stubs/skimage/future/graph/rag.pyi +++ b/stubs/skimage/future/graph/rag.pyi @@ -1,5 +1,6 @@ import math -from typing import Callable, Literal, Mapping, Sequence +from collections.abc import Mapping, Sequence +from typing import Callable, Literal import networkx as nx import numpy as np diff --git a/stubs/skimage/future/trainable_segmentation.pyi b/stubs/skimage/future/trainable_segmentation.pyi index 77ef1137..bab95a43 100644 --- a/stubs/skimage/future/trainable_segmentation.pyi +++ b/stubs/skimage/future/trainable_segmentation.pyi @@ -2,7 +2,7 @@ from numpy.typing import NDArray from ..feature import multiscale_basic_features -class TrainableSegmenter(object): +class TrainableSegmenter: def __init__(self, clf=None, features_func=None): ... def compute_features(self, image): ... def fit(self, image: NDArray, labels: NDArray): ... diff --git a/stubs/skimage/measure/_marching_cubes_lewiner_luts.pyi b/stubs/skimage/measure/_marching_cubes_lewiner_luts.pyi index 4fe9ff6c..5fec7595 100644 --- a/stubs/skimage/measure/_marching_cubes_lewiner_luts.pyi +++ b/stubs/skimage/measure/_marching_cubes_lewiner_luts.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # This file was auto-generated from `mc_meta/LookUpTable.h` by # `mc_meta/createluts.py`. diff --git a/stubs/skimage/measure/_regionprops.pyi b/stubs/skimage/measure/_regionprops.pyi index 7a0b2397..6dfe5782 100644 --- a/stubs/skimage/measure/_regionprops.pyi +++ b/stubs/skimage/measure/_regionprops.pyi @@ -1,7 +1,7 @@ import inspect +from collections.abc import Mapping from functools import wraps from math import atan2, pi as PI, sqrt -from typing import Mapping from warnings import warn import numpy as np diff --git a/stubs/skimage/measure/block.pyi b/stubs/skimage/measure/block.pyi index 8c71bd02..d25e04b4 100644 --- a/stubs/skimage/measure/block.pyi +++ b/stubs/skimage/measure/block.pyi @@ -1,4 +1,5 @@ -from typing import Callable, Mapping +from collections.abc import Mapping +from typing import Callable import numpy as np from numpy.typing import NDArray diff --git a/stubs/skimage/measure/fit.pyi b/stubs/skimage/measure/fit.pyi index 0883b955..dc23208f 100644 --- a/stubs/skimage/measure/fit.pyi +++ b/stubs/skimage/measure/fit.pyi @@ -10,7 +10,7 @@ from scipy import optimize, spatial def _check_data_dim(data, dim): ... def _check_data_atleast_2D(data): ... -class BaseModel(object): +class BaseModel: def __init__(self): ... class LineModelND(BaseModel): diff --git a/stubs/skimage/transform/_geometric.pyi b/stubs/skimage/transform/_geometric.pyi index 7868abb6..b8ccb5f7 100644 --- a/stubs/skimage/transform/_geometric.pyi +++ b/stubs/skimage/transform/_geometric.pyi @@ -1,6 +1,6 @@ import math import textwrap -from typing import Sequence +from collections.abc import Sequence import numpy as np from numpy.typing import ArrayLike @@ -12,7 +12,7 @@ def _affine_matrix_from_vector(v): ... def _center_and_normalize_points(points): ... def _umeyama(src, dst, estimate_scale): ... -class GeometricTransform(object): +class GeometricTransform: def __call__(self, coords): ... def inverse(self, coords): ... def residuals(self, src, dst): ... diff --git a/stubs/skimage/transform/_warps.pyi b/stubs/skimage/transform/_warps.pyi index d5e0ae91..56390560 100644 --- a/stubs/skimage/transform/_warps.pyi +++ b/stubs/skimage/transform/_warps.pyi @@ -1,5 +1,5 @@ -from collections.abc import Iterable -from typing import Literal, Mapping +from collections.abc import Iterable, Mapping +from typing import Literal import numpy as np import scipy diff --git a/stubs/sklearn/_config.pyi b/stubs/sklearn/_config.pyi index 45334bf6..cb83b0df 100644 --- a/stubs/sklearn/_config.pyi +++ b/stubs/sklearn/_config.pyi @@ -1,7 +1,8 @@ import os import threading +from collections.abc import Iterator from contextlib import contextmanager as contextmanager -from typing import Iterator, Literal +from typing import Literal from ._typing import Int diff --git a/stubs/sklearn/_loss/loss.pyi b/stubs/sklearn/_loss/loss.pyi index 3057087e..498d1d26 100644 --- a/stubs/sklearn/_loss/loss.pyi +++ b/stubs/sklearn/_loss/loss.pyi @@ -1,5 +1,5 @@ import numbers -from typing import ClassVar, Literal, Type +from typing import ClassVar, Literal import numpy as np from numpy import ndarray @@ -127,7 +127,7 @@ class BaseLoss: def init_gradient_and_hessian( self, n_samples: Int, - dtype: Type[Float] | Float = ..., + dtype: type[Float] | Float = ..., order: Literal["C", "F"] = "F", ) -> tuple[ndarray, ndarray]: ... diff --git a/stubs/sklearn/base.pyi b/stubs/sklearn/base.pyi index 9fbe1c41..b326dfac 100644 --- a/stubs/sklearn/base.pyi +++ b/stubs/sklearn/base.pyi @@ -1,5 +1,6 @@ from collections import defaultdict as defaultdict -from typing import Any, ClassVar, Iterable, TypeVar +from collections.abc import Iterable +from typing import Any, ClassVar, TypeVar from numpy import ndarray diff --git a/stubs/sklearn/calibration.pyi b/stubs/sklearn/calibration.pyi index 07e49b44..055781e5 100644 --- a/stubs/sklearn/calibration.pyi +++ b/stubs/sklearn/calibration.pyi @@ -1,8 +1,9 @@ +from collections.abc import Iterable from functools import partial as partial from inspect import signature as signature from math import log as log from numbers import Integral as Integral -from typing import ClassVar, Iterable, Literal, TypeVar +from typing import ClassVar, Literal, TypeVar from matplotlib.artist import Artist from matplotlib.axes import Axes diff --git a/stubs/sklearn/cluster/_agglomerative.pyi b/stubs/sklearn/cluster/_agglomerative.pyi index f895fa88..db293483 100644 --- a/stubs/sklearn/cluster/_agglomerative.pyi +++ b/stubs/sklearn/cluster/_agglomerative.pyi @@ -1,6 +1,6 @@ from heapq import heapify as heapify, heappop as heappop, heappush as heappush, heappushpop as heappushpop from numbers import Integral as Integral, Real as Real -from typing import Any, Callable, ClassVar, Literal, Set, TypeVar +from typing import Any, Callable, ClassVar, Literal, TypeVar from joblib import Memory from numpy import ndarray diff --git a/stubs/sklearn/cluster/_bisect_k_means.pyi b/stubs/sklearn/cluster/_bisect_k_means.pyi index 2304cc74..3dd27d21 100644 --- a/stubs/sklearn/cluster/_bisect_k_means.pyi +++ b/stubs/sklearn/cluster/_bisect_k_means.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, ClassVar, Iterator, Literal, TypeVar +from collections.abc import Iterator +from typing import Any, Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/cluster/_spectral.pyi b/stubs/sklearn/cluster/_spectral.pyi index fb7efb52..7c93ea1d 100644 --- a/stubs/sklearn/cluster/_spectral.pyi +++ b/stubs/sklearn/cluster/_spectral.pyi @@ -1,5 +1,6 @@ +from collections.abc import Mapping from numbers import Integral as Integral, Real as Real -from typing import Any, Callable, ClassVar, Literal, Mapping, TypeVar +from typing import Any, Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/compose/_column_transformer.pyi b/stubs/sklearn/compose/_column_transformer.pyi index 77a5df85..76cf85b3 100644 --- a/stubs/sklearn/compose/_column_transformer.pyi +++ b/stubs/sklearn/compose/_column_transformer.pyi @@ -1,6 +1,7 @@ from collections import Counter as Counter +from collections.abc import Sequence from itertools import chain as chain -from typing import ClassVar, Literal, Sequence, TypeVar +from typing import ClassVar, Literal, TypeVar from numpy import dtype, ndarray from scipy import sparse as sparse diff --git a/stubs/sklearn/conftest.pyi b/stubs/sklearn/conftest.pyi index 4a4b9fb0..50ff03ee 100644 --- a/stubs/sklearn/conftest.pyi +++ b/stubs/sklearn/conftest.pyi @@ -1,8 +1,8 @@ import platform import sys +from collections.abc import Sequence from functools import wraps as wraps from os import environ as environ -from typing import Sequence import numpy as np import pytest diff --git a/stubs/sklearn/covariance/_graph_lasso.pyi b/stubs/sklearn/covariance/_graph_lasso.pyi index 4f864d76..08c41405 100644 --- a/stubs/sklearn/covariance/_graph_lasso.pyi +++ b/stubs/sklearn/covariance/_graph_lasso.pyi @@ -1,5 +1,6 @@ +from collections.abc import Iterable from numbers import Integral as Integral, Real as Real -from typing import Any, ClassVar, Iterable, Literal, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from numpy import ndarray from scipy import linalg as linalg diff --git a/stubs/sklearn/datasets/_arff_parser.pyi b/stubs/sklearn/datasets/_arff_parser.pyi index ba67433e..23b097e6 100644 --- a/stubs/sklearn/datasets/_arff_parser.pyi +++ b/stubs/sklearn/datasets/_arff_parser.pyi @@ -1,9 +1,9 @@ import itertools import re from collections import OrderedDict as OrderedDict -from collections.abc import Generator as Generator +from collections.abc import Generator as Generator, Sequence from gzip import GzipFile -from typing import Any, Literal, Sequence +from typing import Any, Literal import numpy as np import scipy as sp diff --git a/stubs/sklearn/datasets/_base.pyi b/stubs/sklearn/datasets/_base.pyi index bc5a9710..2b2cb2bd 100644 --- a/stubs/sklearn/datasets/_base.pyi +++ b/stubs/sklearn/datasets/_base.pyi @@ -8,11 +8,12 @@ import hashlib import os import shutil from collections import namedtuple as namedtuple +from collections.abc import Sequence from importlib import resources as resources from os import environ as environ, listdir as listdir, makedirs as makedirs from os.path import expanduser as expanduser, isdir as isdir, join as join, splitext as splitext from pathlib import Path as Path -from typing import Literal, Sequence +from typing import Literal from urllib.request import urlretrieve as urlretrieve import numpy as np diff --git a/stubs/sklearn/datasets/_openml.pyi b/stubs/sklearn/datasets/_openml.pyi index ceab1a9c..bc7f3f47 100644 --- a/stubs/sklearn/datasets/_openml.pyi +++ b/stubs/sklearn/datasets/_openml.pyi @@ -8,7 +8,7 @@ from contextlib import closing as closing from functools import wraps as wraps from os.path import join as join from tempfile import TemporaryDirectory as TemporaryDirectory -from typing import List, Literal, Optional, Union, overload +from typing import Literal, overload from urllib.error import HTTPError as HTTPError, URLError as URLError from urllib.request import Request as Request, urlopen as urlopen from warnings import warn @@ -35,31 +35,31 @@ class OpenMLError(ValueError): ... @overload def fetch_openml( - name: Optional[str] = None, + name: str | None = None, *, - version: Union[str, int] = "active", - data_id: Optional[int] = None, - data_home: Optional[str] = None, - target_column: Optional[Union[str, List]] = "default-target", + version: str | int = "active", + data_id: int | None = None, + data_home: str | None = None, + target_column: str | list | None = "default-target", cache: bool = True, return_X_y: Literal[False] = ..., - as_frame: Union[str, bool] = "auto", + as_frame: str | bool = "auto", n_retries: int = 3, delay: float = 1.0, - parser: Optional[str] = "warn", + parser: str | None = "warn", ) -> Bunch: ... @overload def fetch_openml( - name: Optional[str] = None, + name: str | None = None, *, - version: Union[str, int] = "active", - data_id: Optional[int] = None, - data_home: Optional[str] = None, - target_column: Optional[Union[str, List]] = "default-target", + version: str | int = "active", + data_id: int | None = None, + data_home: str | None = None, + target_column: str | list | None = "default-target", cache: bool = True, return_X_y: Literal[True] = ..., - as_frame: Union[str, bool] = "auto", + as_frame: str | bool = "auto", n_retries: int = 3, delay: float = 1.0, - parser: Optional[str] = "warn", + parser: str | None = "warn", ) -> tuple[Bunch, tuple]: ... diff --git a/stubs/sklearn/datasets/_samples_generator.pyi b/stubs/sklearn/datasets/_samples_generator.pyi index 23578f55..1db93d0b 100644 --- a/stubs/sklearn/datasets/_samples_generator.pyi +++ b/stubs/sklearn/datasets/_samples_generator.pyi @@ -1,8 +1,8 @@ import array import numbers import warnings -from collections.abc import Iterable -from typing import Iterable, Literal, Sequence +from collections.abc import Iterable, Sequence +from typing import Literal import numpy as np import scipy.sparse as sp diff --git a/stubs/sklearn/ensemble/_base.pyi b/stubs/sklearn/ensemble/_base.pyi index 4e5af4ce..14b1ab9e 100644 --- a/stubs/sklearn/ensemble/_base.pyi +++ b/stubs/sklearn/ensemble/_base.pyi @@ -1,6 +1,7 @@ import warnings from abc import ABCMeta, abstractmethod -from typing import Any, ClassVar, List, Sequence, TypeVar +from collections.abc import Sequence +from typing import Any, ClassVar from typing_extensions import Self import numpy as np @@ -20,7 +21,7 @@ class BaseEnsemble(MetaEstimatorMixin, BaseEstimator, metaclass=ABCMeta): estimators_: list[BaseEstimator] = ... # overwrite _required_parameters from MetaEstimatorMixin - _required_parameters: ClassVar[List[str]] = ... + _required_parameters: ClassVar[list[str]] = ... @abstractmethod def __init__( diff --git a/stubs/sklearn/ensemble/_forest.pyi b/stubs/sklearn/ensemble/_forest.pyi index 8f604de2..e63e8682 100644 --- a/stubs/sklearn/ensemble/_forest.pyi +++ b/stubs/sklearn/ensemble/_forest.pyi @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Mapping, Sequence from numbers import Integral as Integral, Real as Real -from typing import Any, ClassVar, Literal, Mapping, Sequence, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from warnings import catch_warnings as catch_warnings, simplefilter as simplefilter, warn as warn from numpy import ndarray diff --git a/stubs/sklearn/ensemble/_gb.pyi b/stubs/sklearn/ensemble/_gb.pyi index 2592e96e..928067b2 100644 --- a/stubs/sklearn/ensemble/_gb.pyi +++ b/stubs/sklearn/ensemble/_gb.pyi @@ -1,7 +1,8 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Iterator from numbers import Integral as Integral, Real as Real from time import time as time -from typing import Callable, ClassVar, Iterator, Literal, TypeVar +from typing import Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi b/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi index 09dddb5d..bad4136b 100644 --- a/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi +++ b/stubs/sklearn/ensemble/_hist_gradient_boosting/binning.pyi @@ -1,4 +1,5 @@ -from typing import Sequence, TypeVar +from collections.abc import Sequence +from typing import TypeVar from numpy import ndarray, uint8 from numpy.random import RandomState diff --git a/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi b/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi index f75a3513..f425a745 100644 --- a/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi +++ b/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi @@ -1,8 +1,9 @@ from abc import ABC, abstractmethod +from collections.abc import Mapping, Sequence from functools import partial as partial from numbers import Integral as Integral, Real as Real from timeit import default_timer as time -from typing import Callable, ClassVar, Literal, Mapping, Sequence, TypeVar +from typing import Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/ensemble/_stacking.pyi b/stubs/sklearn/ensemble/_stacking.pyi index 34f50c51..0b3d114f 100644 --- a/stubs/sklearn/ensemble/_stacking.pyi +++ b/stubs/sklearn/ensemble/_stacking.pyi @@ -1,7 +1,8 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Iterable, Sequence from copy import deepcopy as deepcopy from numbers import Integral as Integral -from typing import ClassVar, Iterable, Literal, Sequence, TypeVar +from typing import ClassVar, Literal, TypeVar from numpy import ndarray diff --git a/stubs/sklearn/ensemble/_weight_boosting.pyi b/stubs/sklearn/ensemble/_weight_boosting.pyi index 873f60c7..dc867db8 100644 --- a/stubs/sklearn/ensemble/_weight_boosting.pyi +++ b/stubs/sklearn/ensemble/_weight_boosting.pyi @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Iterator from numbers import Integral as Integral, Real as Real -from typing import Any, ClassVar, Iterator, Literal, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/externals/_arff.pyi b/stubs/sklearn/externals/_arff.pyi index 4cafb89a..56f2d88c 100644 --- a/stubs/sklearn/externals/_arff.pyi +++ b/stubs/sklearn/externals/_arff.pyi @@ -1,4 +1,4 @@ -from typing import ClassVar, Literal, Optional +from typing import ClassVar, Literal from typing_extensions import TypedDict as TypedDict # ============================================================================= @@ -66,7 +66,7 @@ _SUPPORTED_DATA_STRUCTURES: list = ... # EXCEPTIONS ================================================================== class ArffException(Exception): - message: ClassVar[Optional[str]] = ... + message: ClassVar[str | None] = ... def __init__(self) -> None: ... diff --git a/stubs/sklearn/externals/_numpy_compiler_patch.pyi b/stubs/sklearn/externals/_numpy_compiler_patch.pyi index 208e02fe..e13a952c 100644 --- a/stubs/sklearn/externals/_numpy_compiler_patch.pyi +++ b/stubs/sklearn/externals/_numpy_compiler_patch.pyi @@ -13,8 +13,8 @@ import os import re import subprocess import sys +from collections.abc import Mapping, Sequence from distutils.errors import DistutilsExecError -from typing import Mapping, Sequence from numpy.distutils import log diff --git a/stubs/sklearn/externals/_packaging/version.pyi b/stubs/sklearn/externals/_packaging/version.pyi index 8b6fcd80..6153de39 100644 --- a/stubs/sklearn/externals/_packaging/version.pyi +++ b/stubs/sklearn/externals/_packaging/version.pyi @@ -1,5 +1,5 @@ import typing_extensions -from typing import Callable, ClassVar, Optional, Tuple, Union +from typing import Callable, ClassVar from ._structures import ( Infinity as Infinity, @@ -34,32 +34,24 @@ from ._structures import ( __all__ = ["parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"] -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[ - SubLocalType, - Tuple[SubLocalType, str], - Tuple[NegativeInfinityType, SubLocalType], - ], - ..., - ], -] -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] +InfiniteTypes: typing_extensions.TypeAlias = InfinityType | NegativeInfinityType +PrePostDevType: typing_extensions.TypeAlias = InfiniteTypes | tuple[str, int] +SubLocalType: typing_extensions.TypeAlias = InfiniteTypes | int | str +LocalType: typing_extensions.TypeAlias = ( + NegativeInfinityType | tuple[SubLocalType | tuple[SubLocalType, str] | tuple[NegativeInfinityType, SubLocalType], ...] +) +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[[CmpKey | LegacyCmpKey, CmpKey | LegacyCmpKey], bool] _Version = ... -def parse(version: str) -> Union[LegacyVersion, Version]: ... +def parse(version: str) -> LegacyVersion | Version: ... class InvalidVersion(ValueError): ... class _BaseVersion: - _key: ClassVar[Union[CmpKey, LegacyCmpKey]] = ... + _key: ClassVar[CmpKey | LegacyCmpKey] = ... def __hash__(self) -> int: ... @@ -100,11 +92,11 @@ class Version(_BaseVersion): def __init__(self, version: str) -> None: ... def epoch(self) -> int: ... - def release(self) -> Tuple[int, ...]: ... - def pre(self) -> Optional[Tuple[str, int]]: ... - def post(self) -> Optional[int]: ... - def dev(self) -> Optional[int]: ... - def local(self) -> Optional[str]: ... + def release(self) -> tuple[int, ...]: ... + def pre(self) -> tuple[str, int] | None: ... + def post(self) -> int | None: ... + def dev(self) -> int | None: ... + def local(self) -> str | None: ... def public(self) -> str: ... def base_version(self) -> str: ... def is_prerelease(self) -> bool: ... diff --git a/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi b/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi index e48fcede..01ca9ab3 100644 --- a/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi +++ b/stubs/sklearn/feature_extraction/_dict_vectorizer.pyi @@ -1,8 +1,8 @@ from array import array as array -from collections.abc import Iterable, Mapping +from collections.abc import Iterable, Iterator, Mapping from numbers import Number as Number from operator import itemgetter as itemgetter -from typing import Any, ClassVar, Iterable, Iterator, Mapping, TypeVar +from typing import Any, ClassVar, TypeVar from numpy import ndarray from scipy.sparse import spmatrix diff --git a/stubs/sklearn/feature_extraction/_hash.pyi b/stubs/sklearn/feature_extraction/_hash.pyi index 4294bf78..0a8aa39d 100644 --- a/stubs/sklearn/feature_extraction/_hash.pyi +++ b/stubs/sklearn/feature_extraction/_hash.pyi @@ -1,6 +1,7 @@ +from collections.abc import Iterator from itertools import chain as chain from numbers import Integral as Integral -from typing import Any, ClassVar, Iterator, TypeVar +from typing import Any, ClassVar, TypeVar from numpy import dtype from scipy.sparse import spmatrix diff --git a/stubs/sklearn/feature_extraction/text.pyi b/stubs/sklearn/feature_extraction/text.pyi index 2f8afb97..0f816ef7 100644 --- a/stubs/sklearn/feature_extraction/text.pyi +++ b/stubs/sklearn/feature_extraction/text.pyi @@ -1,9 +1,9 @@ from collections import defaultdict as defaultdict -from collections.abc import Mapping +from collections.abc import Iterable, Mapping from functools import partial from numbers import Integral as Integral, Real as Real from operator import itemgetter as itemgetter -from typing import Any, Callable, ClassVar, Iterable, Literal, Mapping, TypeVar +from typing import Any, Callable, ClassVar, Literal, TypeVar from numpy import ndarray from scipy.sparse import spmatrix diff --git a/stubs/sklearn/feature_selection/_rfe.pyi b/stubs/sklearn/feature_selection/_rfe.pyi index e12230b2..eec569f8 100644 --- a/stubs/sklearn/feature_selection/_rfe.pyi +++ b/stubs/sklearn/feature_selection/_rfe.pyi @@ -1,5 +1,6 @@ +from collections.abc import Iterable from numbers import Integral as Integral, Real as Real -from typing import Callable, ClassVar, Iterable, TypeVar +from typing import Callable, ClassVar, TypeVar from joblib import effective_n_jobs as effective_n_jobs from numpy import ndarray diff --git a/stubs/sklearn/feature_selection/_sequential.pyi b/stubs/sklearn/feature_selection/_sequential.pyi index 84cbcd84..35cd11ab 100644 --- a/stubs/sklearn/feature_selection/_sequential.pyi +++ b/stubs/sklearn/feature_selection/_sequential.pyi @@ -1,5 +1,6 @@ +from collections.abc import Iterable from numbers import Integral as Integral, Real as Real -from typing import Callable, ClassVar, Iterable, Literal, TypeVar +from typing import Callable, ClassVar, Literal, TypeVar from numpy import ndarray diff --git a/stubs/sklearn/gaussian_process/kernels.pyi b/stubs/sklearn/gaussian_process/kernels.pyi index 0e4e3e7f..741bd494 100644 --- a/stubs/sklearn/gaussian_process/kernels.pyi +++ b/stubs/sklearn/gaussian_process/kernels.pyi @@ -1,7 +1,8 @@ from abc import ABCMeta, abstractmethod from collections import namedtuple +from collections.abc import Sequence from inspect import signature as signature -from typing import Callable, Literal, Sequence, TypeVar +from typing import Callable, Literal, TypeVar from numpy import ndarray from scipy.spatial.distance import cdist as cdist, pdist as pdist, squareform as squareform diff --git a/stubs/sklearn/inspection/_partial_dependence.pyi b/stubs/sklearn/inspection/_partial_dependence.pyi index ca1d0cc1..cab3fc6a 100644 --- a/stubs/sklearn/inspection/_partial_dependence.pyi +++ b/stubs/sklearn/inspection/_partial_dependence.pyi @@ -1,5 +1,5 @@ -from collections.abc import Iterable as Iterable -from typing import Literal, Sequence +from collections.abc import Iterable as Iterable, Sequence +from typing import Literal import numpy as np from scipy import sparse as sparse diff --git a/stubs/sklearn/inspection/_permutation_importance.pyi b/stubs/sklearn/inspection/_permutation_importance.pyi index 8701f684..c95ab986 100644 --- a/stubs/sklearn/inspection/_permutation_importance.pyi +++ b/stubs/sklearn/inspection/_permutation_importance.pyi @@ -1,5 +1,6 @@ import numbers -from typing import Any, Callable, Mapping +from collections.abc import Mapping +from typing import Any, Callable import numpy as np from numpy.random import RandomState diff --git a/stubs/sklearn/inspection/_plot/partial_dependence.pyi b/stubs/sklearn/inspection/_plot/partial_dependence.pyi index eeaa2d99..6d50d2eb 100644 --- a/stubs/sklearn/inspection/_plot/partial_dependence.pyi +++ b/stubs/sklearn/inspection/_plot/partial_dependence.pyi @@ -1,8 +1,9 @@ import numbers import warnings +from collections.abc import Mapping, Sequence from itertools import chain as chain from math import ceil as ceil -from typing import Literal, Mapping, Sequence +from typing import Literal import numpy as np from matplotlib.axes import Axes diff --git a/stubs/sklearn/linear_model/_coordinate_descent.pyi b/stubs/sklearn/linear_model/_coordinate_descent.pyi index 2ecc942b..55024596 100644 --- a/stubs/sklearn/linear_model/_coordinate_descent.pyi +++ b/stubs/sklearn/linear_model/_coordinate_descent.pyi @@ -1,7 +1,8 @@ from abc import ABC, abstractmethod +from collections.abc import Iterable, Sequence from functools import partial as partial from numbers import Integral as Integral, Real as Real -from typing import ClassVar, Iterable, Literal, Sequence, TypeVar +from typing import ClassVar, Literal, TypeVar from joblib import effective_n_jobs as effective_n_jobs from numpy import ndarray diff --git a/stubs/sklearn/linear_model/_least_angle.pyi b/stubs/sklearn/linear_model/_least_angle.pyi index 7dfc185f..021a0827 100644 --- a/stubs/sklearn/linear_model/_least_angle.pyi +++ b/stubs/sklearn/linear_model/_least_angle.pyi @@ -1,6 +1,7 @@ +from collections.abc import Iterable from math import log as log from numbers import Integral as Integral, Real as Real -from typing import ClassVar, Iterable, Literal, TypeVar +from typing import ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/linear_model/_linear_loss.pyi b/stubs/sklearn/linear_model/_linear_loss.pyi index 80206334..3ae8e980 100644 --- a/stubs/sklearn/linear_model/_linear_loss.pyi +++ b/stubs/sklearn/linear_model/_linear_loss.pyi @@ -1,4 +1,4 @@ -from typing import Callable, Type +from typing import Callable import numpy as np from numpy import bool_, ndarray @@ -10,7 +10,7 @@ from ..utils.extmath import squared_norm as squared_norm class LinearModelLoss: def __init__(self, base_loss: BaseLoss, fit_intercept: bool) -> None: ... - def init_zero_coef(self, X: ndarray, dtype: None | Type[Float] = None) -> ndarray: ... + def init_zero_coef(self, X: ndarray, dtype: None | type[Float] = None) -> ndarray: ... def weight_intercept( self, coef: MatrixLike | ArrayLike ) -> tuple[ndarray, Float] | tuple[ndarray, ndarray] | tuple[ndarray, float | ndarray]: ... diff --git a/stubs/sklearn/linear_model/_logistic.pyi b/stubs/sklearn/linear_model/_logistic.pyi index 902df9d3..83c4a9bf 100644 --- a/stubs/sklearn/linear_model/_logistic.pyi +++ b/stubs/sklearn/linear_model/_logistic.pyi @@ -1,5 +1,6 @@ +from collections.abc import Mapping, Sequence from numbers import Integral as Integral, Real as Real -from typing import Callable, ClassVar, Literal, Mapping, Sequence, TypeVar +from typing import Callable, ClassVar, Literal, TypeVar from joblib import effective_n_jobs as effective_n_jobs from numpy import ndarray diff --git a/stubs/sklearn/linear_model/_omp.pyi b/stubs/sklearn/linear_model/_omp.pyi index 217f9187..903b022c 100644 --- a/stubs/sklearn/linear_model/_omp.pyi +++ b/stubs/sklearn/linear_model/_omp.pyi @@ -1,6 +1,7 @@ +from collections.abc import Iterable from math import sqrt as sqrt from numbers import Integral as Integral, Real as Real -from typing import ClassVar, Iterable, Literal, TypeVar +from typing import ClassVar, Literal, TypeVar from numpy import ndarray from scipy import linalg as linalg diff --git a/stubs/sklearn/linear_model/_passive_aggressive.pyi b/stubs/sklearn/linear_model/_passive_aggressive.pyi index 97f06523..68fde643 100644 --- a/stubs/sklearn/linear_model/_passive_aggressive.pyi +++ b/stubs/sklearn/linear_model/_passive_aggressive.pyi @@ -1,5 +1,6 @@ +from collections.abc import Mapping from numbers import Real as Real -from typing import Callable, ClassVar, Mapping, TypeVar +from typing import Callable, ClassVar, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/linear_model/_perceptron.pyi b/stubs/sklearn/linear_model/_perceptron.pyi index 9162a572..ad9c2fee 100644 --- a/stubs/sklearn/linear_model/_perceptron.pyi +++ b/stubs/sklearn/linear_model/_perceptron.pyi @@ -1,5 +1,6 @@ +from collections.abc import Mapping from numbers import Real as Real -from typing import ClassVar, Literal, Mapping +from typing import ClassVar, Literal from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/linear_model/_ridge.pyi b/stubs/sklearn/linear_model/_ridge.pyi index 9faeb23f..4251b19f 100644 --- a/stubs/sklearn/linear_model/_ridge.pyi +++ b/stubs/sklearn/linear_model/_ridge.pyi @@ -1,7 +1,8 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Iterable, Mapping from functools import partial as partial from numbers import Integral as Integral, Real as Real -from typing import Callable, ClassVar, Iterable, Literal, Mapping, TypeVar +from typing import Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/linear_model/_stochastic_gradient.pyi b/stubs/sklearn/linear_model/_stochastic_gradient.pyi index 4ae45e4c..0c712c7e 100644 --- a/stubs/sklearn/linear_model/_stochastic_gradient.pyi +++ b/stubs/sklearn/linear_model/_stochastic_gradient.pyi @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Mapping from numbers import Integral as Integral, Real as Real -from typing import Any, ClassVar, Literal, Mapping, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/metrics/_dist_metrics.pyi b/stubs/sklearn/metrics/_dist_metrics.pyi index b2bd94bc..10b190d1 100644 --- a/stubs/sklearn/metrics/_dist_metrics.pyi +++ b/stubs/sklearn/metrics/_dist_metrics.pyi @@ -1,4 +1,5 @@ -from typing import Any, Iterable +from collections.abc import Iterable +from typing import Any import numpy as np from scipy.sparse import csr_matrix diff --git a/stubs/sklearn/metrics/pairwise.pyi b/stubs/sklearn/metrics/pairwise.pyi index 6c7d41ea..b8017655 100644 --- a/stubs/sklearn/metrics/pairwise.pyi +++ b/stubs/sklearn/metrics/pairwise.pyi @@ -1,7 +1,8 @@ import itertools import warnings +from collections.abc import Iterator, Sequence from functools import partial as partial -from typing import Callable, Iterator, Sequence +from typing import Callable import numpy as np from joblib import effective_n_jobs as effective_n_jobs diff --git a/stubs/sklearn/model_selection/_plot.pyi b/stubs/sklearn/model_selection/_plot.pyi index fa2aecf7..d01af018 100644 --- a/stubs/sklearn/model_selection/_plot.pyi +++ b/stubs/sklearn/model_selection/_plot.pyi @@ -1,4 +1,5 @@ -from typing import Callable, Iterable, Literal +from collections.abc import Iterable +from typing import Callable, Literal import numpy as np from matplotlib.artist import Artist diff --git a/stubs/sklearn/model_selection/_search.pyi b/stubs/sklearn/model_selection/_search.pyi index f82bd72e..5d4c2904 100644 --- a/stubs/sklearn/model_selection/_search.pyi +++ b/stubs/sklearn/model_selection/_search.pyi @@ -1,9 +1,9 @@ from abc import ABCMeta, abstractmethod from collections import defaultdict as defaultdict -from collections.abc import Iterable, Mapping, Sequence +from collections.abc import Iterable, Iterator, Mapping, Sequence from functools import partial as partial, reduce as reduce from itertools import product as product -from typing import Any, Callable, ClassVar, Generic, Iterable, Iterator, Mapping, Sequence, TypeVar +from typing import Any, Callable, ClassVar, Generic, TypeVar from numpy import ndarray from numpy.ma import MaskedArray as MaskedArray diff --git a/stubs/sklearn/model_selection/_search_successive_halving.pyi b/stubs/sklearn/model_selection/_search_successive_halving.pyi index 435d8f3c..e7051101 100644 --- a/stubs/sklearn/model_selection/_search_successive_halving.pyi +++ b/stubs/sklearn/model_selection/_search_successive_halving.pyi @@ -1,8 +1,9 @@ from abc import abstractmethod as abstractmethod +from collections.abc import Iterable, Iterator, Mapping, Sequence from copy import deepcopy as deepcopy from math import ceil as ceil, floor as floor, log as log from numbers import Integral as Integral -from typing import Callable, ClassVar, Iterable, Iterator, Literal, Mapping, Sequence, TypeVar +from typing import Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/model_selection/_split.pyi b/stubs/sklearn/model_selection/_split.pyi index 82764188..dd90ecd0 100644 --- a/stubs/sklearn/model_selection/_split.pyi +++ b/stubs/sklearn/model_selection/_split.pyi @@ -2,11 +2,11 @@ import numbers import warnings from abc import ABCMeta, abstractmethod from collections import defaultdict as defaultdict -from collections.abc import Iterable +from collections.abc import Iterable, Iterator from inspect import signature as signature from itertools import chain as chain, combinations as combinations from math import ceil as ceil, floor as floor -from typing import Any, Callable, Iterable, Iterator +from typing import Any, Callable import numpy as np from numpy import ndarray diff --git a/stubs/sklearn/model_selection/_validation.pyi b/stubs/sklearn/model_selection/_validation.pyi index 39adc37b..64ed37b8 100644 --- a/stubs/sklearn/model_selection/_validation.pyi +++ b/stubs/sklearn/model_selection/_validation.pyi @@ -2,10 +2,11 @@ import numbers import time import warnings from collections import Counter as Counter +from collections.abc import Iterable, Mapping from contextlib import suppress as suppress from functools import partial as partial from traceback import format_exc as format_exc -from typing import Callable, Iterable, Literal, Mapping +from typing import Callable, Literal import numpy as np import scipy.sparse as sp diff --git a/stubs/sklearn/multioutput.pyi b/stubs/sklearn/multioutput.pyi index 9bd4ad61..ee4be15b 100644 --- a/stubs/sklearn/multioutput.pyi +++ b/stubs/sklearn/multioutput.pyi @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Sequence from numbers import Integral as Integral -from typing import ClassVar, Sequence, TypeVar +from typing import ClassVar, TypeVar from numpy import ndarray from scipy.sparse import spmatrix diff --git a/stubs/sklearn/neural_network/_stochastic_optimizers.pyi b/stubs/sklearn/neural_network/_stochastic_optimizers.pyi index 61309348..23d7eb0e 100644 --- a/stubs/sklearn/neural_network/_stochastic_optimizers.pyi +++ b/stubs/sklearn/neural_network/_stochastic_optimizers.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal import numpy as np from numpy import ndarray diff --git a/stubs/sklearn/pipeline.pyi b/stubs/sklearn/pipeline.pyi index 486e1eeb..dce9c716 100644 --- a/stubs/sklearn/pipeline.pyi +++ b/stubs/sklearn/pipeline.pyi @@ -1,6 +1,7 @@ from collections import defaultdict as defaultdict +from collections.abc import Iterable, Sequence from itertools import islice as islice -from typing import Any, ClassVar, Iterable, Literal, Sequence, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from joblib import Memory from numpy import ndarray diff --git a/stubs/sklearn/preprocessing/_encoders.pyi b/stubs/sklearn/preprocessing/_encoders.pyi index 75ab7ac0..f1f50ea4 100644 --- a/stubs/sklearn/preprocessing/_encoders.pyi +++ b/stubs/sklearn/preprocessing/_encoders.pyi @@ -1,5 +1,6 @@ +from collections.abc import Sequence from numbers import Integral as Integral, Real as Real -from typing import ClassVar, Literal, Sequence, TypeVar +from typing import ClassVar, Literal, TypeVar from numpy import ndarray from pandas.core.series import Series diff --git a/stubs/sklearn/preprocessing/_label.pyi b/stubs/sklearn/preprocessing/_label.pyi index ff45f62f..0837cfc3 100644 --- a/stubs/sklearn/preprocessing/_label.pyi +++ b/stubs/sklearn/preprocessing/_label.pyi @@ -1,6 +1,7 @@ from collections import defaultdict as defaultdict +from collections.abc import Iterable from numbers import Integral as Integral -from typing import Any, ClassVar, Iterable, TypeVar +from typing import Any, ClassVar, TypeVar from numpy import ndarray from pandas.core.frame import DataFrame diff --git a/stubs/sklearn/random_projection.pyi b/stubs/sklearn/random_projection.pyi index 4e33cd03..ec0ee430 100644 --- a/stubs/sklearn/random_projection.pyi +++ b/stubs/sklearn/random_projection.pyi @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Sequence from numbers import Integral as Integral, Real as Real -from typing import Any, ClassVar, Literal, Sequence, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/svm/_classes.pyi b/stubs/sklearn/svm/_classes.pyi index df733dd1..a3e27cad 100644 --- a/stubs/sklearn/svm/_classes.pyi +++ b/stubs/sklearn/svm/_classes.pyi @@ -1,5 +1,6 @@ +from collections.abc import Mapping from numbers import Integral as Integral, Real as Real -from typing import Any, Callable, ClassVar, Literal, Mapping, TypeVar +from typing import Any, Callable, ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/tree/_classes.pyi b/stubs/sklearn/tree/_classes.pyi index fc227592..f198598b 100644 --- a/stubs/sklearn/tree/_classes.pyi +++ b/stubs/sklearn/tree/_classes.pyi @@ -1,7 +1,8 @@ from abc import ABCMeta, abstractmethod +from collections.abc import Mapping, Sequence from math import ceil as ceil from numbers import Integral as Integral, Real as Real -from typing import ClassVar, Literal, Mapping, Sequence, TypeVar +from typing import ClassVar, Literal, TypeVar from numpy import ndarray from numpy.random import RandomState diff --git a/stubs/sklearn/tree/_export.pyi b/stubs/sklearn/tree/_export.pyi index 73aec10e..e6136078 100644 --- a/stubs/sklearn/tree/_export.pyi +++ b/stubs/sklearn/tree/_export.pyi @@ -1,6 +1,7 @@ +from collections.abc import Sequence from io import StringIO as StringIO from numbers import Integral as Integral -from typing import Any, Literal, Sequence +from typing import Any, Literal import numpy as np from matplotlib.axes import Axes diff --git a/stubs/sklearn/utils/__init__.pyi b/stubs/sklearn/utils/__init__.pyi index 204f4303..839651d6 100644 --- a/stubs/sklearn/utils/__init__.pyi +++ b/stubs/sklearn/utils/__init__.pyi @@ -4,10 +4,10 @@ import platform as platform import struct as struct import timeit as timeit import warnings as warnings -from collections.abc import Sequence as Sequence +from collections.abc import Iterable, Iterator, Sequence, Sequence as Sequence from contextlib import contextmanager as contextmanager, suppress as suppress from itertools import compress as compress, islice as islice -from typing import Any, Iterable, Iterator, Sequence, SupportsIndex +from typing import Any, SupportsIndex import numpy as np from numpy import ndarray diff --git a/stubs/sklearn/utils/_array_api.pyi b/stubs/sklearn/utils/_array_api.pyi index 73b49790..b9b3b9bc 100644 --- a/stubs/sklearn/utils/_array_api.pyi +++ b/stubs/sklearn/utils/_array_api.pyi @@ -1,5 +1,3 @@ -from typing import Type - import numpy import scipy.special as special from numpy import int32, ndarray @@ -14,9 +12,7 @@ class _ArrayAPIWrapper: class _NumPyApiWrapper: def __getattr__(self, name: str): ... - def astype( - self, x: ndarray, dtype: Type[int32] | Type[int] | Type[Float], *, copy: bool = True, casting: str = "unsafe" - ) -> ndarray: ... + def astype(self, x: ndarray, dtype: type[int32 | int | Float], *, copy: bool = True, casting: str = "unsafe") -> ndarray: ... def asarray(self, x, *, dtype=None, device=None, copy=None) -> ndarray: ... def unique_inverse(self, x: ndarray) -> tuple[ndarray, ndarray]: ... def unique_counts(self, x: ndarray) -> tuple[ndarray, ndarray]: ... diff --git a/stubs/sklearn/utils/_estimator_html_repr.pyi b/stubs/sklearn/utils/_estimator_html_repr.pyi index 1bde84c7..f3d7b7fa 100644 --- a/stubs/sklearn/utils/_estimator_html_repr.pyi +++ b/stubs/sklearn/utils/_estimator_html_repr.pyi @@ -1,9 +1,10 @@ import html +from collections.abc import Sequence from contextlib import closing as closing from inspect import isclass as isclass from io import StringIO as StringIO from string import Template as Template -from typing import Literal, Sequence +from typing import Literal from .. import config_context as config_context from ..base import BaseEstimator diff --git a/stubs/sklearn/utils/_mocking.pyi b/stubs/sklearn/utils/_mocking.pyi index fe84f239..0f8c7895 100644 --- a/stubs/sklearn/utils/_mocking.pyi +++ b/stubs/sklearn/utils/_mocking.pyi @@ -1,4 +1,5 @@ -from typing import Callable, Literal, Sequence, TypeVar +from collections.abc import Sequence +from typing import Callable, Literal, TypeVar from numpy import ndarray diff --git a/stubs/sklearn/utils/_param_validation.pyi b/stubs/sklearn/utils/_param_validation.pyi index 7689a68f..a86eabcb 100644 --- a/stubs/sklearn/utils/_param_validation.pyi +++ b/stubs/sklearn/utils/_param_validation.pyi @@ -4,10 +4,10 @@ import operator import re import warnings from abc import ABC, abstractmethod -from collections.abc import Iterable as Iterable +from collections.abc import Iterable as Iterable, Mapping, Sequence from inspect import signature as signature from numbers import Integral, Real -from typing import Any, Callable, Literal, Mapping, Sequence, Type +from typing import Any, Callable, Literal import numpy as np from scipy.sparse import csr_matrix as csr_matrix, issparse as issparse @@ -43,8 +43,8 @@ class _PandasNAConstraint(_Constraint): class Options(_Constraint): def __init__( self, - type: Type[str] | Type[type] | Type[Real], - options: set | set[float] | set[str] | set[Type[Float]], + type: type[str | type | Real], + options: set | set[float] | set[str] | set[type[Float]], *, deprecated: set | None = None, ) -> None: ... @@ -56,7 +56,7 @@ class StrOptions(Options): class Interval(_Constraint): def __init__( self, - type: Real | Type[Integral] | Type[Real] | Integral, + type: type[Integral | Real] | Real | Integral, left: float | None, right: float | None, *, diff --git a/stubs/sklearn/utils/_pprint.pyi b/stubs/sklearn/utils/_pprint.pyi index 7e2db0bf..77f5fc24 100644 --- a/stubs/sklearn/utils/_pprint.pyi +++ b/stubs/sklearn/utils/_pprint.pyi @@ -1,7 +1,7 @@ import inspect import pprint from collections import OrderedDict as OrderedDict -from typing import Any, Type +from typing import Any from .._config import get_config as get_config from ..base import BaseEstimator as BaseEstimator diff --git a/stubs/sklearn/utils/_testing.pyi b/stubs/sklearn/utils/_testing.pyi index 98ed7b7d..546c40e1 100644 --- a/stubs/sklearn/utils/_testing.pyi +++ b/stubs/sklearn/utils/_testing.pyi @@ -30,7 +30,7 @@ from subprocess import ( TimeoutExpired as TimeoutExpired, check_output as check_output, ) -from typing import Any, Callable, ClassVar, Sequence +from typing import Any, Callable, ClassVar from unittest import TestCase as TestCase import joblib diff --git a/stubs/sklearn/utils/class_weight.pyi b/stubs/sklearn/utils/class_weight.pyi index 7ef26a28..4a45d49a 100644 --- a/stubs/sklearn/utils/class_weight.pyi +++ b/stubs/sklearn/utils/class_weight.pyi @@ -1,4 +1,4 @@ -from typing import Mapping +from collections.abc import Mapping import numpy as np from numpy import ndarray diff --git a/stubs/sklearn/utils/discovery.pyi b/stubs/sklearn/utils/discovery.pyi index cd24fb97..37235ac2 100644 --- a/stubs/sklearn/utils/discovery.pyi +++ b/stubs/sklearn/utils/discovery.pyi @@ -1,9 +1,10 @@ import inspect import pkgutil +from collections.abc import Sequence from importlib import import_module as import_module from operator import itemgetter as itemgetter from pathlib import Path as Path -from typing import Literal, Sequence +from typing import Literal from numpy import ndarray diff --git a/stubs/sklearn/utils/estimator_checks.pyi b/stubs/sklearn/utils/estimator_checks.pyi index 650c8d32..4b69834a 100644 --- a/stubs/sklearn/utils/estimator_checks.pyi +++ b/stubs/sklearn/utils/estimator_checks.pyi @@ -2,12 +2,11 @@ import pickle import re import types import warnings -from collections.abc import Generator +from collections.abc import Generator, Sequence from copy import deepcopy as deepcopy from functools import partial as partial, wraps as wraps from inspect import signature as signature from numbers import Real as Real -from typing import Sequence import joblib import numpy as np diff --git a/stubs/sklearn/utils/extmath.pyi b/stubs/sklearn/utils/extmath.pyi index b096f2ba..c75e060b 100644 --- a/stubs/sklearn/utils/extmath.pyi +++ b/stubs/sklearn/utils/extmath.pyi @@ -1,5 +1,6 @@ import warnings -from typing import Literal, Sequence +from collections.abc import Sequence +from typing import Literal import numpy as np from numpy import ndarray diff --git a/stubs/sklearn/utils/metaestimators.pyi b/stubs/sklearn/utils/metaestimators.pyi index c1ee0e63..c00dd5e1 100644 --- a/stubs/sklearn/utils/metaestimators.pyi +++ b/stubs/sklearn/utils/metaestimators.pyi @@ -1,8 +1,9 @@ import warnings from abc import ABCMeta, abstractmethod +from collections.abc import Sequence from contextlib import suppress as suppress from operator import attrgetter as attrgetter -from typing import Any, Callable, ClassVar, List, Sequence +from typing import Any, Callable, ClassVar import numpy as np @@ -12,7 +13,7 @@ from ._available_if import _AvailableIfDescriptor, available_if __all__ = ["available_if", "if_delegate_has_method"] class _BaseComposition(BaseEstimator, metaclass=ABCMeta): - steps: ClassVar[List[Any]] = ... + steps: ClassVar[list[Any]] = ... @abstractmethod def __init__(self) -> None: ... diff --git a/stubs/sklearn/utils/parallel.pyi b/stubs/sklearn/utils/parallel.pyi index 0a483b51..d7e5d49b 100644 --- a/stubs/sklearn/utils/parallel.pyi +++ b/stubs/sklearn/utils/parallel.pyi @@ -1,7 +1,8 @@ import functools import warnings +from collections.abc import Iterable, Iterator from functools import update_wrapper as update_wrapper -from typing import Any, Callable, Iterable, Iterator +from typing import Any, Callable import joblib from numpy import ndarray diff --git a/stubs/sklearn/utils/validation.pyi b/stubs/sklearn/utils/validation.pyi index 9c5e44a9..d00a6101 100644 --- a/stubs/sklearn/utils/validation.pyi +++ b/stubs/sklearn/utils/validation.pyi @@ -1,11 +1,12 @@ import numbers import operator import warnings +from collections.abc import Sequence from contextlib import suppress as suppress from functools import wraps as wraps from inspect import Parameter as Parameter, isclass as isclass, signature as signature from numbers import Integral, Number, Real -from typing import Any, Callable, Literal, Sequence, Type +from typing import Any, Callable, Literal import joblib import numpy as np @@ -99,7 +100,7 @@ def check_non_negative(X: MatrixLike | ArrayLike, whom: str) -> None: ... def check_scalar( x: Any, name: str, - target_type: Type[Integral] | tuple | Type[Real] | type, + target_type: type[Integral | Real] | tuple | type, *, min_val: None | Float = None, max_val: None | Float = None, diff --git a/stubs/sympy-stubs/README.md b/stubs/sympy-stubs/README.md index f0806834..f7be9ccb 100644 --- a/stubs/sympy-stubs/README.md +++ b/stubs/sympy-stubs/README.md @@ -16,16 +16,15 @@ Scripts for future use: import os import re import shutil -from typing import List SOURCE_DIR = "typings\\sympy" DEST_DIR = "typings\\sympy-returnvalues" -def read_file(file_path: str) -> List[str]: +def read_file(file_path: str) -> list[str]: with open(file_path, "r") as file: return file.readlines() -def write_file(file_path: str, lines: List[str]) -> None: +def write_file(file_path: str, lines: list[str]) -> None: try: os.makedirs(os.path.dirname(file_path)) except FileExistsError: @@ -75,5 +74,4 @@ def fix_all_stubs() -> None: fix_file(file_path, dest_path, sub_package) fix_all_stubs() - -``` +``` \ No newline at end of file diff --git a/stubs/sympy-stubs/assumptions/assume.pyi b/stubs/sympy-stubs/assumptions/assume.pyi index 073e6676..c8145b76 100644 --- a/stubs/sympy-stubs/assumptions/assume.pyi +++ b/stubs/sympy-stubs/assumptions/assume.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator from contextlib import contextmanager -from typing import Any, Callable, Generator +from typing import Any, Callable from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/assumptions/relation/binrel.pyi b/stubs/sympy-stubs/assumptions/relation/binrel.pyi index ea9e720e..fa3d72be 100644 --- a/stubs/sympy-stubs/assumptions/relation/binrel.pyi +++ b/stubs/sympy-stubs/assumptions/relation/binrel.pyi @@ -1,4 +1,3 @@ -from typing import Optional from typing_extensions import Self from sympy.assumptions import AppliedPredicate, Predicate @@ -8,8 +7,8 @@ from sympy.core.logic import Not __all__ = ["BinaryRelation", "AppliedBinaryRelation"] class BinaryRelation(Predicate): - is_reflexive: Optional[bool] = ... - is_symmetric: Optional[bool] = ... + is_reflexive: bool | None = ... + is_symmetric: bool | None = ... def __call__(self, *args) -> AppliedBinaryRelation: ... @property def reversed(self) -> Self | None: ... diff --git a/stubs/sympy-stubs/codegen/ast.pyi b/stubs/sympy-stubs/codegen/ast.pyi index 8a509dcc..bb5e593b 100644 --- a/stubs/sympy-stubs/codegen/ast.pyi +++ b/stubs/sympy-stubs/codegen/ast.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Iterator, Literal +from collections.abc import Iterator +from typing import Any, Callable, Literal from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/combinatorics/generators.pyi b/stubs/sympy-stubs/combinatorics/generators.pyi index 30a4ce76..c36cb79d 100644 --- a/stubs/sympy-stubs/combinatorics/generators.pyi +++ b/stubs/sympy-stubs/combinatorics/generators.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any from sympy.combinatorics.permutations import Permutation diff --git a/stubs/sympy-stubs/combinatorics/graycode.pyi b/stubs/sympy-stubs/combinatorics/graycode.pyi index b5ca8c0a..c0b75f81 100644 --- a/stubs/sympy-stubs/combinatorics/graycode.pyi +++ b/stubs/sympy-stubs/combinatorics/graycode.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any from typing_extensions import LiteralString, Self from sympy.core import Basic diff --git a/stubs/sympy-stubs/combinatorics/perm_groups.pyi b/stubs/sympy-stubs/combinatorics/perm_groups.pyi index 7a789a52..aeda5fcd 100644 --- a/stubs/sympy-stubs/combinatorics/perm_groups.pyi +++ b/stubs/sympy-stubs/combinatorics/perm_groups.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal from typing_extensions import Self from sympy.combinatorics.fp_groups import FpGroup diff --git a/stubs/sympy-stubs/combinatorics/permutations.pyi b/stubs/sympy-stubs/combinatorics/permutations.pyi index d13b7a74..28a88245 100644 --- a/stubs/sympy-stubs/combinatorics/permutations.pyi +++ b/stubs/sympy-stubs/combinatorics/permutations.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator, Literal +from collections.abc import Generator, Iterator +from typing import Any, Literal from typing_extensions import Self from sympy.combinatorics.perm_groups import Coset diff --git a/stubs/sympy-stubs/concrete/products.pyi b/stubs/sympy-stubs/concrete/products.pyi index 9b804fcc..6e5972a9 100644 --- a/stubs/sympy-stubs/concrete/products.pyi +++ b/stubs/sympy-stubs/concrete/products.pyi @@ -1,5 +1,5 @@ from typing import Any -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.concrete.expr_with_intlimits import ExprWithIntLimits from sympy.core.basic import Basic @@ -10,7 +10,7 @@ from sympy.series.order import Order class Product(ExprWithIntLimits): __slots__ = ... - limits: tTuple[tTuple[Symbol, Expr, Expr]] + limits: tuple[tuple[Symbol, Expr, Expr]] def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: ... @property def term(self) -> Basic: ... diff --git a/stubs/sympy-stubs/concrete/summations.pyi b/stubs/sympy-stubs/concrete/summations.pyi index 89ebb168..38819e56 100644 --- a/stubs/sympy-stubs/concrete/summations.pyi +++ b/stubs/sympy-stubs/concrete/summations.pyi @@ -1,5 +1,5 @@ from typing import Any -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.concrete.expr_with_intlimits import ExprWithIntLimits from sympy.concrete.expr_with_limits import AddWithLimits @@ -12,7 +12,7 @@ from sympy.series.order import Order class Sum(AddWithLimits, ExprWithIntLimits): __slots__ = ... - limits: tTuple[tTuple[Symbol, Expr, Expr]] + limits: tuple[tuple[Symbol, Expr, Expr]] def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: ... def doit( self, **hints diff --git a/stubs/sympy-stubs/core/add.pyi b/stubs/sympy-stubs/core/add.pyi index 2aa7dd95..a5ab0fbe 100644 --- a/stubs/sympy-stubs/core/add.pyi +++ b/stubs/sympy-stubs/core/add.pyi @@ -1,5 +1,5 @@ from typing import Any, Literal -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.core.cache import cacheit from sympy.core.expr import Expr @@ -13,7 +13,7 @@ _args_sortkey = ... class Add(Expr, AssocOp): __slots__ = ... - args: tTuple[Expr, ...] + args: tuple[Expr, ...] is_Add = ... _args_type = Expr @classmethod @@ -26,7 +26,7 @@ class Add(Expr, AssocOp): @cacheit def as_coeff_add( self, *deps - ) -> tuple[Any | Self, tuple[Any, ...]] | tuple[Expr, tuple[Expr, ...]] | tuple[Any, tTuple[Expr, ...]]: ... + ) -> tuple[Any | Self, tuple[Any, ...]] | tuple[Expr, tuple[Expr, ...]] | tuple[Any, tuple[Expr, ...]]: ... def as_coeff_Add(self, rational=..., deps=...) -> tuple[Expr, Any | Self] | tuple[Any, Self]: ... def matches(self, expr, repl_dict=..., old=...): ... @cacheit diff --git a/stubs/sympy-stubs/core/containers.pyi b/stubs/sympy-stubs/core/containers.pyi index 034aef5f..d1105513 100644 --- a/stubs/sympy-stubs/core/containers.pyi +++ b/stubs/sympy-stubs/core/containers.pyi @@ -1,6 +1,6 @@ -from collections.abc import MutableSet +from collections.abc import Generator, Iterator, MutableSet from types import NotImplementedType -from typing import Any, Callable, Generator, Iterator +from typing import Any, Callable from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/core/evalf.pyi b/stubs/sympy-stubs/core/evalf.pyi index 29f5a3b9..2e502beb 100644 --- a/stubs/sympy-stubs/core/evalf.pyi +++ b/stubs/sympy-stubs/core/evalf.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Dict as tDict, List, Optional, Tuple as tTuple, Type, Union as tUnion, overload +from typing import Any, Callable, overload from typing_extensions import Self, TypeAlias from sympy.concrete.products import Product @@ -26,22 +26,22 @@ DEFAULT_MAXPREC = ... class PrecisionExhausted(ArithmeticError): ... -MPF_TUP: TypeAlias = tTuple[int, int, int, int] +MPF_TUP: TypeAlias = tuple[int, int, int, int] TMP_RES: TypeAlias = Any -OPT_DICT: TypeAlias = tDict[str, Any] +OPT_DICT: TypeAlias = dict[str, Any] -def fastlog(x: Optional[MPF_TUP]) -> tUnion[int, Any]: ... +def fastlog(x: MPF_TUP | None) -> int | Any: ... def pure_complex(v: Expr, or_real=...) -> tuple[Number, Number] | None: ... -SCALED_ZERO_TUP: TypeAlias = tTuple[List[int], int, int, int] +SCALED_ZERO_TUP: TypeAlias = tuple[list[int], int, int, int] @overload def scaled_zero(mag: SCALED_ZERO_TUP, sign=...) -> MPF_TUP: ... @overload -def scaled_zero(mag: int, sign=...) -> tTuple[SCALED_ZERO_TUP, int]: ... -def scaled_zero(mag: tUnion[SCALED_ZERO_TUP, int], sign=...) -> tUnion[MPF_TUP, tTuple[SCALED_ZERO_TUP, int]]: ... -def iszero(mpf: tUnion[MPF_TUP, SCALED_ZERO_TUP, None], scaled=...) -> Optional[bool]: ... -def complex_accuracy(result: TMP_RES) -> tUnion[int, Any]: ... +def scaled_zero(mag: int, sign=...) -> tuple[SCALED_ZERO_TUP, int]: ... +def scaled_zero(mag: SCALED_ZERO_TUP | int, sign=...) -> MPF_TUP | tuple[SCALED_ZERO_TUP, int]: ... +def iszero(mpf: MPF_TUP | SCALED_ZERO_TUP | None, scaled=...) -> bool | None: ... +def complex_accuracy(result: TMP_RES) -> int | Any: ... def get_abs(expr: Expr, prec: int, options: OPT_DICT) -> TMP_RES: ... def get_complex_part(expr: Expr, no: int, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_abs(expr: Abs, prec: int, options: OPT_DICT) -> TMP_RES: ... @@ -50,13 +50,13 @@ def evalf_im(expr: im, prec: int, options: OPT_DICT) -> TMP_RES: ... def finalize_complex(re: MPF_TUP, im: MPF_TUP, prec: int) -> TMP_RES: ... def chop_parts(value: TMP_RES, prec: int) -> TMP_RES: ... def check_target(expr: Expr, result: TMP_RES, prec: int) -> None: ... -def get_integer_part(expr: Expr, no: int, options: OPT_DICT, return_ints=...) -> tUnion[TMP_RES, tTuple[int, int]]: ... +def get_integer_part(expr: Expr, no: int, options: OPT_DICT, return_ints=...) -> TMP_RES | tuple[int, int]: ... def evalf_ceiling(expr: ceiling, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_floor(expr: floor, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_float(expr: Float, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_rational(expr: Rational, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_integer(expr: Integer, prec: int, options: OPT_DICT) -> TMP_RES: ... -def add_terms(terms: list, prec: int, target_prec: int) -> tTuple[tUnion[MPF_TUP, SCALED_ZERO_TUP, None], Optional[int]]: ... +def add_terms(terms: list, prec: int, target_prec: int) -> tuple[MPF_TUP | SCALED_ZERO_TUP | None, int | None]: ... def evalf_add(v: Add, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_mul(v: Mul, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_pow(v: Pow, prec: int, options) -> TMP_RES: ... @@ -70,19 +70,19 @@ def evalf_alg_num(a: AlgebraicNumber, prec: int, options: OPT_DICT) -> TMP_RES: def as_mpmath(x: Any, prec: int, options: OPT_DICT): ... def do_integral(expr: Integral, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_integral(expr: Integral, prec: int, options: OPT_DICT) -> TMP_RES: ... -def check_convergence(numer: Expr, denom: Expr, n: Symbol) -> tTuple[int, Any, Any]: ... +def check_convergence(numer: Expr, denom: Expr, n: Symbol) -> tuple[int, Any, Any]: ... def hypsum(expr: Expr, n: Symbol, start: int, prec: int): ... def evalf_prod(expr: Product, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_sum(expr: Sum, prec: int, options: OPT_DICT) -> TMP_RES: ... def evalf_symbol(x: Expr, prec: int, options: OPT_DICT) -> TMP_RES: ... -evalf_table: tDict[Type[Expr], Callable[[Expr, int, OPT_DICT], TMP_RES]] = ... +evalf_table: dict[type[Expr], Callable[[Expr, int, OPT_DICT], TMP_RES]] = ... def evalf(x: Expr, prec: int, options: OPT_DICT) -> TMP_RES: ... def quad_to_mpmath(q, ctx=...): ... class EvalfMixin: - __slots__: tTuple[str, ...] = ... + __slots__: tuple[str, ...] = ... def evalf( self, n=..., subs=..., maxn=..., chop=..., strict=..., quad=..., verbose=... ) -> Self | EvalfMixin | TMP_RES | Float: ... diff --git a/stubs/sympy-stubs/core/exprtools.pyi b/stubs/sympy-stubs/core/exprtools.pyi index 730be502..e3f0c3ea 100644 --- a/stubs/sympy-stubs/core/exprtools.pyi +++ b/stubs/sympy-stubs/core/exprtools.pyi @@ -1,5 +1,5 @@ from types import NotImplementedType -from typing import Any, Dict, Tuple as tTuple +from typing import Any from typing_extensions import LiteralString from sympy import Order @@ -11,8 +11,8 @@ from sympy.core.numbers import Rational _eps = ... -def decompose_power(expr: Expr) -> tTuple[Expr, int]: ... -def decompose_power_rat(expr: Expr) -> tTuple[Expr, Rational]: ... +def decompose_power(expr: Expr) -> tuple[Expr, int]: ... +def decompose_power_rat(expr: Expr) -> tuple[Expr, Rational]: ... class Factors: __slots__ = ... @@ -57,6 +57,6 @@ class Term: def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... -def gcd_terms(terms, isprimitive=..., clear=..., fraction=...) -> Add | Order | Mul | Basic | Dict: ... +def gcd_terms(terms, isprimitive=..., clear=..., fraction=...) -> Add | Order | Mul | Basic | dict: ... def factor_terms(expr, radical=..., clear=..., fraction=..., sign=...) -> Basic | Any | Add | Order | Mul: ... def factor_nc(expr) -> Expr | Any | Add | Order | Mul: ... diff --git a/stubs/sympy-stubs/core/facts.pyi b/stubs/sympy-stubs/core/facts.pyi index 198723a8..65bb3c03 100644 --- a/stubs/sympy-stubs/core/facts.pyi +++ b/stubs/sympy-stubs/core/facts.pyi @@ -1,5 +1,6 @@ from collections import defaultdict -from typing import Any, Iterator +from collections.abc import Iterator +from typing import Any def transitive_closure(implications) -> set[Any]: ... def deduce_alpha_implications(implications) -> defaultdict[Any, set[Any]]: ... diff --git a/stubs/sympy-stubs/core/function.pyi b/stubs/sympy-stubs/core/function.pyi index 7646af5a..a1a0402d 100644 --- a/stubs/sympy-stubs/core/function.pyi +++ b/stubs/sympy-stubs/core/function.pyi @@ -1,6 +1,6 @@ from inspect import Signature from types import NotImplementedType -from typing import Any, Callable, Dict, Literal +from typing import Any, Callable, Literal from typing_extensions import Self from sympy.core.basic import Basic @@ -152,4 +152,4 @@ def expand_complex(expr, deep=...): ... def expand_power_base(expr, deep=..., force=...): ... def expand_power_exp(expr, deep=...): ... def count_ops(expr, visual=...): ... -def nfloat(expr, n=..., exponent=..., dkeys=...) -> dict[Any, Any] | Dict | Basic | Any | Float: ... +def nfloat(expr, n=..., exponent=..., dkeys=...) -> dict[Any, Any] | dict | Basic | Any | Float: ... diff --git a/stubs/sympy-stubs/core/logic.pyi b/stubs/sympy-stubs/core/logic.pyi index 4f45a183..604352d8 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 import Any from typing_extensions import Self, TypeAlias -FuzzyBool: TypeAlias = Optional[bool] +FuzzyBool: TypeAlias = bool | None def fuzzy_bool(x) -> bool | None: ... def fuzzy_and(args) -> bool | None: ... diff --git a/stubs/sympy-stubs/core/mul.pyi b/stubs/sympy-stubs/core/mul.pyi index 5e8502a6..5211c239 100644 --- a/stubs/sympy-stubs/core/mul.pyi +++ b/stubs/sympy-stubs/core/mul.pyi @@ -1,6 +1,6 @@ from collections import defaultdict from typing import Any, Literal -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.core.cache import cacheit from sympy.core.expr import Expr @@ -18,7 +18,7 @@ _args_sortkey = ... class Mul(Expr, AssocOp): __slots__ = ... - args: tTuple[Expr] + args: tuple[Expr] is_Mul = ... _args_type = Expr _kind_dispatcher = ... @@ -35,9 +35,7 @@ class Mul(Expr, AssocOp): @cacheit def as_coeff_mul( self, *deps, rational=..., **kwargs - ) -> ( - tuple[Any | Self, tuple[Any, ...]] | tuple[Expr, tuple[()]] | tuple[Any, tuple[Any | Mul]] | tuple[Any, tTuple[Expr]] - ): ... + ) -> tuple[Any | Self, tuple[Any, ...]] | tuple[Expr, tuple[()]] | tuple[Any, tuple[Any | Mul]] | tuple[Any, tuple[Expr]]: ... def as_coeff_Mul( self, rational=... ) -> tuple[Expr, Any] | tuple[Expr, Any | Self] | tuple[Any, Any | Self] | tuple[Any, Self]: ... diff --git a/stubs/sympy-stubs/core/numbers.pyi b/stubs/sympy-stubs/core/numbers.pyi index f2cb390d..6519bb3c 100644 --- a/stubs/sympy-stubs/core/numbers.pyi +++ b/stubs/sympy-stubs/core/numbers.pyi @@ -1,7 +1,7 @@ from functools import lru_cache from types import NotImplementedType from typing import Any, Literal -from typing_extensions import Self, Tuple +from typing_extensions import Self from sympy.core.basic import Basic from sympy.core.cache import cacheit @@ -51,8 +51,8 @@ class Number(AtomicExpr): def __new__(cls, *obj) -> Number | Integer | Rational | Float: ... def could_extract_minus_sign(self) -> bool: ... def invert(self, other, *gens, **args) -> int | Any: ... - def __divmod__(self, other) -> tuple[Any, Any] | NotImplementedType | Tuple: ... - def __rdivmod__(self, other) -> NotImplementedType | tuple[Any, Any] | Tuple: ... + def __divmod__(self, other) -> tuple[Any, Any] | NotImplementedType | tuple: ... + def __rdivmod__(self, other) -> NotImplementedType | tuple[Any, Any] | tuple: ... def __float__(self) -> float: ... def floor(self): ... def ceiling(self): ... @@ -216,8 +216,8 @@ class Integer(Rational): def __ceil__(self) -> Integer: ... def __neg__(self) -> Integer: ... def __abs__(self) -> Self | Integer: ... - def __divmod__(self, other) -> Tuple | tuple[Any, Any] | NotImplementedType: ... - def __rdivmod__(self, other) -> Tuple | tuple[Any, Any] | NotImplementedType: ... + def __divmod__(self, other) -> tuple | tuple[Any, Any] | NotImplementedType: ... + def __rdivmod__(self, other) -> tuple | tuple[Any, Any] | NotImplementedType: ... def __add__(self, other) -> Integer | Rational | Float | Order: ... def __radd__(self, other) -> Integer | Rational: ... def __sub__(self, other) -> Integer | Rational | Float: ... @@ -236,7 +236,7 @@ class Integer(Rational): def __index__(self) -> int: ... def as_numer_denom(self) -> tuple[Self, Any]: ... @_sympifyit("other", NotImplemented) - def __floordiv__(self, other) -> NotImplementedType | Integer | Tuple: ... + def __floordiv__(self, other) -> NotImplementedType | Integer | tuple: ... def __rfloordiv__(self, other) -> Integer: ... def __lshift__(self, other) -> Integer | NotImplementedType: ... def __rlshift__(self, other) -> Integer | NotImplementedType: ... diff --git a/stubs/sympy-stubs/core/parameters.pyi b/stubs/sympy-stubs/core/parameters.pyi index 888d0725..780e6c1a 100644 --- a/stubs/sympy-stubs/core/parameters.pyi +++ b/stubs/sympy-stubs/core/parameters.pyi @@ -1,6 +1,7 @@ +from collections.abc import Generator from contextlib import contextmanager from threading import local -from typing import Any, Generator +from typing import Any class _global_parameters(local): def __init__(self, **kwargs) -> None: ... diff --git a/stubs/sympy-stubs/core/sorting.pyi b/stubs/sympy-stubs/core/sorting.pyi index 8c375e7c..1fdbd159 100644 --- a/stubs/sympy-stubs/core/sorting.pyi +++ b/stubs/sympy-stubs/core/sorting.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal __all__ = ["default_sort_key", "ordered"] diff --git a/stubs/sympy-stubs/core/symbol.pyi b/stubs/sympy-stubs/core/symbol.pyi index 1e11f94a..33d7a837 100644 --- a/stubs/sympy-stubs/core/symbol.pyi +++ b/stubs/sympy-stubs/core/symbol.pyi @@ -1,5 +1,5 @@ from typing import Any, Literal -from typing_extensions import Self, Tuple +from typing_extensions import Self from sympy.core.basic import Atom, Basic from sympy.core.cache import cacheit @@ -68,4 +68,4 @@ _range = ... def symbols(names, *, cls=..., **args) -> Any: ... def var(names, **args) -> Basic | FunctionClass | Any: ... -def disambiguate(*iter) -> Tuple: ... +def disambiguate(*iter) -> tuple: ... diff --git a/stubs/sympy-stubs/core/traversal.pyi b/stubs/sympy-stubs/core/traversal.pyi index e77d8dc6..f1d44024 100644 --- a/stubs/sympy-stubs/core/traversal.pyi +++ b/stubs/sympy-stubs/core/traversal.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/external/pythonmpq.pyi b/stubs/sympy-stubs/external/pythonmpq.pyi index 68c8dda2..2221cd72 100644 --- a/stubs/sympy-stubs/external/pythonmpq.pyi +++ b/stubs/sympy-stubs/external/pythonmpq.pyi @@ -1,6 +1,6 @@ from types import NotImplementedType from typing import Any -from typing_extensions import Self, Tuple as tTuple, Type +from typing_extensions import Self _PyHASH_MODULUS = ... _PyHASH_INF = ... @@ -31,4 +31,4 @@ class PythonMPQ: def __truediv__(self, other) -> NotImplementedType | Self: ... def __rtruediv__(self, other) -> Self | NotImplementedType: ... - _compatible_types: tTuple[Type, ...] = ... + _compatible_types: tuple[type, ...] = ... diff --git a/stubs/sympy-stubs/functions/combinatorial/numbers.pyi b/stubs/sympy-stubs/functions/combinatorial/numbers.pyi index 11edc53e..65408a4e 100644 --- a/stubs/sympy-stubs/functions/combinatorial/numbers.pyi +++ b/stubs/sympy-stubs/functions/combinatorial/numbers.pyi @@ -1,5 +1,5 @@ from typing import Any -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.core.function import Function, UndefinedFunction from sympy.core.numbers import Float, Integer, Rational @@ -34,7 +34,7 @@ class tribonacci(Function): def eval(cls, n, sym=...) -> Integer | None: ... class bernoulli(Function): - args: tTuple[Integer] + args: tuple[Integer] _cache = ... _highest = ... @classmethod diff --git a/stubs/sympy-stubs/functions/elementary/complexes.pyi b/stubs/sympy-stubs/functions/elementary/complexes.pyi index 5a53d9b8..68a54d7d 100644 --- a/stubs/sympy-stubs/functions/elementary/complexes.pyi +++ b/stubs/sympy-stubs/functions/elementary/complexes.pyi @@ -1,5 +1,5 @@ from typing import Any, Literal -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.core.basic import Basic from sympy.core.expr import Expr @@ -10,7 +10,7 @@ from sympy.integrals.integrals import Integral from sympy.series.order import Order class re(Function): - args: tTuple[Expr] + args: tuple[Expr] is_extended_real = ... unbranched = ... _singularities = ... @@ -19,7 +19,7 @@ class re(Function): def as_real_imag(self, deep=..., **hints) -> tuple[Self, Any]: ... class im(Function): - args: tTuple[Expr] + args: tuple[Expr] is_extended_real = ... unbranched = ... _singularities = ... @@ -35,7 +35,7 @@ class sign(Function): def eval(cls, arg) -> sign | None: ... class Abs(Function): - args: tTuple[Expr] + args: tuple[Expr] is_extended_real = ... is_extended_negative = ... is_extended_nonnegative = ... diff --git a/stubs/sympy-stubs/functions/elementary/exponential.pyi b/stubs/sympy-stubs/functions/elementary/exponential.pyi index b1ab5e84..b0c20520 100644 --- a/stubs/sympy-stubs/functions/elementary/exponential.pyi +++ b/stubs/sympy-stubs/functions/elementary/exponential.pyi @@ -1,5 +1,5 @@ from typing import Any, Literal -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.core.basic import Basic from sympy.core.cache import cacheit @@ -42,7 +42,7 @@ class exp(ExpBase, metaclass=ExpMeta): def match_real_imag(expr) -> tuple[Any, Literal[0]] | tuple[Any, Any] | tuple[None, None]: ... class log(Function): - args: tTuple[Expr] + args: tuple[Expr] _singularities = ... def fdiff(self, argindex=...): ... def inverse(self, argindex=...) -> type[exp]: ... diff --git a/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi b/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi index c9e6ebb1..fc302b53 100644 --- a/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi +++ b/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi @@ -1,4 +1,4 @@ -from typing_extensions import Self, Tuple +from typing_extensions import Self from sympy.core import Function from sympy.core.expr import Expr @@ -14,7 +14,7 @@ from sympy.series.order import Order class IdentityFunction(Lambda, metaclass=Singleton): _symbol = ... @property - def signature(self) -> Tuple: ... + def signature(self) -> tuple: ... @property def expr(self) -> Dummy: ... diff --git a/stubs/sympy-stubs/functions/elementary/piecewise.pyi b/stubs/sympy-stubs/functions/elementary/piecewise.pyi index 62ca1ec8..517d0848 100644 --- a/stubs/sympy-stubs/functions/elementary/piecewise.pyi +++ b/stubs/sympy-stubs/functions/elementary/piecewise.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator +from collections.abc import Generator, Iterator +from typing import Any from typing_extensions import Self from sympy.core import Function, Tuple diff --git a/stubs/sympy-stubs/functions/elementary/trigonometric.pyi b/stubs/sympy-stubs/functions/elementary/trigonometric.pyi index 0ca8124e..ff617883 100644 --- a/stubs/sympy-stubs/functions/elementary/trigonometric.pyi +++ b/stubs/sympy-stubs/functions/elementary/trigonometric.pyi @@ -1,5 +1,5 @@ from typing import Any -from typing_extensions import Self, Tuple as tTuple +from typing_extensions import Self from sympy.calculus.accumulationbounds import AccumBounds from sympy.core.cache import cacheit @@ -92,7 +92,7 @@ class sinc(Function): _eval_is_finite = ... class InverseTrigonometricFunction(Function): - _singularities: tTuple[Expr, ...] = ... + _singularities: tuple[Expr, ...] = ... class asin(InverseTrigonometricFunction): def fdiff(self, argindex=...): ... @@ -117,7 +117,7 @@ class acos(InverseTrigonometricFunction): def inverse(self, argindex=...) -> type[cos]: ... class atan(InverseTrigonometricFunction): - args: tTuple[Expr] + args: tuple[Expr] _singularities = ... def fdiff(self, argindex=...): ... @classmethod diff --git a/stubs/sympy-stubs/geometry/point.pyi b/stubs/sympy-stubs/geometry/point.pyi index 0d891ed5..6847587e 100644 --- a/stubs/sympy-stubs/geometry/point.pyi +++ b/stubs/sympy-stubs/geometry/point.pyi @@ -1,4 +1,5 @@ -from typing import Any, Iterator +from collections.abc import Iterator +from typing import Any from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/integrals/integrals.pyi b/stubs/sympy-stubs/integrals/integrals.pyi index 57fc19c5..a039f445 100644 --- a/stubs/sympy-stubs/integrals/integrals.pyi +++ b/stubs/sympy-stubs/integrals/integrals.pyi @@ -1,4 +1,4 @@ -from typing import Any, Tuple as tTuple +from typing import Any from typing_extensions import Self, Unpack from sympy.concrete.expr_with_limits import AddWithLimits @@ -10,7 +10,7 @@ from sympy.tensor.functions import shape class Integral(AddWithLimits): __slots__ = ... - args: tTuple[Expr, Tuple] + args: tuple[Expr, Tuple] def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: ... def __getnewargs__(self) -> tuple[Basic, Unpack[tuple[tuple[Any], ...]]]: ... @property diff --git a/stubs/sympy-stubs/integrals/manualintegrate.pyi b/stubs/sympy-stubs/integrals/manualintegrate.pyi index 38efdd8f..428e1b00 100644 --- a/stubs/sympy-stubs/integrals/manualintegrate.pyi +++ b/stubs/sympy-stubs/integrals/manualintegrate.pyi @@ -1,6 +1,7 @@ from abc import ABC, abstractmethod +from collections.abc import Sequence from dataclasses import dataclass -from typing import Any, Callable, NamedTuple, Sequence, Type +from typing import Any, Callable, NamedTuple from sympy.core.cache import cacheit from sympy.core.expr import Expr @@ -353,7 +354,7 @@ def power_rule(integral) -> ReciprocalRule | PowerRule | ExpRule | ConstantRule def exp_rule(integral) -> ExpRule | None: ... def orthogonal_poly_rule(integral) -> None: ... -_special_function_patterns: list[tuple[Type, Expr, Callable | None, tuple]] = ... +_special_function_patterns: list[tuple[type, Expr, Callable | None, tuple]] = ... _wilds = ... _symbol = ... diff --git a/stubs/sympy-stubs/logic/algorithms/dpll2.pyi b/stubs/sympy-stubs/logic/algorithms/dpll2.pyi index 86da4429..1654c1d0 100644 --- a/stubs/sympy-stubs/logic/algorithms/dpll2.pyi +++ b/stubs/sympy-stubs/logic/algorithms/dpll2.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal def dpll_satisfiable( expr, all_models=... diff --git a/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi b/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi index d9228ec5..d7f94995 100644 --- a/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi +++ b/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal, NoReturn +from collections.abc import Generator +from typing import Any, Literal, NoReturn def minisat22_satisfiable( expr, all_models=..., minimal=... diff --git a/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi b/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi index f4cf17f1..af5b088b 100644 --- a/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi +++ b/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal def pycosat_satisfiable( expr, all_models=... diff --git a/stubs/sympy-stubs/logic/boolalg.pyi b/stubs/sympy-stubs/logic/boolalg.pyi index ffd23698..4b139167 100644 --- a/stubs/sympy-stubs/logic/boolalg.pyi +++ b/stubs/sympy-stubs/logic/boolalg.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/logic/inference.pyi b/stubs/sympy-stubs/logic/inference.pyi index 70cb6a87..d78d03c0 100644 --- a/stubs/sympy-stubs/logic/inference.pyi +++ b/stubs/sympy-stubs/logic/inference.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal, NoReturn +from collections.abc import Generator +from typing import Any, Literal, NoReturn def literal_symbol(literal) -> bool: ... def satisfiable( diff --git a/stubs/sympy-stubs/matrices/utilities.pyi b/stubs/sympy-stubs/matrices/utilities.pyi index 4ce3ff48..9db7f785 100644 --- a/stubs/sympy-stubs/matrices/utilities.pyi +++ b/stubs/sympy-stubs/matrices/utilities.pyi @@ -1,6 +1,7 @@ +from collections.abc import Generator from contextlib import contextmanager from threading import local -from typing import Any, Generator +from typing import Any class DotProdSimpState(local): def __init__(self) -> None: ... diff --git a/stubs/sympy-stubs/multipledispatch/dispatcher.pyi b/stubs/sympy-stubs/multipledispatch/dispatcher.pyi index aaea7628..f409bd67 100644 --- a/stubs/sympy-stubs/multipledispatch/dispatcher.pyi +++ b/stubs/sympy-stubs/multipledispatch/dispatcher.pyi @@ -1,7 +1,8 @@ +from collections.abc import Generator, ValuesView from inspect import Parameter from itertools import islice -from typing import Any, Callable, Generator -from typing_extensions import LiteralString, Self, ValuesView +from typing import Any, Callable +from typing_extensions import LiteralString, Self class MDNotImplementedError(NotImplementedError): ... diff --git a/stubs/sympy-stubs/ntheory/continued_fraction.pyi b/stubs/sympy-stubs/ntheory/continued_fraction.pyi index 06d2c06d..17fee886 100644 --- a/stubs/sympy-stubs/ntheory/continued_fraction.pyi +++ b/stubs/sympy-stubs/ntheory/continued_fraction.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any from sympy.core.add import Add from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/ntheory/factor_.pyi b/stubs/sympy-stubs/ntheory/factor_.pyi index 05411ade..a8af3a33 100644 --- a/stubs/sympy-stubs/ntheory/factor_.pyi +++ b/stubs/sympy-stubs/ntheory/factor_.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal from typing_extensions import LiteralString from sympy import Function diff --git a/stubs/sympy-stubs/ntheory/generate.pyi b/stubs/sympy-stubs/ntheory/generate.pyi index de878ac3..22a453ed 100644 --- a/stubs/sympy-stubs/ntheory/generate.pyi +++ b/stubs/sympy-stubs/ntheory/generate.pyi @@ -1,5 +1,6 @@ from array import array -from typing import Any, Generator, Iterator, Literal +from collections.abc import Generator, Iterator +from typing import Any, Literal from sympy import Function from sympy.core.function import UndefinedFunction diff --git a/stubs/sympy-stubs/ntheory/multinomial.pyi b/stubs/sympy-stubs/ntheory/multinomial.pyi index 0877e0a5..b05ada51 100644 --- a/stubs/sympy-stubs/ntheory/multinomial.pyi +++ b/stubs/sympy-stubs/ntheory/multinomial.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal def binomial_coefficients(n) -> dict[tuple[Literal[0], int] | tuple[int, Literal[0]], int]: ... def binomial_coefficients_list(n) -> list[int]: ... diff --git a/stubs/sympy-stubs/ntheory/residue_ntheory.pyi b/stubs/sympy-stubs/ntheory/residue_ntheory.pyi index f25b8d0d..7a59366e 100644 --- a/stubs/sympy-stubs/ntheory/residue_ntheory.pyi +++ b/stubs/sympy-stubs/ntheory/residue_ntheory.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal from sympy import Function from sympy.core.function import UndefinedFunction diff --git a/stubs/sympy-stubs/parsing/sympy_parser.pyi b/stubs/sympy-stubs/parsing/sympy_parser.pyi index 3b2df798..fe54f714 100644 --- a/stubs/sympy-stubs/parsing/sympy_parser.pyi +++ b/stubs/sympy-stubs/parsing/sympy_parser.pyi @@ -1,45 +1,45 @@ import ast import typing_extensions -from typing import Any, Callable, Dict as tDict, List, Optional, Tuple as tTuple, Union as tUnion +from typing import Any, Callable null = ... -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]] +TOKEN: typing_extensions.TypeAlias = tuple[int, str] +DICT: typing_extensions.TypeAlias = dict[str, Any] +TRANS: typing_extensions.TypeAlias = Callable[[list[TOKEN], DICT, DICT], list[TOKEN]] -class ParenthesisGroup(List[TOKEN]): ... +class ParenthesisGroup(list[TOKEN]): ... class AppliedFunction: def __init__(self, function: TOKEN, args: ParenthesisGroup, exponent=...) -> None: ... - def expand(self) -> List[TOKEN]: ... + def expand(self) -> list[TOKEN]: ... def __getitem__(self, index) -> Any: ... -def function_exponentiation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +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]]: ... split_symbols = ... -def implicit_multiplication(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: ... -def implicit_application(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: ... -def implicit_multiplication_application(result: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: ... -def auto_symbol(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def lambda_notation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def factorial_notation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def convert_xor(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def repeated_decimals(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def auto_number(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def rationalize(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... -def convert_equals_signs(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: ... - -standard_transformations: tTuple[TRANS, ...] = ... - -def stringify_expr(s: str, local_dict: DICT, global_dict: DICT, transformations: tTuple[TRANS, ...]) -> str: ... +def implicit_multiplication(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def implicit_application(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def implicit_multiplication_application(result: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def auto_symbol(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def lambda_notation(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def factorial_notation(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def convert_xor(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def repeated_decimals(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def auto_number(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def rationalize(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... +def convert_equals_signs(tokens: list[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: ... + +standard_transformations: tuple[TRANS, ...] = ... + +def stringify_expr(s: str, local_dict: DICT, global_dict: DICT, transformations: tuple[TRANS, ...]) -> str: ... def eval_expr(code, local_dict: DICT, global_dict: DICT) -> Any: ... def parse_expr( s: str, - local_dict: Optional[DICT] = ..., - transformations: tUnion[tTuple[TRANS, ...], str] = ..., - global_dict: Optional[DICT] = ..., + local_dict: DICT | None = ..., + transformations: tuple[TRANS, ...] | str = ..., + global_dict: DICT | None = ..., evaluate=..., ) -> Any: ... def evaluateFalse(s: str) -> ast.Expression: ... diff --git a/stubs/sympy-stubs/physics/control/lti.pyi b/stubs/sympy-stubs/physics/control/lti.pyi index a575090d..712f9f29 100644 --- a/stubs/sympy-stubs/physics/control/lti.pyi +++ b/stubs/sympy-stubs/physics/control/lti.pyi @@ -1,5 +1,5 @@ from types import NotImplementedType -from typing import Any, Callable, Type +from typing import Any, Callable from typing_extensions import Self from sympy.core.basic import Basic @@ -24,7 +24,7 @@ def bilinear(tf, sample_per) -> tuple[Any, Any]: ... def backward_diff(tf, sample_per) -> tuple[Any, Any]: ... class LinearTimeInvariant(Basic, EvalfMixin): - _clstype: Type + _clstype: type def __new__(cls, *system, **kwargs) -> Self: ... @property def is_SISO(self): ... diff --git a/stubs/sympy-stubs/physics/units/unitsystem.pyi b/stubs/sympy-stubs/physics/units/unitsystem.pyi index 3f896068..2a3e8db0 100644 --- a/stubs/sympy-stubs/physics/units/unitsystem.pyi +++ b/stubs/sympy-stubs/physics/units/unitsystem.pyi @@ -1,5 +1,3 @@ -from typing import Dict as tDict, Set as tSet - from sympy.core.expr import Expr from sympy.core.function import UndefinedFunction from sympy.physics.units.dimensions import Dimension, _QuantityMapper @@ -7,12 +5,12 @@ from sympy.physics.units.quantities import Quantity from sympy.series.order import Order class UnitSystem(_QuantityMapper): - _unit_systems: tDict[str, UnitSystem] = ... + _unit_systems: dict[str, UnitSystem] = ... def __init__( - self, base_units, units=..., name=..., descr=..., dimension_system=..., derived_units: tDict[Dimension, Quantity] = ... + self, base_units, units=..., name=..., descr=..., dimension_system=..., derived_units: dict[Dimension, Quantity] = ... ) -> None: ... def extend( - self, base, units=..., name=..., description=..., dimension_system=..., derived_units: tDict[Dimension, Quantity] = ... + self, base, units=..., name=..., description=..., dimension_system=..., derived_units: dict[Dimension, Quantity] = ... ) -> UnitSystem: ... def get_dimension_system(self) -> None: ... def get_quantity_dimension(self, unit) -> Expr | Dimension: ... @@ -26,6 +24,6 @@ class UnitSystem(_QuantityMapper): @property def is_consistent(self): ... @property - def derived_units(self) -> tDict[Dimension, Quantity]: ... + def derived_units(self) -> dict[Dimension, Quantity]: ... def get_dimensional_expr(self, expr) -> Order | type[UndefinedFunction]: ... - def get_units_non_prefixed(self) -> tSet[Quantity]: ... + def get_units_non_prefixed(self) -> set[Quantity]: ... diff --git a/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi b/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi index 7aeac91e..631c1c4f 100644 --- a/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi +++ b/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi @@ -1,4 +1,5 @@ -from typing import Any, Iterator, Literal +from collections.abc import Iterator +from typing import Any, Literal class intervalMembership: def __init__(self, a, b) -> None: ... diff --git a/stubs/sympy-stubs/plotting/plot.pyi b/stubs/sympy-stubs/plotting/plot.pyi index 57ae47da..023715f6 100644 --- a/stubs/sympy-stubs/plotting/plot.pyi +++ b/stubs/sympy-stubs/plotting/plot.pyi @@ -1,5 +1,5 @@ from types import NotImplementedType -from typing import Any, Tuple +from typing import Any _show = ... @@ -145,4 +145,4 @@ def plot3d_parametric_line(*args, show=..., **kwargs) -> Plot: ... def plot3d(*args, show=..., **kwargs) -> Plot: ... def plot3d_parametric_surface(*args, show=..., **kwargs) -> Plot: ... def plot_contour(*args, show=..., **kwargs) -> Plot: ... -def check_arguments(args, expr_len, nb_of_free_symbols) -> list[Any] | list[Tuple | NotImplementedType] | None: ... +def check_arguments(args, expr_len, nb_of_free_symbols) -> list[Any] | list[tuple | NotImplementedType] | None: ... diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi index 9b91f8da..acc8754b 100644 --- a/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable from sympy.core.numbers import Integer from sympy.core.symbol import Symbol diff --git a/stubs/sympy-stubs/plotting/textplot.pyi b/stubs/sympy-stubs/plotting/textplot.pyi index fdf366dc..98827d4c 100644 --- a/stubs/sympy-stubs/plotting/textplot.pyi +++ b/stubs/sympy-stubs/plotting/textplot.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any def is_valid(x) -> bool: ... def rescale(y, W, H, mi, ma) -> list[Any]: ... diff --git a/stubs/sympy-stubs/polys/agca/ideals.pyi b/stubs/sympy-stubs/polys/agca/ideals.pyi index f87ee3d3..ddf197c8 100644 --- a/stubs/sympy-stubs/polys/agca/ideals.pyi +++ b/stubs/sympy-stubs/polys/agca/ideals.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator from types import NotImplementedType -from typing import Any, Generator +from typing import Any from typing_extensions import LiteralString from sympy.polys.polyutils import IntegerPowerable diff --git a/stubs/sympy-stubs/polys/matrices/dense.pyi b/stubs/sympy-stubs/polys/matrices/dense.pyi index ef574f46..469c002d 100644 --- a/stubs/sympy-stubs/polys/matrices/dense.pyi +++ b/stubs/sympy-stubs/polys/matrices/dense.pyi @@ -1,4 +1,5 @@ -from typing import Any, Sequence, TypeVar +from collections.abc import Sequence +from typing import Any, TypeVar from sympy.polys.matrices._typing import RingElement diff --git a/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi b/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi index 450e601c..c36ab721 100644 --- a/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi +++ b/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi @@ -1,6 +1,6 @@ from types import NotImplementedType from typing import Any, Literal -from typing_extensions import Self, Tuple as tTuple, Union as tUnion +from typing_extensions import Self from sympy.matrices.dense import MutableDenseMatrix from sympy.polys.domains import Domain @@ -11,11 +11,11 @@ from sympy.polys.matrices.sdm import SDM def DM(rows, domain) -> DomainMatrix: ... class DomainMatrix: - rep: tUnion[SDM, DDM] - shape: tTuple[int, int] + rep: SDM | DDM + shape: tuple[int, int] domain: Domain def __new__(cls, rows, shape, domain, *, fmt=...) -> Self: ... - def __getnewargs__(self) -> tuple[list[Any] | dict[Any, Any], tTuple[int, int], Any]: ... + def __getnewargs__(self) -> tuple[list[Any] | dict[Any, Any], tuple[int, int], Any]: ... def __getitem__(self, key) -> DomainScalar | Self: ... def getitem_sympy(self, i, j): ... def extract(self, rowslist, colslist) -> Self: ... diff --git a/stubs/sympy-stubs/polys/monomials.pyi b/stubs/sympy-stubs/polys/monomials.pyi index 0266cb9e..808b10fe 100644 --- a/stubs/sympy-stubs/polys/monomials.pyi +++ b/stubs/sympy-stubs/polys/monomials.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator +from collections.abc import Generator, Iterator +from typing import Any from typing_extensions import Self from sympy.polys.polyutils import PicklableWithSlots diff --git a/stubs/sympy-stubs/polys/numberfields/utilities.pyi b/stubs/sympy-stubs/polys/numberfields/utilities.pyi index 2f16fb29..fd153c13 100644 --- a/stubs/sympy-stubs/polys/numberfields/utilities.pyi +++ b/stubs/sympy-stubs/polys/numberfields/utilities.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal, NoReturn +from collections.abc import Generator +from typing import Any, Literal, NoReturn from sympy.utilities.decorator import public diff --git a/stubs/sympy-stubs/polys/polyconfig.pyi b/stubs/sympy-stubs/polys/polyconfig.pyi index 813dad29..3850879d 100644 --- a/stubs/sympy-stubs/polys/polyconfig.pyi +++ b/stubs/sympy-stubs/polys/polyconfig.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator from contextlib import contextmanager -from typing import Any, Generator +from typing import Any _default_config = ... _current_config = ... diff --git a/stubs/sympy-stubs/polys/polyoptions.pyi b/stubs/sympy-stubs/polys/polyoptions.pyi index 1b3141a0..19240228 100644 --- a/stubs/sympy-stubs/polys/polyoptions.pyi +++ b/stubs/sympy-stubs/polys/polyoptions.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator, Literal, NoReturn +from collections.abc import Generator +from typing import Any, Callable, Literal, NoReturn from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/polys/polytools.pyi b/stubs/sympy-stubs/polys/polytools.pyi index 541afda0..f58ad07a 100644 --- a/stubs/sympy-stubs/polys/polytools.pyi +++ b/stubs/sympy-stubs/polys/polytools.pyi @@ -1,7 +1,8 @@ +from collections.abc import Iterator from functools import _Wrapped from types import NotImplementedType -from typing import Any, Iterator, Literal -from typing_extensions import Self, Tuple +from typing import Any, Literal +from typing_extensions import Self from sympy.combinatorics.galois import S1TransitiveSubgroups, S2TransitiveSubgroups, S3TransitiveSubgroups from sympy.combinatorics.perm_groups import PermutationGroup @@ -393,7 +394,7 @@ def is_zero_dimensional(F, *gens, **args) -> Any: ... class GroebnerBasis(Basic): def __new__(cls, F, *gens, **args) -> Self: ... @property - def args(self) -> tuple[Tuple, Tuple]: ... + def args(self) -> tuple[tuple, tuple]: ... @property def exprs(self) -> list[Any]: ... @property diff --git a/stubs/sympy-stubs/polys/rationaltools.pyi b/stubs/sympy-stubs/polys/rationaltools.pyi index a864fa05..440d9c82 100644 --- a/stubs/sympy-stubs/polys/rationaltools.pyi +++ b/stubs/sympy-stubs/polys/rationaltools.pyi @@ -1,5 +1,3 @@ -from typing import Dict - from sympy.core.add import Add from sympy.core.basic import Basic from sympy.core.mul import Mul @@ -7,4 +5,4 @@ from sympy.series.order import Order from sympy.utilities import public @public -def together(expr, deep=..., fraction=...) -> Basic | Add | Order | Mul | Dict: ... +def together(expr, deep=..., fraction=...) -> Basic | Add | Order | Mul | dict: ... diff --git a/stubs/sympy-stubs/polys/rings.pyi b/stubs/sympy-stubs/polys/rings.pyi index 5b99cb5f..b308b1f9 100644 --- a/stubs/sympy-stubs/polys/rings.pyi +++ b/stubs/sympy-stubs/polys/rings.pyi @@ -1,5 +1,6 @@ +from collections.abc import Iterator from types import NotImplementedType -from typing import Any, Iterator, Literal +from typing import Any, Literal from typing_extensions import LiteralString, Self from sympy.core.sympify import CantSympify diff --git a/stubs/sympy-stubs/printing/printer.pyi b/stubs/sympy-stubs/printing/printer.pyi index adb6a14a..9d347fa5 100644 --- a/stubs/sympy-stubs/printing/printer.pyi +++ b/stubs/sympy-stubs/printing/printer.pyi @@ -1,6 +1,7 @@ import inspect +from collections.abc import Generator from contextlib import contextmanager -from typing import Any, Callable, Generator, Type +from typing import Any, Callable @contextmanager def printer_context(printer, **kwargs) -> Generator[None, Any, None]: ... @@ -18,7 +19,7 @@ class Printer: def emptyPrinter(self, expr) -> str: ... class _PrintFunction: - def __init__(self, f, print_cls: Type[Printer]) -> None: ... + def __init__(self, f, print_cls: type[Printer]) -> None: ... def __reduce__(self): ... def __call__(self, *args, **kwargs): ... @property diff --git a/stubs/sympy-stubs/series/approximants.pyi b/stubs/sympy-stubs/series/approximants.pyi index 6e4eba4f..4a0210f2 100644 --- a/stubs/sympy-stubs/series/approximants.pyi +++ b/stubs/sympy-stubs/series/approximants.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any from sympy.utilities import public diff --git a/stubs/sympy-stubs/series/formal.pyi b/stubs/sympy-stubs/series/formal.pyi index 90d67c7a..2f762d6b 100644 --- a/stubs/sympy-stubs/series/formal.pyi +++ b/stubs/sympy-stubs/series/formal.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/series/fourier.pyi b/stubs/sympy-stubs/series/fourier.pyi index 5da6855a..411adfcf 100644 --- a/stubs/sympy-stubs/series/fourier.pyi +++ b/stubs/sympy-stubs/series/fourier.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal +from collections.abc import Generator +from typing import Any, Literal from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/series/sequences.pyi b/stubs/sympy-stubs/series/sequences.pyi index a8134147..40396ad2 100644 --- a/stubs/sympy-stubs/series/sequences.pyi +++ b/stubs/sympy-stubs/series/sequences.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator, NoReturn +from collections.abc import Generator, Iterator +from typing import Any, NoReturn from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/series/series_class.pyi b/stubs/sympy-stubs/series/series_class.pyi index 3208a888..5b671579 100644 --- a/stubs/sympy-stubs/series/series_class.pyi +++ b/stubs/sympy-stubs/series/series_class.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator +from collections.abc import Generator, Iterator +from typing import Any from sympy.core.basic import Basic from sympy.core.cache import cacheit diff --git a/stubs/sympy-stubs/sets/fancysets.pyi b/stubs/sympy-stubs/sets/fancysets.pyi index 22cdfa43..d9f2bd87 100644 --- a/stubs/sympy-stubs/sets/fancysets.pyi +++ b/stubs/sympy-stubs/sets/fancysets.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator, Literal, NoReturn +from collections.abc import Generator, Iterator +from typing import Any, Literal, NoReturn from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/sets/powerset.pyi b/stubs/sympy-stubs/sets/powerset.pyi index 8ff03c48..e57e03fe 100644 --- a/stubs/sympy-stubs/sets/powerset.pyi +++ b/stubs/sympy-stubs/sets/powerset.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Iterator +from collections.abc import Generator, Iterator +from typing import Any from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/sets/sets.pyi b/stubs/sympy-stubs/sets/sets.pyi index 5ade7de3..baf7b7cb 100644 --- a/stubs/sympy-stubs/sets/sets.pyi +++ b/stubs/sympy-stubs/sets/sets.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator, Iterator from types import NotImplementedType -from typing import Any, Callable, Generator, Iterator, Literal +from typing import Any, Callable, Literal from typing_extensions import Self from sympy.core.basic import Basic diff --git a/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi b/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi index a2cfd5fb..3420b7c1 100644 --- a/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi +++ b/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator from types import NotImplementedType -from typing import Any, Generator, Literal, NoReturn +from typing import Any, Literal, NoReturn from sympy import Pow from sympy.core.function import UndefinedFunction diff --git a/stubs/sympy-stubs/solvers/ode/ode.pyi b/stubs/sympy-stubs/solvers/ode/ode.pyi index 21dab371..ffbb04fc 100644 --- a/stubs/sympy-stubs/solvers/ode/ode.pyi +++ b/stubs/sympy-stubs/solvers/ode/ode.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, Literal, NoReturn, Tuple +from collections.abc import Generator +from typing import Any, Literal, NoReturn from sympy.core.add import Add from sympy.core.basic import Basic @@ -46,7 +47,7 @@ def ode_sol_simplicity(sol, func, trysolving=...) -> int: ... def constantsimp(expr, constants) -> list[list[Any] | Any] | Eq | Relational | Ne | Add | Basic | Any: ... def constant_renumber( expr, variables=..., newconstants=... -) -> list[Any] | set[Any] | tuple[Any, ...] | Tuple | Basic | Eq | Relational | Ne: ... +) -> list[Any] | set[Any] | tuple[Any, ...] | tuple | Basic | Eq | Relational | Ne: ... def homogeneous_order(eq, *symbols) -> Any | None: ... def ode_2nd_power_series_ordinary(eq, func, order, match) -> Eq | Relational | Ne: ... def ode_2nd_power_series_regular(eq, func, order, match) -> Eq | Relational | Ne | None: ... diff --git a/stubs/sympy-stubs/solvers/ode/single.pyi b/stubs/sympy-stubs/solvers/ode/single.pyi index fc29ef56..d9648e1c 100644 --- a/stubs/sympy-stubs/solvers/ode/single.pyi +++ b/stubs/sympy-stubs/solvers/ode/single.pyi @@ -1,4 +1,5 @@ -from typing import Any, ClassVar, Iterator +from collections.abc import Iterator +from typing import Any, ClassVar from sympy.core.cache import cached_property from sympy.core.expr import Expr diff --git a/stubs/sympy-stubs/stats/frv.pyi b/stubs/sympy-stubs/stats/frv.pyi index 33da0c20..be1a2ca5 100644 --- a/stubs/sympy-stubs/stats/frv.pyi +++ b/stubs/sympy-stubs/stats/frv.pyi @@ -1,4 +1,5 @@ -from typing import Any, Dict, Generator, Iterator, Literal +from collections.abc import Generator, Iterator +from typing import Any, Literal from typing_extensions import Self from sympy import Basic, Equality, FiniteSet, Ne, Piecewise, Sum @@ -127,6 +128,6 @@ class ProductFinitePSpace(IndependentProductPSpace, FinitePSpace): def domain(self) -> ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain: ... @property @cacheit - def density(self) -> Dict: ... + def density(self) -> dict: ... def probability(self, condition): ... def compute_density(self, expr) -> FiniteDensity: ... diff --git a/stubs/sympy-stubs/stats/rv.pyi b/stubs/sympy-stubs/stats/rv.pyi index 783b2f3a..66e52fed 100644 --- a/stubs/sympy-stubs/stats/rv.pyi +++ b/stubs/sympy-stubs/stats/rv.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator from functools import singledispatch -from typing import Any, Generator +from typing import Any from typing_extensions import Self from sympy import Equality, FiniteSet, Integral, Ne, Piecewise, ProductSet, Sum diff --git a/stubs/sympy-stubs/stats/stochastic_process_types.pyi b/stubs/sympy-stubs/stats/stochastic_process_types.pyi index 414f1a91..60befd05 100644 --- a/stubs/sympy-stubs/stats/stochastic_process_types.pyi +++ b/stubs/sympy-stubs/stats/stochastic_process_types.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator, List as tList, Literal, Tuple as tTuple, Union as tUnion +from collections.abc import Generator +from typing import Any, Literal from typing_extensions import Self from sympy import Equality, Integral, Ne, Piecewise, Sum @@ -53,7 +54,7 @@ class StochasticProcess(Basic): @property def symbol(self) -> Basic: ... @property - def state_space(self) -> tUnion[FiniteSet, Range]: ... + def state_space(self) -> FiniteSet | Range: ... def distribution(self, key=...) -> Distribution: ... def density(self, x) -> Density: ... def __call__(self, time): ... @@ -86,7 +87,7 @@ class StochasticStateSpaceOf(Boolean): class MarkovProcess(StochasticProcess): @property - def number_of_states(self) -> tUnion[Integer, Symbol]: ... + def number_of_states(self) -> Integer | Symbol: ... def replace_with_index(self, condition) -> Relational | Eq | Ne: ... def probability(self, condition, given_condition=..., evaluate=..., **kwargs): ... def expectation(self, expr, condition=..., evaluate=..., **kwargs) -> ExpectationMatrix | Expectation | int: ... @@ -96,7 +97,7 @@ class DiscreteMarkovChain(DiscreteTimeStochasticProcess, MarkovProcess): def __new__(cls, sym, state_space=..., trans_probs=...) -> Self: ... @property def transition_probabilities(self) -> Basic: ... - def communication_classes(self) -> tList[tTuple[tList[Basic], Boolean, Integer]]: ... + def communication_classes(self) -> list[tuple[list[Basic], Boolean, Integer]]: ... def fundamental_matrix(self): ... def absorbing_probabilities(self) -> None: ... def absorbing_probabilites(self) -> None: ... @@ -104,12 +105,12 @@ class DiscreteMarkovChain(DiscreteTimeStochasticProcess, MarkovProcess): def is_ergodic(self): ... def is_absorbing_state(self, state) -> bool | None: ... def is_absorbing_chain(self) -> And: ... - def stationary_distribution(self, condition_set=...) -> tUnion[ImmutableMatrix, ConditionSet, Lambda]: ... + def stationary_distribution(self, condition_set=...) -> ImmutableMatrix | ConditionSet | Lambda: ... def fixed_row_vector(self) -> ImmutableMatrix | ConditionSet | Lambda: ... @property def limiting_distribution(self) -> ImmutableMatrix | ConditionSet | Lambda: ... - def decompose(self) -> tTuple[tList[Basic], ImmutableMatrix, ImmutableMatrix, ImmutableMatrix]: ... - def canonical_form(self) -> tTuple[tList[Basic], ImmutableMatrix]: ... + def decompose(self) -> tuple[list[Basic], ImmutableMatrix, ImmutableMatrix, ImmutableMatrix]: ... + def canonical_form(self) -> tuple[list[Basic], ImmutableMatrix]: ... def sample(self) -> Generator[Basic, Any, None]: ... class ContinuousMarkovChain(ContinuousTimeStochasticProcess, MarkovProcess): diff --git a/stubs/sympy-stubs/strategies/branch/core.pyi b/stubs/sympy-stubs/strategies/branch/core.pyi index b1c1fba6..60729f49 100644 --- a/stubs/sympy-stubs/strategies/branch/core.pyi +++ b/stubs/sympy-stubs/strategies/branch/core.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable def identity(x) -> Generator[Any, Any, None]: ... def exhaust(brule) -> Callable[..., Generator[Any, Any, None]]: ... diff --git a/stubs/sympy-stubs/strategies/branch/tools.pyi b/stubs/sympy-stubs/strategies/branch/tools.pyi index 60ab6f8d..b9472008 100644 --- a/stubs/sympy-stubs/strategies/branch/tools.pyi +++ b/stubs/sympy-stubs/strategies/branch/tools.pyi @@ -1,3 +1,4 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable def canon(*rules) -> Callable[..., Generator[Any, Any, None]]: ... diff --git a/stubs/sympy-stubs/strategies/branch/traverse.pyi b/stubs/sympy-stubs/strategies/branch/traverse.pyi index a8d9249d..74f4403a 100644 --- a/stubs/sympy-stubs/strategies/branch/traverse.pyi +++ b/stubs/sympy-stubs/strategies/branch/traverse.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable def top_down(brule, fns=...) -> Callable[..., Generator[Any, Any, None]]: ... def sall(brule, fns=...) -> Callable[..., Generator[Any, Any, None]]: ... diff --git a/stubs/sympy-stubs/strategies/tree.pyi b/stubs/sympy-stubs/strategies/tree.pyi index bfcd1c8f..8d420338 100644 --- a/stubs/sympy-stubs/strategies/tree.pyi +++ b/stubs/sympy-stubs/strategies/tree.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable def treeapply(tree, join, leaf=...): ... def greedy(tree, objective=..., **kwargs): ... diff --git a/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi b/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi index a1156df7..4a707d84 100644 --- a/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi +++ b/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi @@ -1,4 +1,3 @@ -from typing import List from typing_extensions import Self from sympy import Indexed @@ -8,7 +7,7 @@ from sympy.tensor.array.mutable_ndim_array import MutableNDimArray from sympy.tensor.array.ndim_array import ArrayKind, ImmutableNDimArray, NDimArray class DenseNDimArray(NDimArray): - _array: List[Basic] + _array: list[Basic] def __new__(self, *args, **kwargs) -> ImmutableDenseNDimArray: ... @property def kind(self) -> ArrayKind: ... diff --git a/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi b/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi index 9ef6fed1..54a7ba15 100644 --- a/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi +++ b/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi @@ -1,6 +1,7 @@ import typing +from collections.abc import Generator from ctypes import Array -from typing import Any, Generator, List, Optional, Tuple as tTuple +from typing import Any from typing_extensions import Self from sympy import ImmutableSparseNDimArray, NDimArray @@ -9,7 +10,7 @@ from sympy.core.expr import Expr from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray class _ArrayExpr(Expr): - shape: tTuple[Expr, ...] + shape: tuple[Expr, ...] def __getitem__(self, item) -> ArrayElement: ... class ArraySymbol(_ArrayExpr): @@ -147,8 +148,8 @@ class Reshape(_CodegenArrayAbstract): def as_explicit(self) -> Self | Array: ... class _ArgE: - indices: List[Optional[int]] - def __init__(self, element, indices: Optional[List[Optional[int]]] = ...) -> None: ... + indices: list[int | None] + def __init__(self, element, indices: list[int | None] | None = ...) -> None: ... __repr__ = ... @@ -159,23 +160,23 @@ class _IndPos: def __iter__(self) -> typing.Iterator[int]: ... class _EditArrayContraction: - def __init__(self, base_array: typing.Union[ArrayContraction, ArrayDiagonal, ArrayTensorProduct]) -> None: ... + def __init__(self, base_array: ArrayContraction | ArrayDiagonal | ArrayTensorProduct) -> None: ... def insert_after(self, arg: _ArgE, new_arg: _ArgE) -> None: ... def get_new_contraction_index(self) -> int: ... def refresh_indices(self) -> None: ... def merge_scalars(self) -> None: ... def to_array_contraction(self) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: ... - def get_contraction_indices(self) -> List[List[int]]: ... - def get_mapping_for_index(self, ind) -> List[_IndPos]: ... - def get_contraction_indices_to_ind_rel_pos(self) -> List[List[_IndPos]]: ... + def get_contraction_indices(self) -> list[list[int]]: ... + def get_mapping_for_index(self, ind) -> list[_IndPos]: ... + def get_contraction_indices_to_ind_rel_pos(self) -> list[list[_IndPos]]: ... def count_args_with_index(self, index: int) -> int: ... - def get_args_with_index(self, index: int) -> List[_ArgE]: ... + def get_args_with_index(self, index: int) -> list[_ArgE]: ... @property def number_of_diagonal_indices(self) -> int: ... def track_permutation_start(self) -> None: ... def track_permutation_merge(self, destination: _ArgE, from_element: _ArgE) -> None: ... - def get_absolute_free_range(self, arg: _ArgE) -> typing.Tuple[int, int]: ... - def get_absolute_range(self, arg: _ArgE) -> typing.Tuple[int, int]: ... + def get_absolute_free_range(self, arg: _ArgE) -> tuple[int, int]: ... + def get_absolute_range(self, arg: _ArgE) -> tuple[int, int]: ... def get_rank(expr) -> int: ... def get_shape(expr) -> tuple[()]: ... diff --git a/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi b/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi index a1e35e87..eeaad4f8 100644 --- a/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi +++ b/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi @@ -1,6 +1,6 @@ from functools import singledispatch from trace import Trace -from typing import Any, List, Union as tUnion +from typing import Any from sympy import Basic, MatAdd, MatrixExpr, Mul, Transpose, ZeroMatrix from sympy.matrices.expressions.applyfunc import ElementwiseApplyFunction @@ -53,7 +53,7 @@ def _(expr: ArrayElement) -> MatrixElement | ArrayElement: ... @singledispatch def _remove_trivial_dims(expr) -> Any: ... @_remove_trivial_dims.register(ArrayTensorProduct) -def _(expr: ArrayTensorProduct) -> tuple[ArrayTensorProduct | Mul, List[int] | list[Any]]: ... +def _(expr: ArrayTensorProduct) -> tuple[ArrayTensorProduct | Mul, list[int] | list[Any]]: ... @_remove_trivial_dims.register(ArrayAdd) def _( expr: ArrayAdd, @@ -61,16 +61,16 @@ def _( @_remove_trivial_dims.register(PermuteDims) def _( expr: PermuteDims, -) -> tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, List[int] | list[Any]]: ... +) -> tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, list[int] | list[Any]]: ... @_remove_trivial_dims.register(ArrayContraction) def _( expr: ArrayContraction, -) -> tuple[Any, List[int]] | tuple[Basic | Any | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims, list[int]]: ... +) -> tuple[Any, list[int]] | tuple[Basic | Any | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims, list[int]]: ... @_remove_trivial_dims.register(ArrayDiagonal) def _( expr: ArrayDiagonal, ) -> ( - tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, List[int]] + tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, list[int]] | tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, list[Any]] ): ... @_remove_trivial_dims.register(ElementwiseApplyFunction) @@ -79,7 +79,7 @@ def _(expr: ElementwiseApplyFunction) -> tuple[Any, list[Any]] | tuple[MatrixExp def _(expr: ArrayElementwiseApplyFunc) -> tuple[ArrayElementwiseApplyFunc, list[Any]]: ... def convert_array_to_matrix(expr): ... def identify_hadamard_products( - expr: tUnion[ArrayContraction, ArrayDiagonal], + expr: ArrayContraction | ArrayDiagonal, ) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: ... def identify_removable_identity_matrices(expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: ... def remove_identity_matrices( diff --git a/stubs/sympy-stubs/tensor/array/ndim_array.pyi b/stubs/sympy-stubs/tensor/array/ndim_array.pyi index e1f197b2..a4df61e1 100644 --- a/stubs/sympy-stubs/tensor/array/ndim_array.pyi +++ b/stubs/sympy-stubs/tensor/array/ndim_array.pyi @@ -1,5 +1,6 @@ +from collections.abc import Generator, Iterator from types import NotImplementedType -from typing import Any, Generator, Iterator +from typing import Any from typing_extensions import Self from sympy import ImmutableDenseNDimArray, ImmutableSparseNDimArray diff --git a/stubs/sympy-stubs/tensor/indexed.pyi b/stubs/sympy-stubs/tensor/indexed.pyi index b405032d..ce35964b 100644 --- a/stubs/sympy-stubs/tensor/indexed.pyi +++ b/stubs/sympy-stubs/tensor/indexed.pyi @@ -1,5 +1,5 @@ from typing import Any -from typing_extensions import Self, Tuple +from typing_extensions import Self from sympy import Basic, MatrixBase, NDimArray from sympy.core import Expr @@ -24,7 +24,7 @@ class Indexed(Expr): @property def rank(self) -> int: ... @property - def shape(self) -> Tuple: ... + def shape(self) -> tuple: ... @property def ranges(self) -> list[Any]: ... @property diff --git a/stubs/sympy-stubs/tensor/tensor.pyi b/stubs/sympy-stubs/tensor/tensor.pyi index 279b9d26..b3f5438a 100644 --- a/stubs/sympy-stubs/tensor/tensor.pyi +++ b/stubs/sympy-stubs/tensor/tensor.pyi @@ -1,6 +1,7 @@ from abc import ABC, abstractmethod +from collections.abc import Generator from types import NotImplementedType -from typing import Any, Generator, Literal +from typing import Any, Literal from typing_extensions import LiteralString, Self from sympy import ImmutableDenseNDimArray, ImmutableSparseNDimArray, Indexed, MutableDenseNDimArray diff --git a/stubs/sympy-stubs/testing/runtests.pyi b/stubs/sympy-stubs/testing/runtests.pyi index 31334227..5aac660e 100644 --- a/stubs/sympy-stubs/testing/runtests.pyi +++ b/stubs/sympy-stubs/testing/runtests.pyi @@ -1,8 +1,9 @@ import doctest as pdoctest from collections import namedtuple +from collections.abc import Generator from contextlib import contextmanager from doctest import DocTestFinder, DocTestRunner -from typing import Any, Generator, Literal +from typing import Any, Literal IS_WINDOWS = ... ON_CI = ... diff --git a/stubs/sympy-stubs/unify/core.pyi b/stubs/sympy-stubs/unify/core.pyi index e7e72721..a287b30d 100644 --- a/stubs/sympy-stubs/unify/core.pyi +++ b/stubs/sympy-stubs/unify/core.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any class Compound: def __init__(self, op, args) -> None: ... diff --git a/stubs/sympy-stubs/unify/rewrite.pyi b/stubs/sympy-stubs/unify/rewrite.pyi index 51787fa5..18f3cea2 100644 --- a/stubs/sympy-stubs/unify/rewrite.pyi +++ b/stubs/sympy-stubs/unify/rewrite.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable from sympy import Basic diff --git a/stubs/sympy-stubs/unify/usympy.pyi b/stubs/sympy-stubs/unify/usympy.pyi index 7f483e15..ce9e98e6 100644 --- a/stubs/sympy-stubs/unify/usympy.pyi +++ b/stubs/sympy-stubs/unify/usympy.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable from sympy import Basic from sympy.unify.core import Compound, CondVariable, Variable diff --git a/stubs/sympy-stubs/utilities/enumerative.pyi b/stubs/sympy-stubs/utilities/enumerative.pyi index 9e85258d..a5325afa 100644 --- a/stubs/sympy-stubs/utilities/enumerative.pyi +++ b/stubs/sympy-stubs/utilities/enumerative.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generator +from collections.abc import Generator +from typing import Any class PartComponent: __slots__ = ... diff --git a/stubs/sympy-stubs/utilities/exceptions.pyi b/stubs/sympy-stubs/utilities/exceptions.pyi index 09e4f42e..8d03b137 100644 --- a/stubs/sympy-stubs/utilities/exceptions.pyi +++ b/stubs/sympy-stubs/utilities/exceptions.pyi @@ -1,5 +1,6 @@ import contextlib -from typing import Any, Callable, Generator +from collections.abc import Generator +from typing import Any, Callable from typing_extensions import Self class SymPyDeprecationWarning(DeprecationWarning): diff --git a/stubs/sympy-stubs/utilities/iterables.pyi b/stubs/sympy-stubs/utilities/iterables.pyi index 8ad1e0d0..d3dc72e4 100644 --- a/stubs/sympy-stubs/utilities/iterables.pyi +++ b/stubs/sympy-stubs/utilities/iterables.pyi @@ -1,6 +1,7 @@ from collections import defaultdict +from collections.abc import Generator, Iterator from itertools import chain, combinations, combinations_with_replacement, permutations, product, product as cartes # noqa: F401 -from typing import Any, Generator, Iterator, Literal, NoReturn +from typing import Any, Literal, NoReturn from typing_extensions import Never from sympy import Basic, Symbol diff --git a/stubs/vispy/__init__.pyi b/stubs/vispy/__init__.pyi index 32a855f3..9b6d57a3 100644 --- a/stubs/vispy/__init__.pyi +++ b/stubs/vispy/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/app/__init__.pyi b/stubs/vispy/app/__init__.pyi index 841640a9..5cc4fc68 100644 --- a/stubs/vispy/app/__init__.pyi +++ b/stubs/vispy/app/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/app/_default_app.pyi b/stubs/vispy/app/_default_app.pyi index f8c3184c..5c5968c4 100644 --- a/stubs/vispy/app/_default_app.pyi +++ b/stubs/vispy/app/_default_app.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/app/application.pyi b/stubs/vispy/app/application.pyi index 01d90b61..11c25bc9 100644 --- a/stubs/vispy/app/application.pyi +++ b/stubs/vispy/app/application.pyi @@ -1,9 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - import builtins import os import sys @@ -12,7 +9,7 @@ from .. import config from ..util import logger from .base import BaseApplicationBackend as ApplicationBackend # noqa -class Application(object): +class Application: def __init__(self, backend_name: str | None = None): ... def __repr__(self): ... @property diff --git a/stubs/vispy/app/base.pyi b/stubs/vispy/app/base.pyi index 28f5f10d..a5ceedfb 100644 --- a/stubs/vispy/app/base.pyi +++ b/stubs/vispy/app/base.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -7,7 +6,7 @@ from timeit import default_timer from ..util import SimpleBunch -class BaseApplicationBackend(object): +class BaseApplicationBackend: def _vispy_get_backend_name(self): ... def _vispy_process_events(self): ... def _vispy_run(self): ... @@ -21,7 +20,7 @@ class BaseApplicationBackend(object): # functionality to deal with user input / latency can use those methods def _vispy_sleep(self, duration_sec): ... -class BaseCanvasBackend(object): +class BaseCanvasBackend: def __init__(self, vispy_canvas): ... def _process_backend_kwargs(self, kwargs): ... def _vispy_set_current(self): ... @@ -46,7 +45,7 @@ class BaseCanvasBackend(object): def _vispy_mouse_double_click(self, **kwargs): ... def _vispy_detect_double_click(self, ev, **kwargs): ... -class BaseTimerBackend(object): +class BaseTimerBackend: def __init__(self, vispy_timer): ... def _vispy_start(self, interval): ... def _vispy_stop(self): ... diff --git a/stubs/vispy/app/canvas.pyi b/stubs/vispy/app/canvas.pyi index a6eb7980..32accf97 100644 --- a/stubs/vispy/app/canvas.pyi +++ b/stubs/vispy/app/canvas.pyi @@ -1,12 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division, print_function - import sys +from collections.abc import Mapping from time import sleep -from typing import Callable, Mapping +from typing import Callable import numpy as np from numpy.typing import ArrayLike @@ -26,7 +24,7 @@ from .application import Application # todo: add hover enter/exit events # todo: add focus events -class Canvas(object): +class Canvas: def __init__( self, title: str = "VisPy canvas", diff --git a/stubs/vispy/app/timer.pyi b/stubs/vispy/app/timer.pyi index 5879164c..1d4b559e 100644 --- a/stubs/vispy/app/timer.pyi +++ b/stubs/vispy/app/timer.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from typing import Any diff --git a/stubs/vispy/color/__init__.pyi b/stubs/vispy/color/__init__.pyi index 5677b553..9a3b36f7 100644 --- a/stubs/vispy/color/__init__.pyi +++ b/stubs/vispy/color/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/color/_color_dict.pyi b/stubs/vispy/color/_color_dict.pyi index 3aac1894..16016bb9 100644 --- a/stubs/vispy/color/_color_dict.pyi +++ b/stubs/vispy/color/_color_dict.pyi @@ -1,8 +1,7 @@ -from typing import Mapping +from collections.abc import Mapping from numpy.typing import ArrayLike -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/color/color_array.pyi b/stubs/vispy/color/color_array.pyi index 9afcb49a..55f6d729 100644 --- a/stubs/vispy/color/color_array.pyi +++ b/stubs/vispy/color/color_array.pyi @@ -1,5 +1,6 @@ +from collections.abc import Sequence from copy import deepcopy -from typing import Literal, Sequence +from typing import Literal import numpy as np @@ -14,7 +15,6 @@ from .color_space import ( # noqa _rgb_to_lab, ) -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -28,7 +28,7 @@ def _array_clip_val(val): ... ############################################################################### # Color Array -class ColorArray(object): +class ColorArray: def __init__( self, color: str | tuple | Sequence = ..., diff --git a/stubs/vispy/color/color_space.pyi b/stubs/vispy/color/color_space.pyi index 2986ede3..fb54fb8e 100644 --- a/stubs/vispy/color/color_space.pyi +++ b/stubs/vispy/color/color_space.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/color/colormap.pyi b/stubs/vispy/color/colormap.pyi index bb23205d..4ae8a643 100644 --- a/stubs/vispy/color/colormap.pyi +++ b/stubs/vispy/color/colormap.pyi @@ -1,5 +1,5 @@ import warnings -from typing import Sequence +from collections.abc import Sequence import numpy as np from numpy.typing import ArrayLike, NDArray @@ -9,7 +9,6 @@ from ..ext.cubehelix import cubehelix from ..util.check_environment import has_matplotlib from .color_array import ColorArray -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -41,7 +40,7 @@ def _glsl_step(controls=None, colors=None, texture_map_data=None): ... # Mini GLSL template system for colors. def _process_glsl_template(template, colors): ... -class BaseColormap(object): +class BaseColormap: # Control colors used by the colormap. colors: None = ... diff --git a/stubs/vispy/ext/cocoapy.pyi b/stubs/vispy/ext/cocoapy.pyi index d11dfc8f..17eb80d6 100644 --- a/stubs/vispy/ext/cocoapy.pyi +++ b/stubs/vispy/ext/cocoapy.pyi @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import platform import struct import sys @@ -131,7 +129,7 @@ def add_ivar(cls, name, vartype): ... def set_instance_variable(obj, varname, value, vartype): ... def get_instance_variable(obj, varname, vartype): ... -class ObjCMethod(object): +class ObjCMethod: typecodes: dict = ... cfunctype_table: dict = ... @@ -142,12 +140,12 @@ class ObjCMethod(object): def get_callable(self): ... def __call__(self, objc_id, *args): ... -class ObjCBoundMethod(object): +class ObjCBoundMethod: def __init__(self, method, objc_id): ... def __repr__(self): ... def __call__(self, *args): ... -class ObjCClass(object): +class ObjCClass: _registered_classes: dict = ... def __new__(cls, class_name_or_ptr): ... @@ -158,7 +156,7 @@ class ObjCClass(object): def get_class_method(self, name): ... def __getattr__(self, name): ... -class ObjCInstance(object): +class ObjCInstance: _cached_objects: dict = ... def __new__(cls, object_ptr): ... @@ -167,7 +165,7 @@ class ObjCInstance(object): def convert_method_arguments(encoding, args): ... -class ObjCSubclass(object): +class ObjCSubclass: def __init__(self, superclass, name, register=True): ... def register(self): ... def add_ivar(self, varname, vartype): ... diff --git a/stubs/vispy/ext/cubehelix.pyi b/stubs/vispy/ext/cubehelix.pyi index fbee4ba7..de427488 100644 --- a/stubs/vispy/ext/cubehelix.pyi +++ b/stubs/vispy/ext/cubehelix.pyi @@ -5,8 +5,6 @@ from numpy import ndarray from .._typing import Scalar -# -*- coding: utf-8 -*- - def cubehelix( start: Scalar = 0.5, rot: Scalar = 1, diff --git a/stubs/vispy/geometry/__init__.pyi b/stubs/vispy/geometry/__init__.pyi index 4571f61b..2f0b7874 100644 --- a/stubs/vispy/geometry/__init__.pyi +++ b/stubs/vispy/geometry/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/geometry/calculations.pyi b/stubs/vispy/geometry/calculations.pyi index bf008775..ffc3fe40 100644 --- a/stubs/vispy/geometry/calculations.pyi +++ b/stubs/vispy/geometry/calculations.pyi @@ -1,7 +1,6 @@ import numpy as np from numpy.typing import NDArray -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/geometry/generation.pyi b/stubs/vispy/geometry/generation.pyi index 07930653..3bf691bb 100644 --- a/stubs/vispy/geometry/generation.pyi +++ b/stubs/vispy/geometry/generation.pyi @@ -4,7 +4,6 @@ from numpy.typing import ArrayLike, NDArray from ..geometry.meshdata import MeshData from .meshdata import MeshData -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/geometry/isocurve.pyi b/stubs/vispy/geometry/isocurve.pyi index 720e6cdc..c7b98735 100644 --- a/stubs/vispy/geometry/isocurve.pyi +++ b/stubs/vispy/geometry/isocurve.pyi @@ -1,7 +1,6 @@ import numpy as np from numpy.typing import NDArray -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/geometry/meshdata.pyi b/stubs/vispy/geometry/meshdata.pyi index f49c3ddd..14c5a146 100644 --- a/stubs/vispy/geometry/meshdata.pyi +++ b/stubs/vispy/geometry/meshdata.pyi @@ -1,15 +1,14 @@ -from typing import Mapping +from collections.abc import Mapping import numpy as np from numpy.typing import ArrayLike, NDArray -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. def _fix_colors(colors): ... -class MeshData(object): +class MeshData: def __init__( self, vertices: NDArray | None = None, diff --git a/stubs/vispy/geometry/normals.pyi b/stubs/vispy/geometry/normals.pyi index 003eb623..8dde5fbd 100644 --- a/stubs/vispy/geometry/normals.pyi +++ b/stubs/vispy/geometry/normals.pyi @@ -1,7 +1,6 @@ import numpy as np from numpy.typing import NDArray -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/geometry/parametric.pyi b/stubs/vispy/geometry/parametric.pyi index 37a5585c..88251981 100644 --- a/stubs/vispy/geometry/parametric.pyi +++ b/stubs/vispy/geometry/parametric.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/geometry/polygon.pyi b/stubs/vispy/geometry/polygon.pyi index da556255..2e90a966 100644 --- a/stubs/vispy/geometry/polygon.pyi +++ b/stubs/vispy/geometry/polygon.pyi @@ -3,13 +3,12 @@ from numpy.typing import ArrayLike from .triangulation import Triangulation -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- -class PolygonData(object): +class PolygonData: def __init__( self, vertices: ArrayLike | None = None, diff --git a/stubs/vispy/geometry/rect.pyi b/stubs/vispy/geometry/rect.pyi index 21751d9d..7c9f0079 100644 --- a/stubs/vispy/geometry/rect.pyi +++ b/stubs/vispy/geometry/rect.pyi @@ -1,6 +1,6 @@ import numpy as np -class Rect(object): +class Rect: def __init__(self, *args, **kwargs): ... @property def pos(self): ... diff --git a/stubs/vispy/geometry/torusknot.pyi b/stubs/vispy/geometry/torusknot.pyi index d3c1faef..be4cfb30 100644 --- a/stubs/vispy/geometry/torusknot.pyi +++ b/stubs/vispy/geometry/torusknot.pyi @@ -1,10 +1,8 @@ -from __future__ import division - from math import gcd import numpy as np -class TorusKnot(object): +class TorusKnot: def __init__( self, p: int = 3, diff --git a/stubs/vispy/geometry/triangulation.pyi b/stubs/vispy/geometry/triangulation.pyi index b7d79b50..59593b64 100644 --- a/stubs/vispy/geometry/triangulation.pyi +++ b/stubs/vispy/geometry/triangulation.pyi @@ -4,9 +4,7 @@ from itertools import permutations import numpy as np from numpy.typing import ArrayLike -# -*- coding: utf-8 -*- - -class Triangulation(object): +class Triangulation: def __init__(self, pts: ArrayLike, edges: ArrayLike): ... def _normalize(self): ... def _initialize(self): ... diff --git a/stubs/vispy/gloo/__init__.pyi b/stubs/vispy/gloo/__init__.pyi index f513d480..db630c3f 100644 --- a/stubs/vispy/gloo/__init__.pyi +++ b/stubs/vispy/gloo/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/buffer.pyi b/stubs/vispy/gloo/buffer.pyi index 9412aa68..3987bac9 100644 --- a/stubs/vispy/gloo/buffer.pyi +++ b/stubs/vispy/gloo/buffer.pyi @@ -9,7 +9,6 @@ from ..gloo.buffer import DataBuffer from ..util import logger from .globject import GLObject -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/context.pyi b/stubs/vispy/gloo/context.pyi index 5d988330..63bc5221 100644 --- a/stubs/vispy/gloo/context.pyi +++ b/stubs/vispy/gloo/context.pyi @@ -1,13 +1,13 @@ import weakref +from collections.abc import Mapping from copy import deepcopy -from typing import Any, Mapping +from typing import Any from .. import config from ..util.event import Event from .glir import BaseGlirParser, GlirParser, GlirQueue, glir_logger from .wrappers import BaseGlooFunctions -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -37,7 +37,7 @@ class GLContext(BaseGlooFunctions): def set_viewport(self, *args): ... def get_viewport(self): ... -class GLShared(object): +class GLShared: # We keep a (weak) ref of each backend that gets associated with # this object. In theory, this means that multiple canvases can # be created and also deleted; as long as there is at least one @@ -55,6 +55,6 @@ class GLShared(object): @property def ref(self): ... -class FakeCanvas(object): +class FakeCanvas: def __init__(self): ... def flush(self): ... diff --git a/stubs/vispy/gloo/framebuffer.pyi b/stubs/vispy/gloo/framebuffer.pyi index c57ec827..73ab70ef 100644 --- a/stubs/vispy/gloo/framebuffer.pyi +++ b/stubs/vispy/gloo/framebuffer.pyi @@ -8,7 +8,6 @@ from .globject import GLObject from .texture import Texture2D from .wrappers import _check_valid, read_pixels -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/gl/__init__.pyi b/stubs/vispy/gloo/gl/__init__.pyi index 8432985a..5221df14 100644 --- a/stubs/vispy/gloo/gl/__init__.pyi +++ b/stubs/vispy/gloo/gl/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/gl/_proxy.pyi b/stubs/vispy/gloo/gl/_proxy.pyi index bd1f5e30..2fdcc96e 100644 --- a/stubs/vispy/gloo/gl/_proxy.pyi +++ b/stubs/vispy/gloo/gl/_proxy.pyi @@ -1,4 +1,4 @@ -class BaseGLProxy(object): +class BaseGLProxy: def __call__(self, funcname, returns, *args): ... def glActiveTexture(self, texture): ... def glAttachShader(self, program, shader): ... diff --git a/stubs/vispy/gloo/gl/dummy.pyi b/stubs/vispy/gloo/gl/dummy.pyi index 8c439f17..92d26503 100644 --- a/stubs/vispy/gloo/gl/dummy.pyi +++ b/stubs/vispy/gloo/gl/dummy.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/gl/gl2.pyi b/stubs/vispy/gloo/gl/gl2.pyi index ab0917fe..2581bec2 100644 --- a/stubs/vispy/gloo/gl/gl2.pyi +++ b/stubs/vispy/gloo/gl/gl2.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/gl/glplus.pyi b/stubs/vispy/gloo/gl/glplus.pyi index 97a62f9e..e4229acf 100644 --- a/stubs/vispy/gloo/gl/glplus.pyi +++ b/stubs/vispy/gloo/gl/glplus.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/gl/pyopengl2.pyi b/stubs/vispy/gloo/gl/pyopengl2.pyi index 9090aff5..398d0419 100644 --- a/stubs/vispy/gloo/gl/pyopengl2.pyi +++ b/stubs/vispy/gloo/gl/pyopengl2.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/glir.pyi b/stubs/vispy/gloo/glir.pyi index e18d9942..4833a2e8 100644 --- a/stubs/vispy/gloo/glir.pyi +++ b/stubs/vispy/gloo/glir.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -29,7 +28,7 @@ JUST_DELETED: str = ... def as_enum(enum): ... -class _GlirQueueShare(object): +class _GlirQueueShare: def __init__(self, queue): ... def command(self, *args): ... def set_verbose(self, verbose): ... @@ -38,7 +37,7 @@ class _GlirQueueShare(object): def flush(self, parser): ... def _filter(self, commands, parser): ... -class GlirQueue(object): +class GlirQueue: def __init__(self): ... def command(self, *args): ... def set_verbose(self, verbose): ... @@ -51,7 +50,7 @@ def _convert_desktop_shader(shader): ... def convert_shader(backend_type, shader): ... def as_es2_command(command): ... -class BaseGlirParser(object): +class BaseGlirParser: def __init__(self): ... def is_remote(self): ... @property @@ -72,7 +71,7 @@ def glir_logger(parser_cls, file_or_filename): ... # GLIR objects -class GlirObject(object): +class GlirObject: def __init__(self, parser, id_): ... @property def handle(self): ... diff --git a/stubs/vispy/gloo/globject.pyi b/stubs/vispy/gloo/globject.pyi index 775dfe77..489cecee 100644 --- a/stubs/vispy/gloo/globject.pyi +++ b/stubs/vispy/gloo/globject.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -6,7 +5,7 @@ from .glir import GlirQueue -class GLObject(object): +class GLObject: # Type of GLIR object, reset in subclasses _GLIR_TYPE: str = ... diff --git a/stubs/vispy/gloo/preprocessor.pyi b/stubs/vispy/gloo/preprocessor.pyi index 8b8f1df4..9440edce 100644 --- a/stubs/vispy/gloo/preprocessor.pyi +++ b/stubs/vispy/gloo/preprocessor.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/program.pyi b/stubs/vispy/gloo/program.pyi index 25dba9a6..27ca458c 100644 --- a/stubs/vispy/gloo/program.pyi +++ b/stubs/vispy/gloo/program.pyi @@ -12,7 +12,6 @@ from .preprocessor import preprocess from .texture import BaseTexture, Texture1D, Texture2D, Texture3D, TextureCube from .util import check_enum -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/texture.pyi b/stubs/vispy/gloo/texture.pyi index 56a9f312..1c5698e8 100644 --- a/stubs/vispy/gloo/texture.pyi +++ b/stubs/vispy/gloo/texture.pyi @@ -8,7 +8,6 @@ from numpy.typing import NDArray from .globject import GLObject from .util import check_enum -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/util.pyi b/stubs/vispy/gloo/util.pyi index 283c0238..c3941981 100644 --- a/stubs/vispy/gloo/util.pyi +++ b/stubs/vispy/gloo/util.pyi @@ -1,7 +1,6 @@ from ..gloo.texture import Texture2D from .wrappers import read_pixels -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/gloo/wrappers.pyi b/stubs/vispy/gloo/wrappers.pyi index 25729acb..cd1de955 100644 --- a/stubs/vispy/gloo/wrappers.pyi +++ b/stubs/vispy/gloo/wrappers.pyi @@ -1,5 +1,6 @@ +from collections.abc import Mapping from copy import deepcopy -from typing import Literal, Mapping +from typing import Literal import numpy as np from numpy import dtype @@ -9,7 +10,6 @@ from ..color import Color from ..util import logger from . import gl -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -68,7 +68,7 @@ def _check_valid(key, val, valid): ... def _to_args(x): ... def _check_conversion(key, valid_dict): ... -class BaseGlooFunctions(object): +class BaseGlooFunctions: ########################################################################## # PRIMITIVE/VERTEX diff --git a/stubs/vispy/glsl/__init__.pyi b/stubs/vispy/glsl/__init__.pyi index 3663d9fc..2bc7d76e 100644 --- a/stubs/vispy/glsl/__init__.pyi +++ b/stubs/vispy/glsl/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/glsl/build_spatial_filters.pyi b/stubs/vispy/glsl/build_spatial_filters.pyi index d7018e30..6d7a774b 100644 --- a/stubs/vispy/glsl/build_spatial_filters.pyi +++ b/stubs/vispy/glsl/build_spatial_filters.pyi @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # glumpy is an OpenGL framework for the fast visualization of numpy arrays. # Copyright (C) 2009-2011 Nicolas P. Rougier. All rights reserved. diff --git a/stubs/vispy/io/__init__.pyi b/stubs/vispy/io/__init__.pyi index cd4b541a..4d9e41c4 100644 --- a/stubs/vispy/io/__init__.pyi +++ b/stubs/vispy/io/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/io/datasets.pyi b/stubs/vispy/io/datasets.pyi index 54f0ec9f..02822185 100644 --- a/stubs/vispy/io/datasets.pyi +++ b/stubs/vispy/io/datasets.pyi @@ -5,7 +5,6 @@ from numpy.typing import ArrayLike from ..util import load_data_file as load_data_file -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/io/image.pyi b/stubs/vispy/io/image.pyi index 93cebc60..896906f7 100644 --- a/stubs/vispy/io/image.pyi +++ b/stubs/vispy/io/image.pyi @@ -4,7 +4,6 @@ import zlib import numpy as np from numpy.typing import ArrayLike -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/io/mesh.pyi b/stubs/vispy/io/mesh.pyi index 31ed55e7..d0693de3 100644 --- a/stubs/vispy/io/mesh.pyi +++ b/stubs/vispy/io/mesh.pyi @@ -7,7 +7,6 @@ from numpy.typing import ArrayLike from .stl import load_stl from .wavefront import WavefrontReader, WavefrontWriter -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/io/stl.pyi b/stubs/vispy/io/stl.pyi index 5be1f15b..ee2e1e36 100644 --- a/stubs/vispy/io/stl.pyi +++ b/stubs/vispy/io/stl.pyi @@ -4,7 +4,6 @@ import numpy as np from .._typing import FileLike -# -*- coding: utf-8 -*- # Copyright (c) 2015 Michael Dawson-Haggerty # Distributed under the MIT License. # Copied from the trimesh project. diff --git a/stubs/vispy/io/wavefront.pyi b/stubs/vispy/io/wavefront.pyi index 457988a2..fa80021d 100644 --- a/stubs/vispy/io/wavefront.pyi +++ b/stubs/vispy/io/wavefront.pyi @@ -8,12 +8,11 @@ from numpy.typing import NDArray from ..geometry import _calculate_normals from ..util import logger -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # This module was taken from visvis -class WavefrontReader(object): +class WavefrontReader: def __init__(self, f): ... @classmethod def read(cls, fname: str): ... @@ -24,7 +23,7 @@ class WavefrontReader(object): def _calculate_normals(self): ... def finish(self): ... -class WavefrontWriter(object): +class WavefrontWriter: def __init__(self, f): ... @classmethod def write( diff --git a/stubs/vispy/plot/__init__.pyi b/stubs/vispy/plot/__init__.pyi index f379ceaa..c57fbdd7 100644 --- a/stubs/vispy/plot/__init__.pyi +++ b/stubs/vispy/plot/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/plot/fig.pyi b/stubs/vispy/plot/fig.pyi index 7a3923eb..5695c3cd 100644 --- a/stubs/vispy/plot/fig.pyi +++ b/stubs/vispy/plot/fig.pyi @@ -2,7 +2,6 @@ from ..scene import SceneCanvas from ..util.svg.color import Color from .plotwidget import PlotWidget -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/plot/plotwidget.pyi b/stubs/vispy/plot/plotwidget.pyi index acbe17d8..f537e188 100644 --- a/stubs/vispy/plot/plotwidget.pyi +++ b/stubs/vispy/plot/plotwidget.pyi @@ -10,7 +10,6 @@ from ..io import read_mesh from ..scene.visuals import Image, LinePlot, Mesh, Polygon, Spectrogram, Volume from ..scene.widgets.colorbar import ColorBarWidget -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/__init__.pyi b/stubs/vispy/scene/__init__.pyi index 2b3f41fd..fcde669c 100644 --- a/stubs/vispy/scene/__init__.pyi +++ b/stubs/vispy/scene/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/cameras/__init__.pyi b/stubs/vispy/scene/cameras/__init__.pyi index 2341094a..897b1816 100644 --- a/stubs/vispy/scene/cameras/__init__.pyi +++ b/stubs/vispy/scene/cameras/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. __all__ = [ diff --git a/stubs/vispy/scene/cameras/_base.pyi b/stubs/vispy/scene/cameras/_base.pyi index 0257bb56..c145a6fb 100644 --- a/stubs/vispy/scene/cameras/_base.pyi +++ b/stubs/vispy/scene/cameras/_base.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from .arcball import ArcballCamera diff --git a/stubs/vispy/scene/cameras/arcball.pyi b/stubs/vispy/scene/cameras/arcball.pyi index caffad9b..1a918ee9 100644 --- a/stubs/vispy/scene/cameras/arcball.pyi +++ b/stubs/vispy/scene/cameras/arcball.pyi @@ -1,9 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - import numpy as np from ...util import transforms diff --git a/stubs/vispy/scene/cameras/base_camera.pyi b/stubs/vispy/scene/cameras/base_camera.pyi index afe23ae3..2da6b3cc 100644 --- a/stubs/vispy/scene/cameras/base_camera.pyi +++ b/stubs/vispy/scene/cameras/base_camera.pyi @@ -1,4 +1,5 @@ -from typing import Literal, Mapping +from collections.abc import Mapping +from typing import Literal from numpy.typing import ArrayLike @@ -7,7 +8,6 @@ from ...util.event import Event from ...visuals.transforms import MatrixTransform, NullTransform, STTransform, TransformCache from ..node import Node -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/cameras/fly.pyi b/stubs/vispy/scene/cameras/fly.pyi index f1adc09a..b242bb80 100644 --- a/stubs/vispy/scene/cameras/fly.pyi +++ b/stubs/vispy/scene/cameras/fly.pyi @@ -7,7 +7,6 @@ from ...util.event import Event from ...util.quaternion import Quaternion from .perspective import PerspectiveCamera -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/cameras/magnify.pyi b/stubs/vispy/scene/cameras/magnify.pyi index df1c3c7f..3c4f13c9 100644 --- a/stubs/vispy/scene/cameras/magnify.pyi +++ b/stubs/vispy/scene/cameras/magnify.pyi @@ -4,7 +4,6 @@ from ...util.event import Event from ...visuals.transforms.nonlinear import Magnify1DTransform, MagnifyTransform from .panzoom import PanZoomCamera -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/cameras/panzoom.pyi b/stubs/vispy/scene/cameras/panzoom.pyi index 78b3ec53..c90ba374 100644 --- a/stubs/vispy/scene/cameras/panzoom.pyi +++ b/stubs/vispy/scene/cameras/panzoom.pyi @@ -5,7 +5,6 @@ from ...util.event import Event from ...visuals.transforms import MatrixTransform, STTransform from .base_camera import BaseCamera -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/cameras/perspective.pyi b/stubs/vispy/scene/cameras/perspective.pyi index 6f703682..b1d4df28 100644 --- a/stubs/vispy/scene/cameras/perspective.pyi +++ b/stubs/vispy/scene/cameras/perspective.pyi @@ -8,7 +8,6 @@ from ...util.event import Event from ...visuals.transforms import MatrixTransform from .base_camera import BaseCamera -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/cameras/turntable.pyi b/stubs/vispy/scene/cameras/turntable.pyi index 5d0e66d1..d6797014 100644 --- a/stubs/vispy/scene/cameras/turntable.pyi +++ b/stubs/vispy/scene/cameras/turntable.pyi @@ -1,9 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - import numpy as np from ...util import transforms diff --git a/stubs/vispy/scene/canvas.pyi b/stubs/vispy/scene/canvas.pyi index 91d72f53..75560f7a 100644 --- a/stubs/vispy/scene/canvas.pyi +++ b/stubs/vispy/scene/canvas.pyi @@ -1,5 +1,5 @@ import weakref -from typing import Mapping +from collections.abc import Mapping import numpy as np from numpy.typing import ArrayLike @@ -23,7 +23,6 @@ from .subscene import SubScene from .visuals import VisualNode from .widgets import Widget -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/events.pyi b/stubs/vispy/scene/events.pyi index 77313180..1975643d 100644 --- a/stubs/vispy/scene/events.pyi +++ b/stubs/vispy/scene/events.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/node.pyi b/stubs/vispy/scene/node.pyi index 065ee566..baec4c98 100644 --- a/stubs/vispy/scene/node.pyi +++ b/stubs/vispy/scene/node.pyi @@ -7,11 +7,10 @@ from ..visuals.transforms import BaseTransform, ChainTransform, NullTransform, T from ..visuals.transforms.chain import ChainTransform from ..visuals.transforms.transform_system import TransformSystem -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -class Node(object): +class Node: # Needed to allow subclasses to repr() themselves before Node.__init__() _name: None = ... diff --git a/stubs/vispy/scene/subscene.pyi b/stubs/vispy/scene/subscene.pyi index b025f0e7..71c9b9ae 100644 --- a/stubs/vispy/scene/subscene.pyi +++ b/stubs/vispy/scene/subscene.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/visuals.pyi b/stubs/vispy/scene/visuals.pyi index f021d8af..4bda8567 100644 --- a/stubs/vispy/scene/visuals.pyi +++ b/stubs/vispy/scene/visuals.pyi @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import re import weakref -from typing import ClassVar, Type, TypeVar +from typing import TypeVar from .. import visuals from ..scene.node import Node diff --git a/stubs/vispy/scene/widgets/__init__.pyi b/stubs/vispy/scene/widgets/__init__.pyi index 9505d7d4..b83e4b46 100644 --- a/stubs/vispy/scene/widgets/__init__.pyi +++ b/stubs/vispy/scene/widgets/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. __all__ = [ diff --git a/stubs/vispy/scene/widgets/axis.pyi b/stubs/vispy/scene/widgets/axis.pyi index 0f25507d..b5a06d27 100644 --- a/stubs/vispy/scene/widgets/axis.pyi +++ b/stubs/vispy/scene/widgets/axis.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/widgets/colorbar.pyi b/stubs/vispy/scene/widgets/colorbar.pyi index 579b3047..88bdfa5d 100644 --- a/stubs/vispy/scene/widgets/colorbar.pyi +++ b/stubs/vispy/scene/widgets/colorbar.pyi @@ -7,7 +7,6 @@ from ...util.event import Event from ...visuals import ColorBarVisual from .widget import Widget -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/widgets/console.pyi b/stubs/vispy/scene/widgets/console.pyi index da28f8dc..59a8ccd6 100644 --- a/stubs/vispy/scene/widgets/console.pyi +++ b/stubs/vispy/scene/widgets/console.pyi @@ -7,7 +7,6 @@ from ...util.svg.color import Color from ...visuals import Visual from .widget import Widget -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/widgets/grid.pyi b/stubs/vispy/scene/widgets/grid.pyi index e94bedc8..2ce40d3c 100644 --- a/stubs/vispy/scene/widgets/grid.pyi +++ b/stubs/vispy/scene/widgets/grid.pyi @@ -4,7 +4,6 @@ from kiwisolver import Solver, UnsatisfiableConstraint, Variable from .viewbox import ViewBox from .widget import Widget -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/widgets/label.pyi b/stubs/vispy/scene/widgets/label.pyi index 29d8e182..152fac85 100644 --- a/stubs/vispy/scene/widgets/label.pyi +++ b/stubs/vispy/scene/widgets/label.pyi @@ -2,7 +2,6 @@ from ...util.event import Event from ...visuals import TextVisual from .widget import Widget -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/widgets/viewbox.pyi b/stubs/vispy/scene/widgets/viewbox.pyi index b0fd86e0..3eec234a 100644 --- a/stubs/vispy/scene/widgets/viewbox.pyi +++ b/stubs/vispy/scene/widgets/viewbox.pyi @@ -7,7 +7,6 @@ from ..node import Node from ..subscene import SubScene from .widget import Widget -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/scene/widgets/widget.pyi b/stubs/vispy/scene/widgets/widget.pyi index 76975a53..6c03a1ec 100644 --- a/stubs/vispy/scene/widgets/widget.pyi +++ b/stubs/vispy/scene/widgets/widget.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/testing/__init__.pyi b/stubs/vispy/testing/__init__.pyi index 90221787..47023e92 100644 --- a/stubs/vispy/testing/__init__.pyi +++ b/stubs/vispy/testing/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/testing/_runners.pyi b/stubs/vispy/testing/_runners.pyi index 8535ebcb..bc715d0d 100644 --- a/stubs/vispy/testing/_runners.pyi +++ b/stubs/vispy/testing/_runners.pyi @@ -11,7 +11,6 @@ from ..util import run_subprocess, use_log_level from ..util.ptime import time from ._testing import IS_CI, IS_TRAVIS_CI, has_application, nottest -# -*- coding: utf-8 -*- # vispy: testskip # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/testing/_testing.pyi b/stubs/vispy/testing/_testing.pyi index fa7a4d5d..19529c14 100644 --- a/stubs/vispy/testing/_testing.pyi +++ b/stubs/vispy/testing/_testing.pyi @@ -1,11 +1,8 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- -from __future__ import print_function - import functools import gc import inspect @@ -36,7 +33,7 @@ def assert_not_equal(x, y, msg=None): ... def assert_not_in(member, container, msg=None): ... def assert_is(expr1, expr2, msg=None): ... -class raises(object): +class raises: def __init__(self, exc): ... def __enter__(self): ... def __exit__(self, exc_typ, exc, tb): ... diff --git a/stubs/vispy/testing/image_tester.pyi b/stubs/vispy/testing/image_tester.pyi index 60394027..1945236f 100644 --- a/stubs/vispy/testing/image_tester.pyi +++ b/stubs/vispy/testing/image_tester.pyi @@ -17,7 +17,6 @@ from ..io import read_png, write_png from ..util import run_subprocess from . import IS_CI -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/testing/rendered_array_tester.pyi b/stubs/vispy/testing/rendered_array_tester.pyi index 0f34dd51..5f5a5f35 100644 --- a/stubs/vispy/testing/rendered_array_tester.pyi +++ b/stubs/vispy/testing/rendered_array_tester.pyi @@ -1,19 +1,16 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- -from typing import Any, Optional - import numpy as np from numpy.typing import ArrayLike, DTypeLike def compare_render( orig_data: ArrayLike, rendered_data: ArrayLike, - previous_render: Optional[ArrayLike] = None, - atol: Optional[float] = 1.0, + previous_render: ArrayLike | None = None, + atol: float | None = 1.0, ): ... def max_for_dtype(input_dtype: DTypeLike): ... def make_rgba(data_in: ArrayLike) -> ArrayLike: ... diff --git a/stubs/vispy/util/__init__.pyi b/stubs/vispy/util/__init__.pyi index 29e987df..225438fd 100644 --- a/stubs/vispy/util/__init__.pyi +++ b/stubs/vispy/util/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/bunch.pyi b/stubs/vispy/util/bunch.pyi index 103ba048..04fb14d3 100644 --- a/stubs/vispy/util/bunch.pyi +++ b/stubs/vispy/util/bunch.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/check_environment.pyi b/stubs/vispy/util/check_environment.pyi index e0ad738b..a91aa01c 100644 --- a/stubs/vispy/util/check_environment.pyi +++ b/stubs/vispy/util/check_environment.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import os diff --git a/stubs/vispy/util/config.pyi b/stubs/vispy/util/config.pyi index e97b893a..b4fdf6b6 100644 --- a/stubs/vispy/util/config.pyi +++ b/stubs/vispy/util/config.pyi @@ -8,16 +8,15 @@ import platform import sys import tempfile import traceback +from collections.abc import Mapping from os import path as op from shutil import rmtree -from typing import Mapping import numpy as np from .event import EmitterGroup, Event, EventEmitter from .logs import logger, set_log_level, use_log_level -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -47,7 +46,7 @@ def _get_vispy_app_dir(): ... class ConfigEvent(Event): def __init__(self, changes): ... -class Config(object): +class Config: def __init__(self, **kwargs): ... def __getitem__(self, item): ... def __setitem__(self, item, val): ... diff --git a/stubs/vispy/util/dpi/__init__.pyi b/stubs/vispy/util/dpi/__init__.pyi index 3ddb4ac2..a33a5029 100644 --- a/stubs/vispy/util/dpi/__init__.pyi +++ b/stubs/vispy/util/dpi/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/eq.pyi b/stubs/vispy/util/eq.pyi index 0f3887b0..44e16ecf 100644 --- a/stubs/vispy/util/eq.pyi +++ b/stubs/vispy/util/eq.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from numpy import bool_, ndarray def eq(a, b): ... diff --git a/stubs/vispy/util/event.pyi b/stubs/vispy/util/event.pyi index 71fb6e2b..64c5af4a 100644 --- a/stubs/vispy/util/event.pyi +++ b/stubs/vispy/util/event.pyi @@ -8,11 +8,10 @@ from numpy.typing import ArrayLike from .logs import _handle_exception, logger -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -class Event(object): +class Event: def __init__(self, type: str, native=None, **kwargs): ... @property def source(self): ... @@ -37,7 +36,7 @@ class Event(object): _event_repr_depth: int = ... -class EventEmitter(object): +class EventEmitter: def __init__(self, source: Any = None, type: str | None = None, event_class: Event = ...): ... @property def ignore_callback_errors(self): ... @@ -97,7 +96,7 @@ class EmitterGroup(EventEmitter): @ignore_callback_errors.setter def ignore_callback_errors(self, ignore): ... -class EventBlocker(object): +class EventBlocker: def __init__(self, target, callback=None): ... def __enter__(self): ... def __exit__(self, *args): ... diff --git a/stubs/vispy/util/fetching.pyi b/stubs/vispy/util/fetching.pyi index 5e57b0e1..9abe2142 100644 --- a/stubs/vispy/util/fetching.pyi +++ b/stubs/vispy/util/fetching.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -20,7 +19,7 @@ def load_data_file(fname: str, directory: str | None = None, force_download: str ############################################################################### # File downloading (most adapted from mne-python) -class ProgressBar(object): +class ProgressBar: spinner_symbols: list = ... template: str = ... diff --git a/stubs/vispy/util/filter.pyi b/stubs/vispy/util/filter.pyi index a41ed505..4a48daee 100644 --- a/stubs/vispy/util/filter.pyi +++ b/stubs/vispy/util/filter.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/fonts/__init__.pyi b/stubs/vispy/util/fonts/__init__.pyi index 79bac94b..c371eac4 100644 --- a/stubs/vispy/util/fonts/__init__.pyi +++ b/stubs/vispy/util/fonts/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/fonts/_quartz.pyi b/stubs/vispy/util/fonts/_quartz.pyi index 0384ce26..89868257 100644 --- a/stubs/vispy/util/fonts/_quartz.pyi +++ b/stubs/vispy/util/fonts/_quartz.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/fonts/_triage.pyi b/stubs/vispy/util/fonts/_triage.pyi index ad372991..83a62320 100644 --- a/stubs/vispy/util/fonts/_triage.pyi +++ b/stubs/vispy/util/fonts/_triage.pyi @@ -4,7 +4,6 @@ from numpy.typing import ArrayLike from ._vispy_fonts import _vispy_fonts -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/fonts/_vispy_fonts.pyi b/stubs/vispy/util/fonts/_vispy_fonts.pyi index efdf2973..af3e5f31 100644 --- a/stubs/vispy/util/fonts/_vispy_fonts.pyi +++ b/stubs/vispy/util/fonts/_vispy_fonts.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/fourier.pyi b/stubs/vispy/util/fourier.pyi index 2b4117a3..d6066a8f 100644 --- a/stubs/vispy/util/fourier.pyi +++ b/stubs/vispy/util/fourier.pyi @@ -1,7 +1,6 @@ import numpy as np from numpy.typing import ArrayLike, NDArray -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/frozen.pyi b/stubs/vispy/util/frozen.pyi index 527f16c4..21d5c44c 100644 --- a/stubs/vispy/util/frozen.pyi +++ b/stubs/vispy/util/frozen.pyi @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Class adapted from: # http://stackoverflow.com/questions/3603502/ -class Frozen(object): +class Frozen: __isfrozen: bool = ... def __setattr__(self, key, value): ... diff --git a/stubs/vispy/util/keys.pyi b/stubs/vispy/util/keys.pyi index cc53c725..4e7e567f 100644 --- a/stubs/vispy/util/keys.pyi +++ b/stubs/vispy/util/keys.pyi @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -class Key(object): +class Key: def __init__(self, *names): ... @property def name(self): ... diff --git a/stubs/vispy/util/logs.pyi b/stubs/vispy/util/logs.pyi index b87c874a..4d981c6f 100644 --- a/stubs/vispy/util/logs.pyi +++ b/stubs/vispy/util/logs.pyi @@ -10,7 +10,6 @@ from functools import partial import numpy as np from numpy.typing import ArrayLike -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -46,7 +45,7 @@ logging_types = ... def set_log_level(verbose: bool | str | int | None, match: str | None = None, return_old: bool = False): ... -class use_log_level(object): +class use_log_level: # This method mostly wraps to set_log_level, but also takes # care of enabling/disabling message recording in the formatter. diff --git a/stubs/vispy/util/profiler.pyi b/stubs/vispy/util/profiler.pyi index 3f8c49bf..d805efa6 100644 --- a/stubs/vispy/util/profiler.pyi +++ b/stubs/vispy/util/profiler.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Adapted from PyQtGraph @@ -7,7 +6,7 @@ import sys from .. import config from . import ptime -class Profiler(object): +class Profiler: _profilers = ... _depth: int = ... diff --git a/stubs/vispy/util/ptime.pyi b/stubs/vispy/util/ptime.pyi index 996a81d9..7ab22748 100644 --- a/stubs/vispy/util/ptime.pyi +++ b/stubs/vispy/util/ptime.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/util/quaternion.pyi b/stubs/vispy/util/quaternion.pyi index afc45445..ec46231e 100644 --- a/stubs/vispy/util/quaternion.pyi +++ b/stubs/vispy/util/quaternion.pyi @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Based on the quaternion class in the visvis project. import numpy as np -class Quaternion(object): +class Quaternion: def __init__(self, w=1, x=0, y=0, z=0, normalize=True): ... def __repr__(self): ... def copy(self): ... diff --git a/stubs/vispy/util/svg/__init__.pyi b/stubs/vispy/util/svg/__init__.pyi index 0b27e13b..66310bde 100644 --- a/stubs/vispy/util/svg/__init__.pyi +++ b/stubs/vispy/util/svg/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. diff --git a/stubs/vispy/util/svg/base.pyi b/stubs/vispy/util/svg/base.pyi index c1565a55..cd0a99f0 100644 --- a/stubs/vispy/util/svg/base.pyi +++ b/stubs/vispy/util/svg/base.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. diff --git a/stubs/vispy/util/svg/color.pyi b/stubs/vispy/util/svg/color.pyi index 80314b54..48dde4b4 100644 --- a/stubs/vispy/util/svg/color.pyi +++ b/stubs/vispy/util/svg/color.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -14,7 +13,7 @@ _HEXDEC: dict = ... def _rgb(triplet): ... -class Color(object): +class Color: def __init__(self, content): ... @property def rgb(self): ... diff --git a/stubs/vispy/util/svg/element.pyi b/stubs/vispy/util/svg/element.pyi index 0437f374..9008ee18 100644 --- a/stubs/vispy/util/svg/element.pyi +++ b/stubs/vispy/util/svg/element.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. @@ -9,7 +8,7 @@ from .style import Style namespace: str = ... -class Element(object): +class Element: def __init__(self, content=None, parent=None): ... @property def root(self): ... diff --git a/stubs/vispy/util/svg/group.pyi b/stubs/vispy/util/svg/group.pyi index 5623487e..7d6a535f 100644 --- a/stubs/vispy/util/svg/group.pyi +++ b/stubs/vispy/util/svg/group.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. diff --git a/stubs/vispy/util/svg/length.pyi b/stubs/vispy/util/svg/length.pyi index 145d1332..81bc4ea4 100644 --- a/stubs/vispy/util/svg/length.pyi +++ b/stubs/vispy/util/svg/length.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -9,7 +8,7 @@ import re from .. import logger from .base import units -class Length(object): +class Length: def __init__(self, content, mode="x", parent=None): ... def __float__(self): ... @property diff --git a/stubs/vispy/util/svg/number.pyi b/stubs/vispy/util/svg/number.pyi index 17f65aa8..ac99701f 100644 --- a/stubs/vispy/util/svg/number.pyi +++ b/stubs/vispy/util/svg/number.pyi @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- -class Number(object): +class Number: def __init__(self, content): ... def __float__(self): ... @property diff --git a/stubs/vispy/util/svg/path.pyi b/stubs/vispy/util/svg/path.pyi index 93ee2809..8c54e81f 100644 --- a/stubs/vispy/util/svg/path.pyi +++ b/stubs/vispy/util/svg/path.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -13,7 +12,7 @@ from .geometry import epsilon from .transformable import Transformable # ----------------------------------------------------------------- Command --- -class Command(object): +class Command: def __repr__(self): ... def origin(self, current=None, previous=None): ... diff --git a/stubs/vispy/util/svg/shapes.pyi b/stubs/vispy/util/svg/shapes.pyi index ff69027e..0304ebc1 100644 --- a/stubs/vispy/util/svg/shapes.pyi +++ b/stubs/vispy/util/svg/shapes.pyi @@ -1,24 +1,23 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- -class Rect(object): +class Rect: def __init__(self, x=0, y=0, width=1, height=1, rx=0, ry=0): ... def parse(self, expression): ... -class Line(object): +class Line: def __init__(self, x1=0, y1=0, x2=0, y2=0): ... -class Circle(object): +class Circle: def __init__(self, cx=0, cy=0, r=1): ... -class Ellipse(object): +class Ellipse: def __init__(self, cx=0, cy=0, rx=1, ry=1): ... -class Polygon(object): +class Polygon: def __init__(self, points=[]): ... -class Polyline(object): +class Polyline: def __init__(self, points=[]): ... diff --git a/stubs/vispy/util/svg/style.pyi b/stubs/vispy/util/svg/style.pyi index b9c297a3..5c61089c 100644 --- a/stubs/vispy/util/svg/style.pyi +++ b/stubs/vispy/util/svg/style.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -10,7 +9,7 @@ from .number import Number _converters: dict = ... -class Style(object): +class Style: def __init__(self): ... def update(self, content): ... @property diff --git a/stubs/vispy/util/svg/svg.pyi b/stubs/vispy/util/svg/svg.pyi index e9566ce7..05f79ac0 100644 --- a/stubs/vispy/util/svg/svg.pyi +++ b/stubs/vispy/util/svg/svg.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. diff --git a/stubs/vispy/util/svg/transform.pyi b/stubs/vispy/util/svg/transform.pyi index 94783416..4df55877 100644 --- a/stubs/vispy/util/svg/transform.pyi +++ b/stubs/vispy/util/svg/transform.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. @@ -10,7 +9,7 @@ import numpy as np # ------------------------------------------------------------------ Matrix --- -class Matrix(object): +class Matrix: def __init__(self, a=1, b=0, c=0, d=1, e=0, f=0): ... @property def matrix(self): ... @@ -48,7 +47,7 @@ class SkewY(Matrix): def __repr__(self): ... # --------------------------------------------------------------- Transform --- -class Transform(object): +class Transform: def __init__(self, content=""): ... def __add__(self, other): ... def __radd__(self, other): ... diff --git a/stubs/vispy/util/svg/transformable.pyi b/stubs/vispy/util/svg/transformable.pyi index e1efd5c6..0e7fef73 100644 --- a/stubs/vispy/util/svg/transformable.pyi +++ b/stubs/vispy/util/svg/transformable.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. diff --git a/stubs/vispy/util/svg/viewport.pyi b/stubs/vispy/util/svg/viewport.pyi index c3e66124..9df069a8 100644 --- a/stubs/vispy/util/svg/viewport.pyi +++ b/stubs/vispy/util/svg/viewport.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. @@ -6,7 +5,7 @@ from .length import XLength, YLength -class Viewport(object): +class Viewport: def __init__(self, content=None, parent=None): ... @property def x(self): ... diff --git a/stubs/vispy/util/transforms.pyi b/stubs/vispy/util/transforms.pyi index 75eed8fd..0a9d5239 100644 --- a/stubs/vispy/util/transforms.pyi +++ b/stubs/vispy/util/transforms.pyi @@ -5,7 +5,6 @@ from numpy import dtype from numpy.typing import ArrayLike, NDArray #!/usr/bin/env python -# -*- coding: utf-8 -*- # Note: we use functions (e.g. sin) from math module because they're faster diff --git a/stubs/vispy/util/wrappers.pyi b/stubs/vispy/util/wrappers.pyi index f2c83bb5..41008ca0 100644 --- a/stubs/vispy/util/wrappers.pyi +++ b/stubs/vispy/util/wrappers.pyi @@ -2,7 +2,6 @@ import subprocess from numpy.typing import ArrayLike -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/__init__.pyi b/stubs/vispy/visuals/__init__.pyi index 47110737..f8fe2f34 100644 --- a/stubs/vispy/visuals/__init__.pyi +++ b/stubs/vispy/visuals/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/_scalable_textures.pyi b/stubs/vispy/visuals/_scalable_textures.pyi index 1c3776cd..8469556d 100644 --- a/stubs/vispy/visuals/_scalable_textures.pyi +++ b/stubs/vispy/visuals/_scalable_textures.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import warnings diff --git a/stubs/vispy/visuals/axis.pyi b/stubs/vispy/visuals/axis.pyi index cbe864a5..649e2f5e 100644 --- a/stubs/vispy/visuals/axis.pyi +++ b/stubs/vispy/visuals/axis.pyi @@ -9,7 +9,6 @@ from .line import LineVisual from .text import TextVisual from .visual import CompoundVisual, updating_property -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -97,7 +96,7 @@ class AxisVisual(CompoundVisual): def _rotation_angle(self): ... def _compute_bounds(self, axis, view): ... -class Ticker(object): +class Ticker: def __init__(self, axis: AxisVisual, anchors=None): ... def get_update(self): ... def _get_tick_positions(self, major_tick_fractions, minor_tick_fractions): ... @@ -107,7 +106,7 @@ class Ticker(object): # ############################################################################# # Translated from matplotlib -class MaxNLocator(object): +class MaxNLocator: def __init__( self, nbins=10, diff --git a/stubs/vispy/visuals/border.pyi b/stubs/vispy/visuals/border.pyi index e3ef0292..0596b260 100644 --- a/stubs/vispy/visuals/border.pyi +++ b/stubs/vispy/visuals/border.pyi @@ -3,7 +3,6 @@ import numpy as np from ..color import Color from . import Visual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/box.pyi b/stubs/vispy/visuals/box.pyi index 7944fa52..f7308bad 100644 --- a/stubs/vispy/visuals/box.pyi +++ b/stubs/vispy/visuals/box.pyi @@ -5,7 +5,6 @@ from ..util.svg.color import Color from .mesh import MeshVisual from .visual import CompoundVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/__init__.pyi b/stubs/vispy/visuals/collections/__init__.pyi index a39febe0..2d4e0ef5 100644 --- a/stubs/vispy/visuals/collections/__init__.pyi +++ b/stubs/vispy/visuals/collections/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/agg_fast_path_collection.pyi b/stubs/vispy/visuals/collections/agg_fast_path_collection.pyi index 591a19b7..ca5abd4e 100644 --- a/stubs/vispy/visuals/collections/agg_fast_path_collection.pyi +++ b/stubs/vispy/visuals/collections/agg_fast_path_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/agg_path_collection.pyi b/stubs/vispy/visuals/collections/agg_path_collection.pyi index 20c70519..3249b01e 100644 --- a/stubs/vispy/visuals/collections/agg_path_collection.pyi +++ b/stubs/vispy/visuals/collections/agg_path_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/agg_point_collection.pyi b/stubs/vispy/visuals/collections/agg_point_collection.pyi index 8dafd944..9d553de8 100644 --- a/stubs/vispy/visuals/collections/agg_point_collection.pyi +++ b/stubs/vispy/visuals/collections/agg_point_collection.pyi @@ -1,6 +1,5 @@ from numpy.typing import ArrayLike -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/agg_segment_collection.pyi b/stubs/vispy/visuals/collections/agg_segment_collection.pyi index 10f20a76..81d676af 100644 --- a/stubs/vispy/visuals/collections/agg_segment_collection.pyi +++ b/stubs/vispy/visuals/collections/agg_segment_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/array_list.pyi b/stubs/vispy/visuals/collections/array_list.pyi index 2091e64c..59bc55d6 100644 --- a/stubs/vispy/visuals/collections/array_list.pyi +++ b/stubs/vispy/visuals/collections/array_list.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. @@ -6,7 +5,7 @@ import numpy as np from numpy.typing import ArrayLike -class ArrayList(object): +class ArrayList: def __init__( self, data: ArrayLike | None = None, diff --git a/stubs/vispy/visuals/collections/base_collection.pyi b/stubs/vispy/visuals/collections/base_collection.pyi index 9ed817c6..4105f949 100644 --- a/stubs/vispy/visuals/collections/base_collection.pyi +++ b/stubs/vispy/visuals/collections/base_collection.pyi @@ -8,7 +8,6 @@ from .array_list import ArrayList from .collection import Collection from .util import dtype_reduce -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -16,7 +15,7 @@ from .util import dtype_reduce def next_power_of_2(n): ... -class Item(object): +class Item: def __init__( self, parent: Collection, @@ -41,7 +40,7 @@ class Item(object): def __setitem__(self, key, value): ... def __str__(self): ... -class BaseCollection(object): +class BaseCollection: def __init__(self, vtype, utype=None, itype=None): ... def __len__(self): ... @property diff --git a/stubs/vispy/visuals/collections/collection.pyi b/stubs/vispy/visuals/collections/collection.pyi index edfb447f..0fe28394 100644 --- a/stubs/vispy/visuals/collections/collection.pyi +++ b/stubs/vispy/visuals/collections/collection.pyi @@ -8,7 +8,6 @@ from ..shaders import ModularProgram from .base_collection import BaseCollection from .util import fetchcode -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -32,7 +31,7 @@ class Collection(BaseCollection): def __setitem__(self, key, value): ... def draw(self, mode=None): ... -class CollectionView(object): +class CollectionView: def __init__(self, collection, transform=None, viewport=None): ... def __getitem__(self, key): ... def __setitem__(self, key, value): ... diff --git a/stubs/vispy/visuals/collections/path_collection.pyi b/stubs/vispy/visuals/collections/path_collection.pyi index 9034efbf..7c6dcd1a 100644 --- a/stubs/vispy/visuals/collections/path_collection.pyi +++ b/stubs/vispy/visuals/collections/path_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/point_collection.pyi b/stubs/vispy/visuals/collections/point_collection.pyi index e83fda59..c6927ccd 100644 --- a/stubs/vispy/visuals/collections/point_collection.pyi +++ b/stubs/vispy/visuals/collections/point_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/polygon_collection.pyi b/stubs/vispy/visuals/collections/polygon_collection.pyi index 6d39df5c..625b3a30 100644 --- a/stubs/vispy/visuals/collections/polygon_collection.pyi +++ b/stubs/vispy/visuals/collections/polygon_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/raw_path_collection.pyi b/stubs/vispy/visuals/collections/raw_path_collection.pyi index 691b5721..4ed1ae94 100644 --- a/stubs/vispy/visuals/collections/raw_path_collection.pyi +++ b/stubs/vispy/visuals/collections/raw_path_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/raw_point_collection.pyi b/stubs/vispy/visuals/collections/raw_point_collection.pyi index 8a141dda..83a63e7d 100644 --- a/stubs/vispy/visuals/collections/raw_point_collection.pyi +++ b/stubs/vispy/visuals/collections/raw_point_collection.pyi @@ -6,7 +6,6 @@ from ...util.svg.transform import Transform from ..transforms import NullTransform from .collection import Collection -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/raw_polygon_collection.pyi b/stubs/vispy/visuals/collections/raw_polygon_collection.pyi index 8c0a696a..568b9d11 100644 --- a/stubs/vispy/visuals/collections/raw_polygon_collection.pyi +++ b/stubs/vispy/visuals/collections/raw_polygon_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/raw_segment_collection.pyi b/stubs/vispy/visuals/collections/raw_segment_collection.pyi index 4a627322..c524c183 100644 --- a/stubs/vispy/visuals/collections/raw_segment_collection.pyi +++ b/stubs/vispy/visuals/collections/raw_segment_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/raw_triangle_collection.pyi b/stubs/vispy/visuals/collections/raw_triangle_collection.pyi index af0a202d..172b43e6 100644 --- a/stubs/vispy/visuals/collections/raw_triangle_collection.pyi +++ b/stubs/vispy/visuals/collections/raw_triangle_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/segment_collection.pyi b/stubs/vispy/visuals/collections/segment_collection.pyi index d18ab3fd..186adb34 100644 --- a/stubs/vispy/visuals/collections/segment_collection.pyi +++ b/stubs/vispy/visuals/collections/segment_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/triangle_collection.pyi b/stubs/vispy/visuals/collections/triangle_collection.pyi index a8372dfa..9d4df807 100644 --- a/stubs/vispy/visuals/collections/triangle_collection.pyi +++ b/stubs/vispy/visuals/collections/triangle_collection.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/collections/util.pyi b/stubs/vispy/visuals/collections/util.pyi index 080cdace..4c0b46ab 100644 --- a/stubs/vispy/visuals/collections/util.pyi +++ b/stubs/vispy/visuals/collections/util.pyi @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2013, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. diff --git a/stubs/vispy/visuals/colorbar.pyi b/stubs/vispy/visuals/colorbar.pyi index 60ef8bb9..c03d85cd 100644 --- a/stubs/vispy/visuals/colorbar.pyi +++ b/stubs/vispy/visuals/colorbar.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/cube.pyi b/stubs/vispy/visuals/cube.pyi index 4db2cebe..da22bd70 100644 --- a/stubs/vispy/visuals/cube.pyi +++ b/stubs/vispy/visuals/cube.pyi @@ -5,7 +5,6 @@ from numpy.typing import NDArray from ..util.svg.color import Color from .box import BoxVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/ellipse.pyi b/stubs/vispy/visuals/ellipse.pyi index 824e7ee9..02098905 100644 --- a/stubs/vispy/visuals/ellipse.pyi +++ b/stubs/vispy/visuals/ellipse.pyi @@ -4,7 +4,6 @@ from numpy.typing import ArrayLike from ..util.svg.color import Color from .polygon import PolygonVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/filters/__init__.pyi b/stubs/vispy/visuals/filters/__init__.pyi index bc3ed56a..09640781 100644 --- a/stubs/vispy/visuals/filters/__init__.pyi +++ b/stubs/vispy/visuals/filters/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/filters/base_filter.pyi b/stubs/vispy/visuals/filters/base_filter.pyi index b851522c..693b921f 100644 --- a/stubs/vispy/visuals/filters/base_filter.pyi +++ b/stubs/vispy/visuals/filters/base_filter.pyi @@ -2,11 +2,10 @@ from typing import Callable, Literal from ..shaders import Function -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -class BaseFilter(object): +class BaseFilter: def _attach(self, visual): ... def _detach(self, visual): ... diff --git a/stubs/vispy/visuals/filters/clipper.pyi b/stubs/vispy/visuals/filters/clipper.pyi index 5c77cd1d..96fa1fd3 100644 --- a/stubs/vispy/visuals/filters/clipper.pyi +++ b/stubs/vispy/visuals/filters/clipper.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/filters/clipping_planes.pyi b/stubs/vispy/visuals/filters/clipping_planes.pyi index 910758dc..b2400327 100644 --- a/stubs/vispy/visuals/filters/clipping_planes.pyi +++ b/stubs/vispy/visuals/filters/clipping_planes.pyi @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from functools import lru_cache -from typing import Optional import numpy as np @@ -15,7 +13,7 @@ class PlanesClipper(Filter): FRAG_CODE: str = ... - def __init__(self, clipping_planes: Optional[np.ndarray] = None, coord_system: str = "scene"): ... + def __init__(self, clipping_planes: np.ndarray | None = None, coord_system: str = "scene"): ... @property def coord_system(self) -> str: ... def _attach(self, visual): ... @@ -25,4 +23,4 @@ class PlanesClipper(Filter): @property def clipping_planes(self) -> np.ndarray: ... @clipping_planes.setter - def clipping_planes(self, value: Optional[np.ndarray]): ... + def clipping_planes(self, value: np.ndarray | None): ... diff --git a/stubs/vispy/visuals/filters/color.pyi b/stubs/vispy/visuals/filters/color.pyi index b825d6b0..3892c4ee 100644 --- a/stubs/vispy/visuals/filters/color.pyi +++ b/stubs/vispy/visuals/filters/color.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/filters/mesh.pyi b/stubs/vispy/visuals/filters/mesh.pyi index 8069f88a..baf82770 100644 --- a/stubs/vispy/visuals/filters/mesh.pyi +++ b/stubs/vispy/visuals/filters/mesh.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numbers diff --git a/stubs/vispy/visuals/filters/picking.pyi b/stubs/vispy/visuals/filters/picking.pyi index 9b067cc5..ba6fe247 100644 --- a/stubs/vispy/visuals/filters/picking.pyi +++ b/stubs/vispy/visuals/filters/picking.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/graphs/graph.pyi b/stubs/vispy/visuals/graphs/graph.pyi index 89f53816..f3fe5d07 100644 --- a/stubs/vispy/visuals/graphs/graph.pyi +++ b/stubs/vispy/visuals/graphs/graph.pyi @@ -6,7 +6,6 @@ from ..markers import MarkersVisual from ..visual import CompoundVisual from . import layouts -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/graphs/layouts/__init__.pyi b/stubs/vispy/visuals/graphs/layouts/__init__.pyi index b1ecfc7e..93b08cf3 100644 --- a/stubs/vispy/visuals/graphs/layouts/__init__.pyi +++ b/stubs/vispy/visuals/graphs/layouts/__init__.pyi @@ -6,7 +6,6 @@ from .force_directed import fruchterman_reingold as fruchterman_reingold from .networkx_layout import NetworkxCoordinates as NetworkxCoordinates from .random import random as random -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/graphs/layouts/circular.pyi b/stubs/vispy/visuals/graphs/layouts/circular.pyi index 35fc693f..b070c55c 100644 --- a/stubs/vispy/visuals/graphs/layouts/circular.pyi +++ b/stubs/vispy/visuals/graphs/layouts/circular.pyi @@ -1,7 +1,6 @@ import numpy as np from numpy.typing import ArrayLike, NDArray -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/graphs/layouts/force_directed.pyi b/stubs/vispy/visuals/graphs/layouts/force_directed.pyi index 2e33cd2a..33a8defa 100644 --- a/stubs/vispy/visuals/graphs/layouts/force_directed.pyi +++ b/stubs/vispy/visuals/graphs/layouts/force_directed.pyi @@ -3,11 +3,10 @@ from numpy.typing import ArrayLike from ..util import _rescale_layout, _straight_line_vertices -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -class fruchterman_reingold(object): +class fruchterman_reingold: def __init__( self, optimal: float | None = None, diff --git a/stubs/vispy/visuals/graphs/layouts/networkx_layout.pyi b/stubs/vispy/visuals/graphs/layouts/networkx_layout.pyi index fe859db7..ada58ed0 100644 --- a/stubs/vispy/visuals/graphs/layouts/networkx_layout.pyi +++ b/stubs/vispy/visuals/graphs/layouts/networkx_layout.pyi @@ -1,8 +1,7 @@ -from typing import Iterable, Mapping +from collections.abc import Iterable, Mapping import numpy as np -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info.#!/usr/bin/env python3 from ..util import _straight_line_vertices diff --git a/stubs/vispy/visuals/graphs/layouts/random.pyi b/stubs/vispy/visuals/graphs/layouts/random.pyi index c3eb306f..18a23004 100644 --- a/stubs/vispy/visuals/graphs/layouts/random.pyi +++ b/stubs/vispy/visuals/graphs/layouts/random.pyi @@ -4,7 +4,6 @@ from numpy.typing import ArrayLike, NDArray from ..util import _straight_line_vertices -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/graphs/util.pyi b/stubs/vispy/visuals/graphs/util.pyi index 6df6b597..84d5c24f 100644 --- a/stubs/vispy/visuals/graphs/util.pyi +++ b/stubs/vispy/visuals/graphs/util.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/gridlines.pyi b/stubs/vispy/visuals/gridlines.pyi index 7798987d..898c8b9e 100644 --- a/stubs/vispy/visuals/gridlines.pyi +++ b/stubs/vispy/visuals/gridlines.pyi @@ -3,7 +3,6 @@ from ..util.svg.color import Color from .image import ImageVisual from .shaders import Function -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/histogram.pyi b/stubs/vispy/visuals/histogram.pyi index 2c56e8fc..1ddb09b6 100644 --- a/stubs/vispy/visuals/histogram.pyi +++ b/stubs/vispy/visuals/histogram.pyi @@ -6,7 +6,6 @@ from numpy.typing import ArrayLike from ..util.svg.color import Color from .mesh import MeshVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/image.pyi b/stubs/vispy/visuals/image.pyi index 9ac23430..7db42402 100644 --- a/stubs/vispy/visuals/image.pyi +++ b/stubs/vispy/visuals/image.pyi @@ -11,7 +11,6 @@ from .shaders import Function, FunctionChain from .transforms import NullTransform from .visual import Visual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/isocurve.pyi b/stubs/vispy/visuals/isocurve.pyi index a1c3b91b..0ad05a81 100644 --- a/stubs/vispy/visuals/isocurve.pyi +++ b/stubs/vispy/visuals/isocurve.pyi @@ -7,7 +7,6 @@ from ..color.colormap import _normalize, get_colormap from ..geometry.isocurve import isocurve from .line import LineVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/isoline.pyi b/stubs/vispy/visuals/isoline.pyi index 85ec6609..7dfbc8ae 100644 --- a/stubs/vispy/visuals/isoline.pyi +++ b/stubs/vispy/visuals/isoline.pyi @@ -8,7 +8,6 @@ from ..color.colormap import _normalize, get_colormap from ..util.svg.color import Color from .line import LineVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/isosurface.pyi b/stubs/vispy/visuals/isosurface.pyi index 395ccb93..f022169f 100644 --- a/stubs/vispy/visuals/isosurface.pyi +++ b/stubs/vispy/visuals/isosurface.pyi @@ -1,5 +1,3 @@ -from __future__ import division - from numpy.typing import ArrayLike, NDArray from ..color import Color @@ -7,7 +5,6 @@ from ..geometry.isosurface import isosurface from ..util.svg.color import Color from .mesh import MeshVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/line/__init__.pyi b/stubs/vispy/visuals/line/__init__.pyi index 2cbd7c3a..c1b70f31 100644 --- a/stubs/vispy/visuals/line/__init__.pyi +++ b/stubs/vispy/visuals/line/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/line/arrow.pyi b/stubs/vispy/visuals/line/arrow.pyi index adc4e073..5724db51 100644 --- a/stubs/vispy/visuals/line/arrow.pyi +++ b/stubs/vispy/visuals/line/arrow.pyi @@ -7,7 +7,6 @@ from ..transforms._util import as_vec4 from ..visual import Visual from .line import LineVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/line/dash_atlas.pyi b/stubs/vispy/visuals/line/dash_atlas.pyi index a61e56ae..40e7ae15 100644 --- a/stubs/vispy/visuals/line/dash_atlas.pyi +++ b/stubs/vispy/visuals/line/dash_atlas.pyi @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np -class DashAtlas(object): +class DashAtlas: def __init__(self, shape=...): ... def __getitem__(self, key): ... def __setitem__(self, key, value): ... diff --git a/stubs/vispy/visuals/line/line.pyi b/stubs/vispy/visuals/line/line.pyi index a6a7d223..d8d91bb2 100644 --- a/stubs/vispy/visuals/line/line.pyi +++ b/stubs/vispy/visuals/line/line.pyi @@ -10,7 +10,6 @@ from ..shaders import Function from ..visual import CompoundVisual, Visual from .dash_atlas import DashAtlas -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/line_plot.pyi b/stubs/vispy/visuals/line_plot.pyi index 46520359..dea43f92 100644 --- a/stubs/vispy/visuals/line_plot.pyi +++ b/stubs/vispy/visuals/line_plot.pyi @@ -6,7 +6,6 @@ from .line import LineVisual from .markers import MarkersVisual from .visual import CompoundVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/markers.pyi b/stubs/vispy/visuals/markers.pyi index 04248973..6fd3bb00 100644 --- a/stubs/vispy/visuals/markers.pyi +++ b/stubs/vispy/visuals/markers.pyi @@ -9,7 +9,6 @@ from ..util.svg.color import Color from .shaders import Function, Variable from .visual import Visual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/mesh.pyi b/stubs/vispy/visuals/mesh.pyi index 89e3ab38..e39dde71 100644 --- a/stubs/vispy/visuals/mesh.pyi +++ b/stubs/vispy/visuals/mesh.pyi @@ -1,5 +1,3 @@ -from __future__ import division - from functools import lru_cache import numpy as np @@ -15,7 +13,6 @@ from ..util.svg.color import Color from .shaders import Function, FunctionChain from .visual import Visual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/mesh_normals.pyi b/stubs/vispy/visuals/mesh_normals.pyi index 42201b58..bf7da2fd 100644 --- a/stubs/vispy/visuals/mesh_normals.pyi +++ b/stubs/vispy/visuals/mesh_normals.pyi @@ -5,7 +5,6 @@ from numpy.typing import ArrayLike from . import LineVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/plane.pyi b/stubs/vispy/visuals/plane.pyi index 085cb710..8b238ab8 100644 --- a/stubs/vispy/visuals/plane.pyi +++ b/stubs/vispy/visuals/plane.pyi @@ -5,7 +5,6 @@ from ..util.svg.color import Color from .mesh import MeshVisual from .visual import CompoundVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/polygon.pyi b/stubs/vispy/visuals/polygon.pyi index bb3979ba..f45d70cd 100644 --- a/stubs/vispy/visuals/polygon.pyi +++ b/stubs/vispy/visuals/polygon.pyi @@ -1,4 +1,4 @@ -from typing import Sequence +from collections.abc import Sequence import numpy as np from numpy.typing import ArrayLike @@ -9,7 +9,6 @@ from .line import LineVisual from .mesh import MeshVisual from .visual import CompoundVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/rectangle.pyi b/stubs/vispy/visuals/rectangle.pyi index 5673eb09..2b8aec3a 100644 --- a/stubs/vispy/visuals/rectangle.pyi +++ b/stubs/vispy/visuals/rectangle.pyi @@ -5,7 +5,6 @@ from ..color import Color from ..util.svg.color import Color from .polygon import PolygonVisual -# -*- coding: utf-8 -*- # Copradiusight (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/regular_polygon.pyi b/stubs/vispy/visuals/regular_polygon.pyi index 3334fffe..d8c25907 100644 --- a/stubs/vispy/visuals/regular_polygon.pyi +++ b/stubs/vispy/visuals/regular_polygon.pyi @@ -1,10 +1,9 @@ -from typing import Sequence +from collections.abc import Sequence from numpy.typing import ArrayLike from .ellipse import EllipseVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/scrolling_lines.pyi b/stubs/vispy/visuals/scrolling_lines.pyi index 4d0ebe92..29b70bce 100644 --- a/stubs/vispy/visuals/scrolling_lines.pyi +++ b/stubs/vispy/visuals/scrolling_lines.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/shaders/__init__.pyi b/stubs/vispy/visuals/shaders/__init__.pyi index 34695e07..26609656 100644 --- a/stubs/vispy/visuals/shaders/__init__.pyi +++ b/stubs/vispy/visuals/shaders/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/shaders/compiler.pyi b/stubs/vispy/visuals/shaders/compiler.pyi index d4a26089..5f1f0cee 100644 --- a/stubs/vispy/visuals/shaders/compiler.pyi +++ b/stubs/vispy/visuals/shaders/compiler.pyi @@ -1,12 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - from ... import gloo -class Compiler(object): +class Compiler: def __init__(self, namespace=None, **shaders): ... def __getitem__(self, item): ... def compile(self, pretty: bool = True): ... diff --git a/stubs/vispy/visuals/shaders/expression.pyi b/stubs/vispy/visuals/shaders/expression.pyi index e130cb77..1f3e3dc6 100644 --- a/stubs/vispy/visuals/shaders/expression.pyi +++ b/stubs/vispy/visuals/shaders/expression.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from .shader_object import ShaderObject diff --git a/stubs/vispy/visuals/shaders/function.pyi b/stubs/vispy/visuals/shaders/function.pyi index 0e7729b8..c0cca7ec 100644 --- a/stubs/vispy/visuals/shaders/function.pyi +++ b/stubs/vispy/visuals/shaders/function.pyi @@ -12,7 +12,6 @@ from .expression import FunctionCall, TextExpression from .shader_object import ShaderObject from .variable import Variable, Varying -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/shaders/multiprogram.pyi b/stubs/vispy/visuals/shaders/multiprogram.pyi index e83bbedf..8252b511 100644 --- a/stubs/vispy/visuals/shaders/multiprogram.pyi +++ b/stubs/vispy/visuals/shaders/multiprogram.pyi @@ -2,7 +2,7 @@ import weakref from .program import ModularProgram -class MultiProgram(object): +class MultiProgram: def __init__(self, vcode="", fcode="", gcode=None): ... def add_program(self, name=None): ... @property @@ -23,7 +23,7 @@ class MultiProgram(object): def __iter__(self): ... def bind(self, data): ... -class MultiShader(object): +class MultiShader: def __init__(self, program, shader): ... def __getitem__(self, key): ... def __setitem__(self, key, value): ... diff --git a/stubs/vispy/visuals/shaders/parsing.pyi b/stubs/vispy/visuals/shaders/parsing.pyi index 6f0a2316..6c00fc1c 100644 --- a/stubs/vispy/visuals/shaders/parsing.pyi +++ b/stubs/vispy/visuals/shaders/parsing.pyi @@ -1,9 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - import re # regular expressions for parsing GLSL diff --git a/stubs/vispy/visuals/shaders/program.pyi b/stubs/vispy/visuals/shaders/program.pyi index fbc47800..db50f3f3 100644 --- a/stubs/vispy/visuals/shaders/program.pyi +++ b/stubs/vispy/visuals/shaders/program.pyi @@ -1,9 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - import logging from weakref import WeakKeyDictionary diff --git a/stubs/vispy/visuals/shaders/shader_object.pyi b/stubs/vispy/visuals/shaders/shader_object.pyi index 85171ee8..99aa5e20 100644 --- a/stubs/vispy/visuals/shaders/shader_object.pyi +++ b/stubs/vispy/visuals/shaders/shader_object.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from collections import OrderedDict @@ -6,7 +5,7 @@ from weakref import WeakKeyDictionary from .compiler import Compiler -class ShaderObject(object): +class ShaderObject: @classmethod def create(self, obj, ref=None): ... def __init__(self): ... diff --git a/stubs/vispy/visuals/shaders/variable.pyi b/stubs/vispy/visuals/shaders/variable.pyi index 34ba8247..68785153 100644 --- a/stubs/vispy/visuals/shaders/variable.pyi +++ b/stubs/vispy/visuals/shaders/variable.pyi @@ -1,6 +1,5 @@ from typing import Literal -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np diff --git a/stubs/vispy/visuals/spectrogram.pyi b/stubs/vispy/visuals/spectrogram.pyi index 6b9cbe53..e3c36eaf 100644 --- a/stubs/vispy/visuals/spectrogram.pyi +++ b/stubs/vispy/visuals/spectrogram.pyi @@ -6,7 +6,6 @@ from numpy.typing import ArrayLike from ..util.fourier import fft_freqs, stft from .image import ImageVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/sphere.pyi b/stubs/vispy/visuals/sphere.pyi index 44275fe4..4b5334ce 100644 --- a/stubs/vispy/visuals/sphere.pyi +++ b/stubs/vispy/visuals/sphere.pyi @@ -5,7 +5,6 @@ from ..util.svg.color import Color from .mesh import MeshVisual from .visual import CompoundVisual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/surface_plot.pyi b/stubs/vispy/visuals/surface_plot.pyi index bc9e540b..07a67850 100644 --- a/stubs/vispy/visuals/surface_plot.pyi +++ b/stubs/vispy/visuals/surface_plot.pyi @@ -1,12 +1,9 @@ -from __future__ import division - import numpy as np from numpy.typing import NDArray from ..geometry import MeshData from .mesh import MeshVisual -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/text/__init__.pyi b/stubs/vispy/visuals/text/__init__.pyi index e7da1dd8..314437df 100644 --- a/stubs/vispy/visuals/text/__init__.pyi +++ b/stubs/vispy/visuals/text/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/text/_sdf_gpu.pyi b/stubs/vispy/visuals/text/_sdf_gpu.pyi index ff77cc24..8cc041cc 100644 --- a/stubs/vispy/visuals/text/_sdf_gpu.pyi +++ b/stubs/vispy/visuals/text/_sdf_gpu.pyi @@ -3,8 +3,6 @@ from numpy.typing import ArrayLike from ...gloo import Texture2D -# -*- coding: utf-8 -*- - vert_seed: str = ... vert: str = ... @@ -15,7 +13,7 @@ frag_flood: str = ... frag_insert: str = ... -class SDFRendererGPU(object): +class SDFRendererGPU: def __init__(self): ... def render_to_texture( self, diff --git a/stubs/vispy/visuals/text/text.pyi b/stubs/vispy/visuals/text/text.pyi index cd92f783..e66cfb7c 100644 --- a/stubs/vispy/visuals/text/text.pyi +++ b/stubs/vispy/visuals/text/text.pyi @@ -1,6 +1,7 @@ import sys +from collections.abc import Mapping from copy import deepcopy -from typing import Any, Mapping +from typing import Any import numpy as np from numpy.typing import ArrayLike @@ -14,7 +15,6 @@ from ..transforms import STTransform from ..visual import Visual from ._sdf_gpu import SDFRendererGPU -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -23,7 +23,7 @@ from ._sdf_gpu import SDFRendererGPU ############################################################################## # Load font into texture -class TextureFont(object): +class TextureFont: def __init__(self, font: Mapping, renderer: SDFRendererGPU): ... @property def ratio(self): ... @@ -32,7 +32,7 @@ class TextureFont(object): def __getitem__(self, char): ... def _load_char(self, char): ... -class FontManager(object): +class FontManager: # XXX: should store a font-manager on each context, # or let TextureFont use a TextureAtlas for each context def __init__(self, method="cpu"): ... @@ -107,7 +107,7 @@ class TextVisual(Visual): def italic(self, value): ... def _update_font(self): ... -class SDFRendererCPU(object): +class SDFRendererCPU: # This should probably live in _sdf_cpu.pyx, but doing so makes # debugging substantially more annoying def render_to_texture(self, data, texture, offset, size): ... diff --git a/stubs/vispy/visuals/transforms/__init__.pyi b/stubs/vispy/visuals/transforms/__init__.pyi index 8acc3eb0..67d7693e 100644 --- a/stubs/vispy/visuals/transforms/__init__.pyi +++ b/stubs/vispy/visuals/transforms/__init__.pyi @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/transforms/_util.pyi b/stubs/vispy/visuals/transforms/_util.pyi index b4446b4f..97feb7df 100644 --- a/stubs/vispy/visuals/transforms/_util.pyi +++ b/stubs/vispy/visuals/transforms/_util.pyi @@ -7,7 +7,6 @@ from numpy.typing import ArrayLike from ...util import logger -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. @@ -15,7 +14,7 @@ def arg_to_array(func: Callable) -> Callable: ... def as_vec4(obj: ArrayLike, default: ArrayLike = ...) -> ArrayLike: ... def arg_to_vec4(func): ... -class TransformCache(object): +class TransformCache: def __init__(self, max_age=1): ... def get(self, path): ... def _create(self, path): ... diff --git a/stubs/vispy/visuals/transforms/base_transform.pyi b/stubs/vispy/visuals/transforms/base_transform.pyi index 78559d4b..4e573f95 100644 --- a/stubs/vispy/visuals/transforms/base_transform.pyi +++ b/stubs/vispy/visuals/transforms/base_transform.pyi @@ -1,13 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - from ...util.event import EventEmitter from ..shaders import Function -class BaseTransform(object): +class BaseTransform: glsl_map: None = ... # Must be GLSL code glsl_imap: None = ... diff --git a/stubs/vispy/visuals/transforms/chain.pyi b/stubs/vispy/visuals/transforms/chain.pyi index feb93fd0..40570adc 100644 --- a/stubs/vispy/visuals/transforms/chain.pyi +++ b/stubs/vispy/visuals/transforms/chain.pyi @@ -1,4 +1,4 @@ -from typing import Sequence +from collections.abc import Sequence from numpy.typing import ArrayLike, NDArray @@ -7,7 +7,6 @@ from ..shaders import FunctionChain from .base_transform import BaseTransform from .linear import NullTransform -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/transforms/interactive.pyi b/stubs/vispy/visuals/transforms/interactive.pyi index 4c4ce8a6..fdb22844 100644 --- a/stubs/vispy/visuals/transforms/interactive.pyi +++ b/stubs/vispy/visuals/transforms/interactive.pyi @@ -4,7 +4,6 @@ from ...app.canvas import Canvas from ...util.event import Event from .linear import STTransform -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/transforms/linear.pyi b/stubs/vispy/visuals/transforms/linear.pyi index 04c5a5c2..a563b8d4 100644 --- a/stubs/vispy/visuals/transforms/linear.pyi +++ b/stubs/vispy/visuals/transforms/linear.pyi @@ -7,7 +7,6 @@ from ...util import transforms from ._util import arg_to_vec4, as_vec4 from .base_transform import BaseTransform -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/transforms/nonlinear.pyi b/stubs/vispy/visuals/transforms/nonlinear.pyi index ee9e4b8f..89a2435f 100644 --- a/stubs/vispy/visuals/transforms/nonlinear.pyi +++ b/stubs/vispy/visuals/transforms/nonlinear.pyi @@ -5,7 +5,6 @@ from ... import gloo from ._util import arg_to_array, arg_to_vec4, as_vec4 from .base_transform import BaseTransform -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/stubs/vispy/visuals/transforms/transform_system.pyi b/stubs/vispy/visuals/transforms/transform_system.pyi index 98155b57..72c9d7d8 100644 --- a/stubs/vispy/visuals/transforms/transform_system.pyi +++ b/stubs/vispy/visuals/transforms/transform_system.pyi @@ -1,5 +1,3 @@ -from __future__ import division - import numpy as np from ...app.canvas import Canvas @@ -8,11 +6,10 @@ from ._util import TransformCache from .chain import ChainTransform from .linear import NullTransform, STTransform -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -class TransformSystem(object): +class TransformSystem: def __init__(self, canvas: Canvas | None = None, dpi: float | None = None): ... def _update_if_maps_changed(self, transform, map_key, new_maps): ... def configure( diff --git a/stubs/vispy/visuals/visual.pyi b/stubs/vispy/visuals/visual.pyi index 9a79ff4d..610dd0ca 100644 --- a/stubs/vispy/visuals/visual.pyi +++ b/stubs/vispy/visuals/visual.pyi @@ -1,11 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. -from __future__ import division - import weakref -from typing import Any, Sequence +from collections.abc import Sequence +from typing import Any import numpy as np @@ -16,7 +14,7 @@ from ..util.event import EmitterGroup, Event from .shaders import MultiProgram, StatementList from .transforms import TransformSystem -class VisualShare(object): +class VisualShare: def __init__(self): ... class BaseVisual(Frozen): @@ -44,7 +42,7 @@ class BaseVisual(Frozen): def update(self): ... def _transform_changed(self, event=None): ... -class BaseVisualView(object): +class BaseVisualView: def __init__(self, visual): ... @property def visual(self): ... diff --git a/stubs/vispy/visuals/volume.pyi b/stubs/vispy/visuals/volume.pyi index f57e0017..831dfd66 100644 --- a/stubs/vispy/visuals/volume.pyi +++ b/stubs/vispy/visuals/volume.pyi @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from functools import lru_cache -from typing import Literal, Optional +from typing import Literal import numpy as np from numpy.typing import ArrayLike, NDArray @@ -111,7 +110,7 @@ class VolumeVisual(Visual): @property def clipping_planes(self) -> np.ndarray: ... @clipping_planes.setter - def clipping_planes(self, value: Optional[np.ndarray]): ... + def clipping_planes(self, value: np.ndarray | None): ... @property def clipping_planes_coord_system(self) -> str: ... @property diff --git a/stubs/vispy/visuals/windbarb.pyi b/stubs/vispy/visuals/windbarb.pyi index db2e65ea..ed2bad06 100644 --- a/stubs/vispy/visuals/windbarb.pyi +++ b/stubs/vispy/visuals/windbarb.pyi @@ -5,7 +5,6 @@ from ..color import ColorArray from ..util.svg.color import Color from .visual import Visual -# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. diff --git a/utils/validate_stubs.py b/utils/validate_stubs.py index a01b225e..68427914 100644 --- a/utils/validate_stubs.py +++ b/utils/validate_stubs.py @@ -25,10 +25,7 @@ from operator import attrgetter from typing import ( Callable, - List, Literal, - Optional, - Tuple, _overload_dummy, # type: ignore[attr-defined] # _overload_dummy not exposed ) @@ -54,7 +51,7 @@ def fn(*args, **kwds): _typing.overload = my_overload -def import_dual(m: str, stub_path: str) -> Tuple: +def import_dual(m: str, stub_path: str) -> tuple: """ Import both a stub package and a real package with the same name. @@ -230,23 +227,23 @@ def walk(tree: dict, fn: Callable, *args, postproc: Callable | None = None, path postproc(tree, to_postproc) -def collect_items(root: Item) -> Tuple[List[Item], List[Item]]: - def _collect(path, name, node: Item, functions: List[Item], classes: List[Item]): +def collect_items(root: Item) -> tuple[list[Item], list[Item]]: + def _collect(path, name, node: Item, functions: list[Item], classes: list[Item]): if node.isclass(): classes.append(node) return True # Don't recurse elif node.isfunction(): functions.append(node) - functions: List[Item] = [] - classes: List[Item] = [] + functions: list[Item] = [] + classes: list[Item] = [] walk(root.children, _collect, functions, classes) functions = sorted(functions, key=attrgetter("name")) classes = sorted(classes, key=attrgetter("name")) return functions, classes -def match_pairs(real: List[Item], stub: List[Item], label: str, owner: str = ""): +def match_pairs(real: list[Item], stub: list[Item], label: str, owner: str = ""): i_r = 0 i_s = 0 while i_r < len(real) or i_s < len(stub): @@ -266,7 +263,7 @@ def match_pairs(real: List[Item], stub: List[Item], label: str, owner: str = "") i_r += 1 -def compare_args(real: Item, stub: Item, owner: Optional[str] = None): +def compare_args(real: Item, stub: Item, owner: str | None = None): """ owner - name of owner class, if a member; else None if a top-level function """ @@ -326,7 +323,7 @@ def compare_args(real: Item, stub: Item, owner: Optional[str] = None): print(f"Failed to validate {module}.{owner}{name}: {e}") -def compare_functions(real: List[Item], stub: List[Item], owner: Optional[str] = None): +def compare_functions(real: list[Item], stub: list[Item], owner: str | None = None): if owner is None: owner = "" elif owner and owner[-1] != ".": @@ -344,7 +341,7 @@ def compare_functions(real: List[Item], stub: List[Item], owner: Optional[str] = i_s += 1 -def compare_classes(real: List[Item], stub: List[Item]): +def compare_classes(real: list[Item], stub: list[Item]): match_pairs(real, stub, "class") # For the classes that do have analogs, compare the # methods. @@ -359,9 +356,7 @@ def compare_classes(real: List[Item], stub: List[Item]): i_s += 1 -def find_item( - items: List[Item], name: str, which: Literal["stub", "real"], type_: Literal["class", "function"] -) -> Optional[Item]: +def find_item(items: list[Item], name: str, which: Literal["stub", "real"], type_: Literal["class", "function"]) -> Item | None: """ which - whether this is 'stub' or 'real' """ @@ -375,7 +370,7 @@ def find_item( return None -def compare_class(real: List[Item], stub: List[Item], class_: str): +def compare_class(real: list[Item], stub: list[Item], class_: str): a = find_item(real, class_, "real", "class") s = find_item(stub, class_, "stub", "class") if a is None or s is None: @@ -418,10 +413,10 @@ def find_module(package: Item, module: str): def compare( name: str, - stubpath: Optional[str] = None, - submodule: Optional[str] = None, - class_: Optional[str] = None, - function_: Optional[str] = None, + stubpath: str | None = None, + submodule: str | None = None, + class_: str | None = None, + function_: str | None = None, ): split = name.find(".") if split > 0: