8000 passing the pyright test · matplotlib/matplotlib@aee2931 · GitHub
[go: up one dir, main page]

Skip to content

Commit aee2931

Browse files
committed
passing the pyright test
1 parent e485a7d commit aee2931

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

lib/matplotlib/dates.pyi

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Union
44

55
from .axis import Axis
66
from .projections.polar import _AxisWrapper
7-
from .ticker import _DummyAxis, Formatter, Locator
7+
from .ticker import _DummyAxis, Formatter, Locator, TickHelper
88
from .units import AxisInfo, ConversionInterface
99

1010

@@ -103,7 +103,7 @@ class DateLocator(Locator):
103103
def viewlim_to_dt(self) -> tuple[datetime.datetime, datetime.datetime]: ...
104104
def _get_unit(self) -> float: ...
105105
def _get_interval(self) -> int: ...
106-
def nonsingular(self, vmin: float, vmax: float) -> tuple[float, float]: ...
106+
def nonsingular(self, v0: float, v1: float) -> tuple[float, float]: ...
107107

108108
class RRuleLocator(DateLocator):
109109
def __init__(self, o: rrulewrapper, tz: Optional[datetime.tzinfo] = None) -> None: ...
@@ -119,22 +119,16 @@ class AutoDateLocator(DateLocator):
119119
def __init__(self, tz: Optional[Union[str, datetime.tzinfo]] = None, minticks: int = 5,
120120
maxticks: Optional[Union[int, Dict[int, int]]] = None,
121121
interval_multiples: bool = True) -> None: ...
122-
123122
def __call__(self) -> List[float]: ...
124-
125123
def tick_values(self, vmin: float, vmax: float) -> List[float]: ...
126-
127-
def nonsingular(self, vmin: float, vmax: float) -> tuple[float, float]: ...
128-
124+
def nonsingular(self, v0: float, v1: float) -> tuple[float, float]: ...
129125
def _get_unit(self) -> float: ...
130-
131126
def get_locator(self, dmin: datetime.datetime, dmax: datetime.datetime) -> RRuleLocator: ...
132127

133128

134129
class YearLocator(RRuleLocator):
135130
def __init__(self, base: int = 1, month: int = 1, day: int = 1,
136131
tz: Optional[Union[str, datetime.tzinfo]] = None) -> None: ...
137-
138132
def _create_rrule(self, vmin: datetime.datetime, vmax: datetime.datetime) -> tuple[datetime.datetime, datetime.datetime]: ...
139133

140134

@@ -165,55 +159,42 @@ class SecondLocator(RRuleLocator):
165159

166160
class MicrosecondLocator(DateLocator):
167161
def __init__(self, interval: int = 1, tz: Optional[Union[str, datetime.tzinfo]] = None) -> None: ...
168-
169-
# Fix: Argument 1 incompatible with supertype TickHelper
170162
def set_axis(self, axis: Union[Axis, _DummyAxis, _AxisWrapper, None]) -> None: ...
171-
172163
def __call__(self) -> List[float]: ...
173-
174164
def tick_values(self, vmin: float, vmax: float) -> Sequence[float]: ...
175-
176165
def _get_unit(self) -> float: ...
177-
178166
def _get_interval(self) -> int: ...
179167

180168
# --- Converter Classes ---
181169

182170
class DateConverter(ConversionInterface):
183171
def __init__(self, *, interval_multiples: bool = True) -> None: ...
184-
185172
@staticmethod
186-
def axisinfo(unit: Optional[datetime.tzinfo], axis: Axis) -> AxisInfo: ...
187-
173+
def axisinfo(unit: Optional[datetime.tzinfo], axis: Axis) -> None: ...
188174
@staticmethod
189-
def convert(value: Union[datetime.datetime, datetime.date, float, np.datetime64, Sequence[Union[datetime.datetime, datetime.date, float, np.datetime64]]],
175+
def convert(obj: Union[datetime.datetime, datetime.date, float, np.datetime64, Sequence[Union[datetime.datetime, datetime.date, float, np.datetime64]]],
190176
unit: Optional[datetime.tzinfo], axis: Axis) -> Union[float, np.ndarray]: ...
191-
192177
@staticmethod
193178
def default_units(x: Union[datetime.datetime, datetime.date, float, np.ndarray, Sequence[Union[datetime.datetime, datetime.date, float, np.datetime64]]],
194-
axis: Axis) -> Optional[datetime.tzinfo]: ...
179+
axis: Axis) -> None: ...
195180

196181

197182
class ConciseDateConverter(DateConverter):
198183
def __init__(self, formats: Optional[List[str]] = None, zero_formats: Optional[List[str]] = None,
199184
offset_formats: Optional[List[str]] = None,
200185
show_offset: bool = True, *, interval_multiples: bool = True) -> None: ...
201-
202186
@staticmethod
203-
def axisinfo(unit: Optional[datetime.tzinfo], axis: Axis) -> AxisInfo: ...
187+
def axisinfo(unit: Optional[datetime.tzinfo], axis: Axis) -> None: ...
204188

205189

206190
class _SwitchableDateConverter:
207191
@staticmethod
208192
def _get_converter() -> Union["ConciseDateConverter", "DateConverter"]: ...
209-
210193
@staticmethod
211194
def axisinfo(unit: Optional[datetime.tzinfo], axis: Axis) -> AxisInfo: ...
212-
213195
@staticmethod
214196
def default_units(x: Union[datetime.datetime, datetime.date, float, np.ndarray, Sequence[Union[datetime.datetime, datetime.date, float, np.datetime64]]],
215197
axis: Axis) -> Optional[datetime.tzinfo]: ...
216-
217198
@staticmethod
218199
def convert(value: Union[datetime.datetime, datetime.date, float, np.datetime64, Sequence[Union[datetime.datetime, datetime.date, float, np.datetime64]]],
219200
unit: Optional[datetime.tzinfo], axis: Axis) -> Union[float, np.ndarray]: ...

0 commit comments

Comments
 (0)
0