Skip to content

Commit 8790e15

Browse files
committed
Merge branch 'feature/v0.4.3' into develop
2 parents 7f0d734 + d02aa1e commit 8790e15

File tree

7 files changed

+13
-16
lines changed

7 files changed

+13
-16
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
hooks:
55
- id: flynt
66
- repo: https://github.com/charliermarsh/ruff-pre-commit
7-
rev: 'v0.0.237'
7+
rev: 'v0.0.239'
88
hooks:
99
- id: ruff
1010
- repo: https://github.com/psf/black

colour/hints/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@
1717
Any,
1818
Callable,
1919
Dict,
20-
Generator,
21-
Iterable,
22-
Iterator,
2320
List,
2421
Literal,
25-
Mapping,
2622
NewType,
2723
Optional,
2824
Protocol,
29-
Sequence,
3025
SupportsIndex,
3126
TYPE_CHECKING,
3227
TextIO,
@@ -39,6 +34,7 @@
3934
overload,
4035
runtime_checkable,
4136
)
37+
from collections.abc import Generator, Iterable, Iterator, Mapping, Sequence
4238
from typing_extensions import Self
4339

4440
__author__ = "Colour Developers"

colour/plotting/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import contextlib
2828
import functools
2929
import itertools
30-
import matplotlib
30+
import matplotlib as mpl
3131
import matplotlib.cm
3232
import matplotlib.pyplot as plt
3333
import matplotlib.ticker
@@ -1510,7 +1510,7 @@ def plot_multi_functions(
15101510

15111511
# TODO: Remove when "Matplotlib" minimum version can be set to 3.5.0.
15121512
matplotlib_3_5 = tuple(
1513-
int(token) for token in matplotlib.__version__.split(".")[:2]
1513+
int(token) for token in mpl.__version__.split(".")[:2]
15141514
) >= (3, 5)
15151515

15161516
if log_x is not None and log_y is not None:

colour/plotting/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*VSCode*.
88
"""
99

10-
import matplotlib
10+
import matplotlib as mpl
1111
import pytest
1212

1313
from colour.hints import Generator
@@ -38,7 +38,7 @@ def mpl_headless_backend() -> Generator[None, None, None]:
3838
*Matplotlib* unit tests.
3939
"""
4040

41-
current_backend = matplotlib.get_backend()
42-
matplotlib.use("AGG")
41+
current_backend = mpl.get_backend()
42+
mpl.use("AGG")
4343
yield
44-
matplotlib.use(current_backend)
44+
mpl.use(current_backend)

colour/utilities/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ def is_matplotlib_installed(raise_exception: bool = False) -> bool:
663663

664664
try: # pragma: no cover
665665
# pylint: disable=W0611
666-
import matplotlib # noqa: F401
666+
import matplotlib as mpl # noqa: F401
667667

668668
return True
669669
except ImportError as error: # pragma: no cover

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pydata-sphinx-theme = { version = "*", optional = true } # Development dependen
6969
pyright = { version = "*", optional = true } # Development dependency.
7070
pytest = { version = "*", optional = true } # Development dependency.
7171
pytest-cov = { version = "*", optional = true } # Development dependency.
72-
pytest-xdist = { version = "*", optional = true} #Development dependency
72+
pytest-xdist = { version = "*", optional = true} # Development dependency
7373
restructuredtext-lint = { version = "*", optional = true } # Development dependency.
7474
ruff = { version = "*", optional = true } # Development dependency.
7575
sphinx = { version = ">= 4, < 5", optional = true } # Development dependency.
@@ -225,6 +225,7 @@ ignore = [
225225
"N816",
226226
"PIE804",
227227
"PLE0605",
228+
"PLR0913",
228229
"PLR2004",
229230
"RET504",
230231
"RET505",

utilities/generate_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
from __future__ import annotations
88

9-
import matplotlib
9+
import matplotlib as mpl
1010

11-
matplotlib.use("AGG")
11+
mpl.use("AGG")
1212

1313
import matplotlib.pyplot as plt # noqa: E402
1414
import numpy as np # noqa: E402

0 commit comments

Comments
 (0)