Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all reportUndefinedVariable #334

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ reportUnsupportedDunderAll = "error"
reportAssertTypeFailure = "none" # TODO
reportAttributeAccessIssue = "none" # TODO
reportGeneralTypeIssues = "none" # TODO
reportUndefinedVariable = "none" # TODO

[tool.mypy]
# Target oldest supported Python version
Expand Down
2 changes: 2 additions & 0 deletions stubs/matplotlib/backends/_backend_gtk.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 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._typing import *
from matplotlib.backend_bases import FigureCanvasBase, FigureManagerBase, NavigationToolbar2, TimerBase, _Backend
Expand Down
1 change: 1 addition & 0 deletions stubs/matplotlib/font_manager.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from dataclasses import dataclass
from functools import lru_cache
from pathlib import PosixPath
from typing import Literal
Expand Down
6 changes: 5 additions & 1 deletion stubs/matplotlib/widgets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ from typing import Any, Callable, Dict, List, Literal, Mapping, Optional, Sequen
import matplotlib as mpl
import numpy as np
from matplotlib.axes._axes import Axes
from matplotlib.backend_bases import MouseButton
from matplotlib.backend_bases import DrawEvent, Event, FigureCanvasBase, KeyEvent, MouseButton, MouseEvent
from matplotlib.figure import Figure
from matplotlib.lines import Line2D
from matplotlib.patches import Ellipse, Rectangle
from matplotlib.transforms import Affine2D
from numpy import float64, ndarray
from numpy.typing import ArrayLike
from PIL.Image import Image

from . import _api, _docstring, backend_tools, cbook, colors, ticker, transforms
from ._typing import Color
from .artist import Artist
from .lines import Line2D
from .patches import Circle, Ellipse, Polygon, Rectangle
from .text import Text
from .transforms import Affine2D, TransformedPatchPath

class LockDraw:
Expand Down
3 changes: 2 additions & 1 deletion stubs/networkx/algorithms/planarity.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from typing import Mapping

from numpy.typing import ArrayLike

from ..classes.digraph import DiGraph
from ..classes.graph import Graph

__all__ = ["check_planarity", "is_planar", "PlanarEmbedding"]
Expand Down Expand Up @@ -43,7 +44,7 @@ class LRPlanarity:
def sign(self, e): ...
def sign_recursive(self, e): ...

class PlanarEmbedding(nx.DiGraph):
class PlanarEmbedding(DiGraph):
def get_data(self) -> Mapping: ...
def set_data(self, data: Mapping): ...
def neighbors_cw_order(self, v): ...
Expand Down
1 change: 1 addition & 0 deletions stubs/sklearn/linear_model/_stochastic_gradient.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ from ._sgd_fast import (
Hinge as Hinge,
Huber as Huber,
Log as Log,
LossFunction,
ModifiedHuber as ModifiedHuber,
SquaredEpsilonInsensitive as SquaredEpsilonInsensitive,
SquaredHinge as SquaredHinge,
Expand Down
3 changes: 3 additions & 0 deletions stubs/sympy-stubs/polys/domains/algebraicfield.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from typing import Any

from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.domains.field import Field
from sympy.polys.domains.simpledomain import SimpleDomain
from sympy.polys.polyclasses import ANP
from sympy.series import Order
from sympy.utilities import public

@public
Expand Down
2 changes: 2 additions & 0 deletions stubs/sympy-stubs/polys/domains/complexfield.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Any, Literal

from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.domains.field import Field
from sympy.polys.domains.simpledomain import SimpleDomain
Expand Down
7 changes: 5 additions & 2 deletions stubs/sympy-stubs/polys/domains/expressiondomain.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from types import NotImplementedType
from typing_extensions import Self

from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.domains.domainelement import DomainElement
from sympy.polys.domains.field import Field
Expand Down Expand Up @@ -25,9 +28,9 @@ class ExpressionDomain(Field, CharacteristicZero, SimpleDomain):
def __neg__(f) -> Self: ...
def __add__(f, g) -> NotImplementedType | Self: ...
def __radd__(f, g) -> Self: ...
def __sub__(f, g) -> NotImplementedType | Self | Expression: ...
def __sub__(f, g) -> NotImplementedType | Self: ...
def __rsub__(f, g) -> Self: ...
def __mul__(f, g) -> NotImplementedType | Any | Self: ...
def __mul__(f, g) -> NotImplementedType | Self: ... # | Expression
def __rmul__(f, g) -> Self: ...
def __pow__(f, n) -> Self | NotImplementedType: ...
def __truediv__(f, g) -> Self | NotImplementedType: ...
Expand Down
3 changes: 3 additions & 0 deletions stubs/sympy-stubs/polys/domains/expressionrawdomain.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from typing_extensions import Self

from sympy.core import Expr
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.domains.field import Field
from sympy.polys.domains.simpledomain import SimpleDomain
from sympy.series import Order
from sympy.utilities import public

@public
Expand Down
3 changes: 1 addition & 2 deletions stubs/sympy-stubs/printing/lambdarepr.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from typing import Any

from sympy.printing.numpy import NumPyPrinter # NumPyPrinter is imported for backward compatibility
from sympy.printing.pycode import MpmathPrinter, PythonCodePrinter

from .numpy import NumPyPrinter # NumPyPrinter is imported for backward compatibility

__all__ = [
"PythonCodePrinter",
"MpmathPrinter", # MpmathPrinter is published for backward compatibility
Expand Down
7 changes: 3 additions & 4 deletions stubs/sympy-stubs/stats/rv_interface.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ from sympy.core.power import Pow
from sympy.core.relational import Ne, Relational
from sympy.series.order import Order
from sympy.sets.sets import FiniteSet, Set
from sympy.stats.symbolic_multivariate_probability import CrossCovarianceMatrix, ExpectationMatrix, VarianceMatrix
from sympy.stats.symbolic_probability import CentralMoment, Covariance, Expectation, Moment, Variance

from .rv import (
from sympy.stats.rv import (
PSpace,
cdf,
characteristic_function,
Expand All @@ -33,6 +30,8 @@ from .rv import (
sampling_density,
where,
)
from sympy.stats.symbolic_multivariate_probability import CrossCovarianceMatrix, ExpectationMatrix, VarianceMatrix
from sympy.stats.symbolic_probability import CentralMoment, Covariance, Expectation, Moment, Variance

__all__ = [
"P",
Expand Down
1 change: 1 addition & 0 deletions stubs/vispy/visuals/shaders/variable.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from typing import Literal
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np

from ...gloo.globject import GLObject
from .shader_object import ShaderObject

VARIABLE_TYPES = ...
Expand Down
Loading