Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit faed9ba

Browse files
committed
Make flake8 happy
1 parent b1754a2 commit faed9ba

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

lib/matplotlib/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ __all__ = [
3232
import os
3333
from pathlib import Path
3434

35-
from collections.abc import Callable, Generator
35+
from collections.abc import Callable, Generator, MutableMapping
3636
import contextlib
3737
from packaging.version import Version
3838

3939
from matplotlib._api import MatplotlibDeprecationWarning
40-
from typing import Any, NamedTuple
40+
from typing import Any, NamedTuple, Self
4141

4242
class _VersionInfo(NamedTuple):
4343
major: int
@@ -79,8 +79,8 @@ class RcParams(MutableMapping[str, Any]):
7979
def __delitem__(self, key: str) -> None: ...
8080
def __iter__(self) -> Generator[str, None, None]: ...
8181
def __len__(self) -> int: ...
82-
def find_all(self, pattern: str) -> RcParams: ...
83-
def copy(self) -> RcParams: ...
82+
def find_all(self, pattern: str) -> Self: ...
83+
def copy(self) -> Self: ...
8484

8585
def rc_params(fail_on_error: bool = ...) -> RcParams: ...
8686
def rc_params_from_file(

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
from matplotlib.gridspec import GridSpec, SubplotSpec
6868
from matplotlib import rcParams, get_backend, rcParamsOrig
6969
from matplotlib.rcsetup import interactive_bk as _interactive_bk
70+
from matplotlib.rcsetup import _auto_backend_sentinel
7071
from matplotlib.artist import Artist
7172
from matplotlib.axes import Axes, Subplot # type: ignore
7273
from matplotlib.projections import PolarAxes # type: ignore
@@ -302,7 +303,7 @@ def switch_backend(newbackend: str) -> None:
302303
# make sure the init is pulled up so we can assign to it later
303304
import matplotlib.backends
304305

305-
if newbackend is rcsetup._auto_backend_sentinel:
306+
if newbackend is _auto_backend_sentinel:
306307
current_framework = cbook._get_running_interactive_framework()
307308
mapping = {'qt': 'qtagg',
308309
'gtk3': 'gtk3agg',
@@ -2475,9 +2476,9 @@ def polar(*args, **kwargs) -> list[Line2D]:
24752476
# is compatible with the current running interactive framework.
24762477
if (rcParams["backend_fallback"]
24772478
and rcParams._get_backend_or_none() in ( # type: ignore
2478-
set(rcsetup.interactive_bk) - {'WebAgg', 'nbAgg'})
2479+
set(_interactive_bk) - {'WebAgg', 'nbAgg'})
24792480
and cbook._get_running_interactive_framework()): # type: ignore
2480-
rcParams._set("backend", rcsetup._auto_backend_sentinel) # type: ignore
2481+
rcParams._set("backend", _auto_backend_sentinel) # type: ignore
24812482

24822483
# fmt: on
24832484

lib/matplotlib/tests/test_offsetbox.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,9 @@ def test_anchoredtext_horizontal_alignment():
257257
ax.add_artist(text2)
258258

259259

260-
<<<<<<< HEAD
261260
@pytest.mark.parametrize("extent_kind", ["window_extent", "tightbbox"])
262261
def test_annotationbbox_extents(extent_kind):
263262
plt.rcParams.update(plt.rcParamsDefault)
264-
=======
265-
def test_annotationbbox_extents():
266-
plt.rcParams.clear()
267-
>>>>>>> 57d742c95e (Remove `rcParamsDefault`)
268263
fig, ax = plt.subplots(figsize=(4, 3), dpi=100)
269264

270265
ax.axis([0, 1, 0, 1])

0 commit comments

Comments
 (0)