Skip to content

Commit 969341c

Browse files
committed
fixes
1 parent 1591758 commit 969341c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

ci/min_deps_check.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import sys
1212
from collections.abc import Iterator
1313
from datetime import datetime
14-
from typing import Optional
1514

1615
import conda.api # type: ignore[import]
1716
import yaml
@@ -58,7 +57,7 @@ def warning(msg: str) -> None:
5857
print("WARNING:", msg)
5958

6059

61-
def parse_requirements(fname) -> Iterator[tuple[str, int, int, Optional[int]]]:
60+
def parse_requirements(fname) -> Iterator[tuple[str, int, int, int | None]]:
6261
"""Load requirements/py*-min-all-deps.yml
6362
6463
Yield (package name, major version, minor version, [patch version])
@@ -129,7 +128,7 @@ def metadata(entry):
129128

130129

131130
def process_pkg(
132-
pkg: str, req_major: int, req_minor: int, req_patch: Optional[int]
131+
pkg: str, req_major: int, req_minor: int, req_patch: int | None
133132
) -> tuple[str, str, str, str, str, str]:
134133
"""Compare package version from requirements file to available versions in conda.
135134
Return row to build pandas dataframe:
@@ -141,7 +140,7 @@ def process_pkg(
141140
- publication date of version suggested by policy (YYYY-MM-DD)
142141
- status ("<", "=", "> (!)")
143142
"""
144-
print("Analyzing %s..." % pkg)
143+
print(f"Analyzing {pkg}...")
145144
versions = query_conda(pkg)
146145

147146
try:

mplotutils/_cartopy_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def yticklabels(
327327
if not y_label_points:
328328
msg = (
329329
"WARN: no points found for ylabel\n"
330-
"y_lim is: {:0.2f} to {:0.2f}".format(y_lim[0], y_lim[1])
330+
f"y_lim is: {y_lim[0]:0.2f} to {y_lim[1]:0.2f}"
331331
)
332332
warnings.warn(msg)
333333

@@ -427,7 +427,7 @@ def xticklabels(
427427
if not x_label_points:
428428
msg = (
429429
"WARN: no points found for xlabel\n"
430-
"x_lim is: {:0.2f} to {:0.2f}".format(x_lim[0], x_lim[1])
430+
f"x_lim is: {x_lim[0]:0.2f} to {x_lim[1]:0.2f}"
431431
)
432432
warnings.warn(msg)
433433

mplotutils/_colormaps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _color_palette(cmap, n_colors):
5555
from matplotlib.colors import ListedColormap
5656

5757
colors_i = np.linspace(0, 1.0, n_colors)
58-
if isinstance(cmap, (list, tuple)):
58+
if isinstance(cmap, list | tuple):
5959
# expand or truncate the list of colors to n_colors
6060
cmap = list(itertools.islice(itertools.cycle(cmap), n_colors))
6161
cmap = ListedColormap(cmap)

0 commit comments

Comments
 (0)