Skip to content

Commit

Permalink
Merge branch 'feature/v0.4.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Feb 3, 2023
2 parents 7f0d734 + d02aa1e commit 8790e15
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: flynt
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.237'
rev: 'v0.0.239'
hooks:
- id: ruff
- repo: https://github.com/psf/black
Expand Down
6 changes: 1 addition & 5 deletions colour/hints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
Any,
Callable,
Dict,
Generator,
Iterable,
Iterator,
List,
Literal,
Mapping,
NewType,
Optional,
Protocol,
Sequence,
SupportsIndex,
TYPE_CHECKING,
TextIO,
Expand All @@ -39,6 +34,7 @@
overload,
runtime_checkable,
)
from collections.abc import Generator, Iterable, Iterator, Mapping, Sequence
from typing_extensions import Self

__author__ = "Colour Developers"
Expand Down
4 changes: 2 additions & 2 deletions colour/plotting/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import contextlib
import functools
import itertools
import matplotlib
import matplotlib as mpl
import matplotlib.cm
import matplotlib.pyplot as plt
import matplotlib.ticker
Expand Down Expand Up @@ -1510,7 +1510,7 @@ def plot_multi_functions(

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

if log_x is not None and log_y is not None:
Expand Down
8 changes: 4 additions & 4 deletions colour/plotting/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*VSCode*.
"""

import matplotlib
import matplotlib as mpl
import pytest

from colour.hints import Generator
Expand Down Expand Up @@ -38,7 +38,7 @@ def mpl_headless_backend() -> Generator[None, None, None]:
*Matplotlib* unit tests.
"""

current_backend = matplotlib.get_backend()
matplotlib.use("AGG")
current_backend = mpl.get_backend()
mpl.use("AGG")
yield
matplotlib.use(current_backend)
mpl.use(current_backend)
2 changes: 1 addition & 1 deletion colour/utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def is_matplotlib_installed(raise_exception: bool = False) -> bool:

try: # pragma: no cover
# pylint: disable=W0611
import matplotlib # noqa: F401
import matplotlib as mpl # noqa: F401

return True
except ImportError as error: # pragma: no cover
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pydata-sphinx-theme = { version = "*", optional = true } # Development dependen
pyright = { version = "*", optional = true } # Development dependency.
pytest = { version = "*", optional = true } # Development dependency.
pytest-cov = { version = "*", optional = true } # Development dependency.
pytest-xdist = { version = "*", optional = true} #Development dependency
pytest-xdist = { version = "*", optional = true} # Development dependency
restructuredtext-lint = { version = "*", optional = true } # Development dependency.
ruff = { version = "*", optional = true } # Development dependency.
sphinx = { version = ">= 4, < 5", optional = true } # Development dependency.
Expand Down Expand Up @@ -225,6 +225,7 @@ ignore = [
"N816",
"PIE804",
"PLE0605",
"PLR0913",
"PLR2004",
"RET504",
"RET505",
Expand Down
4 changes: 2 additions & 2 deletions utilities/generate_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from __future__ import annotations

import matplotlib
import matplotlib as mpl

matplotlib.use("AGG")
mpl.use("AGG")

import matplotlib.pyplot as plt # noqa: E402
import numpy as np # noqa: E402
Expand Down

0 comments on commit 8790e15

Please sign in to comment.