Skip to content

Commit

Permalink
Fix all reportMissingImports
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Nov 7, 2024
1 parent 53334cc commit 7bb3d5b
Show file tree
Hide file tree
Showing 74 changed files with 161 additions and 137 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ reportFunctionMemberAccess = "none" # TODO
reportGeneralTypeIssues = "none" # TODO
reportInvalidTypeArguments = "none" # TODO
reportInvalidTypeForm = "none" # TODO
reportMissingImports = "none" # TODO
reportUndefinedVariable = "none" # TODO
reportUnusedVariable = "none" # TODO

Expand Down
5 changes: 2 additions & 3 deletions stubs/matplotlib/axis.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ from datetime import timezone
from typing import Any, Callable, Literal, Type

import numpy as np
from units.basic_units import BasicUnit

from .artist import Artist, allow_rasterization
from .axes import Axes
Expand Down Expand Up @@ -185,8 +184,8 @@ class Axis(Artist):
def update_units(self, data: Any) -> bool: ...
def have_units(self) -> bool: ...
def convert_units(self, x): ...
def set_units(self, u: None | timezone | float | BasicUnit) -> None: ...
def get_units(self) -> None | timezone | float | BasicUnit: ...
def set_units(self, u) -> None: ...
def get_units(self): ...
def set_label_text(self, label: str, fontdict: dict = ..., **kwargs): ...
def set_major_formatter(self, formatter: Formatter | str | Callable) -> None: ...
def set_minor_formatter(self, formatter: Formatter | str | Callable) -> None: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/matplotlib/backends/backend_gtk3.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Callable, Type

from gi.repository import Gtk
# PyGObject is not easily installable on Windows, let tests pass as-is
from gi.repository import Gtk # pyright: ignore[reportMissingImports]
from matplotlib import backend_tools
from matplotlib._api import classproperty
from matplotlib.backend_bases import FigureCanvasBase, ToolContainerBase
Expand Down
3 changes: 1 addition & 2 deletions stubs/skimage/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __version__: str = ...
submodules: list = ...

from ._shared import lazy as lazy
from ._shared.tester import PytestTester as PytestTester # noqa
from ._shared.version_requirements import ensure_python_version as ensure_python_version

__getattr__, __lazy_dir__, _ = ...
Expand All @@ -18,6 +19,4 @@ _STANDARD_MSG: str = ...

def _raise_build_error(e): ...

from skimage._shared.tester import PytestTester as PytestTester # noqa

test = ...
6 changes: 3 additions & 3 deletions stubs/skimage/_shared/filters.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ from typing import Literal
import numpy as np
from numpy.typing import ArrayLike, NDArray
from scipy import ndimage as ndi
from skimage._typing import Scalar

from .._shared import utils
from .._shared.utils import _supported_float_type, convert_to_float, warn
from .._typing import Scalar
from . import utils
from .utils import _supported_float_type, convert_to_float, warn

@utils.deprecate_multichannel_kwarg(multichannel_position=5)
def gaussian(
Expand Down
3 changes: 2 additions & 1 deletion stubs/skimage/feature/_basic_features.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ from itertools import combinations_with_replacement

import numpy as np
from numpy.typing import NDArray
from skimage._shared import utils

from .._shared import utils

def _texture_filter(gaussian_filtered): ...
def _singlescale_basic_features_singlechannel(img, sigma, intensity=True, edges=True, texture=True): ...
Expand Down
17 changes: 17 additions & 0 deletions stubs/skimage/feature/_cascade.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import Any, ClassVar

__reduce_cython__: Any
__setstate_cython__: Any
__test__: dict

class Cascade:
__pyx_vtable__: ClassVar[Any] = ...
eps: Any
features_number: Any
stages_number: Any
stumps_number: Any
window_height: Any
window_width: Any
def __init__(self, *args, **kwargs) -> None: ...
def detect_multi_scale(self, *args, **kwargs): ...
def __reduce__(self): ...
3 changes: 2 additions & 1 deletion stubs/skimage/future/graph/_ncut.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import networkx as nx
import numpy as np
from numpy.typing import NDArray
from scipy import sparse
from skimage.future.graph.rag import RAG

from .rag import RAG

def DW_matrices(graph: RAG): ...
def ncut_cost(cut: NDArray, D, W) -> float: ...
2 changes: 1 addition & 1 deletion stubs/skimage/future/graph/graph_cut.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import networkx as nx
import numpy as np
from numpy.typing import ArrayLike, NDArray
from scipy.sparse import linalg
from skimage.future.graph.rag import RAG

from . import _ncut
from .rag import RAG

def cut_threshold(labels: NDArray, rag: RAG, thresh: float, in_place: bool = True) -> NDArray: ...
def cut_normalized(
Expand Down
3 changes: 2 additions & 1 deletion stubs/skimage/future/graph/graph_merge.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ from typing import Callable

import numpy as np
from numpy.typing import NDArray
from skimage.future.graph.rag import RAG

from .rag import RAG

def _revalidate_node_edges(rag, node, heap_list): ...
def _rename_node(graph, node_id, copy_id): ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/skimage/future/graph/rag.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import networkx as nx
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy import ndimage as ndi, sparse
from skimage.future.graph.rag import RAG

from ..._shared.version_requirements import require
from .rag import RAG

def _edge_generator_from_csr(csr_matrix): ...
def min_weight(graph: RAG, src: int, dst: int, n: int) -> Mapping: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/skimage/future/trainable_segmentation.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from numpy.typing import NDArray
from skimage.feature import multiscale_basic_features

from ..feature import multiscale_basic_features

class TrainableSegmenter(object):
def __init__(self, clf=None, features_func=None): ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/skimage/measure/_find_contours.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from collections import deque

import numpy as np
from skimage._shared.utils import deprecate_kwarg

from .._shared.utils import deprecate_kwarg

_param_options = ...

Expand Down
1 change: 1 addition & 0 deletions stubs/skimage/measure/_regionprops.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ from scipy.spatial.distance import pdist
from . import _moments
from ._find_contours import find_contours
from ._marching_cubes_lewiner import marching_cubes
from ._regionprops import RegionProperties
from ._regionprops_utils import euler_number, perimeter, perimeter_crofton

__all__ = ["regionprops", "euler_number", "perimeter", "perimeter_crofton"]
Expand Down
3 changes: 2 additions & 1 deletion stubs/skimage/transform/integral.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import numpy as np
from numpy import ndarray
from numpy.typing import NDArray
from skimage._typing import Scalar

from .._typing import Scalar

def integral_image(image: NDArray, *, dtype=None) -> NDArray: ...
def integrate(ii: NDArray, start, end) -> Scalar | np.ndarray: ...
2 changes: 0 additions & 2 deletions stubs/sklearn/_build_utils/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import contextlib as contextlib
import os as os

import sklearn as sklearn
from Cython import Tempita as Tempita
from Cython.Build import cythonize as cythonize

from .._min_dependencies import CYTHON_MIN_VERSION as CYTHON_MIN_VERSION
from ..externals._packaging.version import parse as parse
Expand Down
5 changes: 2 additions & 3 deletions stubs/sklearn/utils/estimator_checks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ from typing import Sequence

import joblib
import numpy as np
from _pytest.mark.structures import MarkDecorator
from pytest.mark import parameterize
from _pytest.mark.structures import _ParametrizeMarkDecorator
from scipy import sparse as sparse
from scipy.stats import rankdata as rankdata

Expand Down Expand Up @@ -82,7 +81,7 @@ CROSS_DECOMPOSITION: list = ...
def check_supervised_y_no_nan(name, estimator_orig): ...
def parametrize_with_checks(
estimators: Sequence[BaseEstimator],
) -> MarkDecorator | parameterize: ...
) -> _ParametrizeMarkDecorator: ...
def check_estimator(
estimator: None | BaseEstimator = None,
generate_only: bool = False,
Expand Down
44 changes: 22 additions & 22 deletions stubs/sympy-stubs/core/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from sympy.core.add import Add
from sympy.core.assumptions import assumptions, check_assumptions, common_assumptions, failing_assumptions
from sympy.core.basic import Atom, Basic
from sympy.core.cache import cacheit
from sympy.core.containers import Dict, Tuple
from sympy.core.evalf import N, PrecisionExhausted, evalf
from sympy.core.expr import AtomicExpr, Expr, UnevaluatedExpr
from sympy.core.exprtools import factor_nc, factor_terms, gcd_terms
from sympy.core.function import (
from .add import Add
from .assumptions import assumptions, check_assumptions, common_assumptions, failing_assumptions
from .basic import Atom, Basic
from .cache import cacheit
from .containers import Dict, Tuple
from .evalf import N, PrecisionExhausted, evalf
from .expr import AtomicExpr, Expr, UnevaluatedExpr
from .exprtools import factor_nc, factor_terms, gcd_terms
from .function import (
Derivative,
Function,
FunctionClass,
Expand All @@ -28,11 +28,11 @@ from sympy.core.function import (
expand_trig,
nfloat,
)
from sympy.core.kind import BooleanKind, NumberKind, UndefinedKind
from sympy.core.mod import Mod
from sympy.core.mul import Mul, prod
from sympy.core.multidimensional import vectorize
from sympy.core.numbers import (
from .kind import BooleanKind, NumberKind, UndefinedKind
from .mod import Mod
from .mul import Mul, prod
from .multidimensional import vectorize
from .numbers import (
AlgebraicNumber,
E,
Float,
Expand All @@ -52,9 +52,9 @@ from sympy.core.numbers import (
seterr,
zoo,
)
from sympy.core.parameters import evaluate
from sympy.core.power import Pow, integer_log, integer_nthroot
from sympy.core.relational import (
from .parameters import evaluate
from .power import Pow, integer_log, integer_nthroot
from .relational import (
Eq,
Equality,
Ge,
Expand All @@ -69,11 +69,11 @@ from sympy.core.relational import (
StrictLessThan,
Unequality,
)
from sympy.core.singleton import S
from sympy.core.sorting import default_sort_key, ordered
from sympy.core.symbol import Dummy, Symbol, Wild, symbols, var
from sympy.core.sympify import SympifyError, sympify
from sympy.core.traversal import bottom_up, postorder_traversal, preorder_traversal, use
from .singleton import S
from .sorting import default_sort_key, ordered
from .symbol import Dummy, Symbol, Wild, symbols, var
from .sympify import SympifyError, sympify
from .traversal import bottom_up, postorder_traversal, preorder_traversal, use

Catalan = ...
EulerGamma = ...
Expand Down
6 changes: 3 additions & 3 deletions stubs/sympy-stubs/vector/parametricregion.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ from functools import singledispatch
from typing import Any
from typing_extensions import Self

from sympy.core import Basic
from sympy.geometry import Curve, Ellipse, Point, Polygon, Segment
from sympy.vector import ImplicitRegion
from ..core import Basic
from ..geometry import Curve, Ellipse, Point, Polygon, Segment
from . import ImplicitRegion

class ParametricRegion(Basic):
def __new__(cls, definition, *bounds) -> Self: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/sympy-stubs/vector/scalar.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing_extensions import Self

from sympy.core import AtomicExpr
from ..core import AtomicExpr

class BaseScalar(AtomicExpr):
def __new__(cls, index, system, pretty_str=..., latex_str=...) -> Self: ...
Expand Down
12 changes: 6 additions & 6 deletions stubs/sympy-stubs/vector/vector.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Any, Callable, Literal
from typing_extensions import Self

from sympy import ImmutableDenseMatrix, Pow
from sympy.core.add import Add
from sympy.core.expr import AtomicExpr, Expr
from sympy.series.order import Order
from sympy.vector.basisdependent import BasisDependent, BasisDependentAdd, BasisDependentMul, BasisDependentZero
from sympy.vector.dyadic import DyadicZero
from ..core.add import Add
from ..core.expr import AtomicExpr, Expr
from ..series.order import Order
from . import ImmutableDenseMatrix, Pow
from .basisdependent import BasisDependent, BasisDependentAdd, BasisDependentMul, BasisDependentZero
from .dyadic import DyadicZero

class Vector(BasisDependent):
is_scalar = ...
Expand Down
2 changes: 0 additions & 2 deletions stubs/vispy/app/application.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import sys
from .. import config
from ..util import logger
from . import backends
from ._detect_eventloop import _get_running_interactive_framework
from .backends import BACKEND_NAMES, BACKENDMAP, CORE_BACKENDS, TRIED_BACKENDS
from .base import BaseApplicationBackend as ApplicationBackend # noqa

class Application(object):
Expand Down
7 changes: 3 additions & 4 deletions stubs/vispy/app/canvas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ from typing import Callable, Mapping

import numpy as np
from numpy.typing import ArrayLike
from vispy.app.application import Application
from vispy.gloo.context import GLContext
from vispy.scene.widgets.widget import Widget
from vispy.util.keys import Key

from ..gloo import FrameBuffer, RenderBuffer
from ..gloo.context import GLContext, forget_canvas, set_current_canvas
from ..scene.widgets.widget import Widget
from ..util import config as util_config, logger
from ..util.dpi import get_dpi
from ..util.event import EmitterGroup, Event, WarningEmitter
from ..util.keys import Key
from ..util.ptime import time
from . import Application, use_app
from .application import Application

# todo: add functions for asking about current mouse/keyboard state
# todo: add hover enter/exit events
Expand Down
26 changes: 26 additions & 0 deletions stubs/vispy/app/timer.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- 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

from . import Application
from .base import BaseTimerBackend as TimerBackend # noqa

class Timer:
def __init__(self, interval=..., connect=..., iterations=..., start=..., app=...) -> None: ...
@property
def app(self) -> Application: ...
@property
def interval(self) -> float: ...
@interval.setter
def interval(self, val) -> None: ...
@property
def elapsed(self) -> float: ...
@property
def running(self) -> bool: ...
def start(self, interval=..., iterations=...) -> None: ...
def stop(self) -> None: ...
@property
def native(self) -> Any: ...
def connect(self, callback): ...
def disconnect(self, callback=...): ...
1 change: 0 additions & 1 deletion stubs/vispy/color/colormap.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import warnings
from typing import Sequence

import numpy as np
import vispy.gloo
from numpy.typing import ArrayLike, NDArray

from .._typing import Scalar
Expand Down
3 changes: 2 additions & 1 deletion stubs/vispy/io/stl.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import IO

import numpy as np
from vispy._typing import FileLike

from .._typing import FileLike

# -*- coding: utf-8 -*-
# Copyright (c) 2015 Michael Dawson-Haggerty
Expand Down
3 changes: 1 addition & 2 deletions stubs/vispy/plot/fig.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from vispy.util.svg.color import Color

from ..scene import SceneCanvas
from ..util.svg.color import Color
from .plotwidget import PlotWidget

# -*- coding: utf-8 -*-
Expand Down
Loading

0 comments on commit 7bb3d5b

Please sign in to comment.