Skip to content

Commit

Permalink
Enable all the *Ruff* checks but the currently ignored ones.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Dec 22, 2024
1 parent ba0ed2a commit f8a54c5
Show file tree
Hide file tree
Showing 142 changed files with 169 additions and 820 deletions.
4 changes: 1 addition & 3 deletions colour/adaptation/tests/test_fairchild2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
chromatic_adaptation_vK20,
matrix_chromatic_adaptation_vk20,
)
from colour.adaptation.fairchild2020 import (
CONDITIONS_DEGREE_OF_ADAPTATION_VK20,
)
from colour.adaptation.fairchild2020 import CONDITIONS_DEGREE_OF_ADAPTATION_VK20
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.utilities import domain_range_scale, ignore_numpy_errors

Expand Down
8 changes: 1 addition & 7 deletions colour/algebra/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
)

from colour.hints import Literal, cast
from colour.utilities import (
as_float,
as_float_array,
optional,
tsplit,
validate_method,
)
from colour.utilities import as_float, as_float_array, optional, tsplit, validate_method

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
5 changes: 1 addition & 4 deletions colour/appearance/ciecam02.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@
tstack,
zeros,
)
from colour.utilities.documentation import (
DocstringDict,
is_documentation_building,
)
from colour.utilities.documentation import DocstringDict, is_documentation_building

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
5 changes: 1 addition & 4 deletions colour/appearance/hellwig2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
import numpy as np

from colour.algebra import sdiv, sdiv_mode, spow, vecmul
from colour.appearance.cam16 import (
MATRIX_16,
MATRIX_INVERSE_16,
)
from colour.appearance.cam16 import MATRIX_16, MATRIX_INVERSE_16
from colour.appearance.ciecam02 import (
VIEWING_CONDITIONS_CIECAM02,
InductionFactors_CIECAM02,
Expand Down
7 changes: 1 addition & 6 deletions colour/appearance/hke.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
if typing.TYPE_CHECKING: # pragma: no cover
from colour.hints import ArrayLike, Literal, NDArrayFloat

from colour.utilities import (
CanonicalMapping,
as_float_array,
tsplit,
validate_method,
)
from colour.utilities import CanonicalMapping, as_float_array, tsplit, validate_method

__author__ = "Ilia Sibiryakov"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
8 changes: 1 addition & 7 deletions colour/appearance/llab.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@

import numpy as np

from colour.algebra import (
polar_to_cartesian,
sdiv,
sdiv_mode,
spow,
vecmul,
)
from colour.algebra import polar_to_cartesian, sdiv, sdiv_mode, spow, vecmul

if typing.TYPE_CHECKING: # pragma: no cover
from colour.hints import ArrayLike, NDArrayFloat
Expand Down
6 changes: 1 addition & 5 deletions colour/appearance/tests/test_atd95.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

from colour.appearance import XYZ_to_ATD95
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.utilities import (
as_float_array,
domain_range_scale,
ignore_numpy_errors,
)
from colour.utilities import as_float_array, domain_range_scale, ignore_numpy_errors

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
6 changes: 1 addition & 5 deletions colour/appearance/tests/test_hunt.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
XYZ_to_Hunt,
)
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.utilities import (
as_float_array,
domain_range_scale,
ignore_numpy_errors,
)
from colour.utilities import as_float_array, domain_range_scale, ignore_numpy_errors

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
6 changes: 1 addition & 5 deletions colour/appearance/tests/test_nayatani95.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

from colour.appearance import XYZ_to_Nayatani95
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.utilities import (
as_float_array,
domain_range_scale,
ignore_numpy_errors,
)
from colour.utilities import as_float_array, domain_range_scale, ignore_numpy_errors

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
6 changes: 1 addition & 5 deletions colour/appearance/tests/test_rlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

from colour.appearance import XYZ_to_Nayatani95
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.utilities import (
as_float_array,
domain_range_scale,
ignore_numpy_errors,
)
from colour.utilities import as_float_array, domain_range_scale, ignore_numpy_errors

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
6 changes: 1 addition & 5 deletions colour/blindness/machado2009.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@
if typing.TYPE_CHECKING: # pragma: no cover
from colour.characterisation import RGB_DisplayPrimaries

from colour.colorimetry import (
LMS_ConeFundamentals,
SpectralShape,
reshape_msds,
)
from colour.colorimetry import LMS_ConeFundamentals, SpectralShape, reshape_msds

if typing.TYPE_CHECKING: # pragma: no cover
from colour.hints import ArrayLike, Literal, NDArrayFloat
Expand Down
13 changes: 2 additions & 11 deletions colour/characterisation/aces_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@
from scipy.optimize import minimize

from colour.adaptation import matrix_chromatic_adaptation_VonKries
from colour.algebra import (
euclidean_distance,
vecmul,
)
from colour.algebra import euclidean_distance, vecmul
from colour.characterisation import (
MSDS_ACES_RICD,
RGB_CameraSensitivities,
Expand Down Expand Up @@ -98,13 +95,7 @@

from colour.hints import cast
from colour.io import read_sds_from_csv_file
from colour.models import (
XYZ_to_Jzazbz,
XYZ_to_Lab,
XYZ_to_Oklab,
XYZ_to_xy,
xy_to_XYZ,
)
from colour.models import XYZ_to_Jzazbz, XYZ_to_Lab, XYZ_to_Oklab, XYZ_to_xy, xy_to_XYZ
from colour.models.rgb import (
RGB_COLOURSPACE_ACES2065_1,
RGB_Colourspace,
Expand Down
16 changes: 3 additions & 13 deletions colour/colorimetry/dominant.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,9 @@
import numpy as np
import scipy.spatial.distance

from colour.algebra import (
euclidean_distance,
sdiv,
sdiv_mode,
)
from colour.colorimetry import (
MultiSpectralDistributions,
handle_spectral_arguments,
)
from colour.geometry import (
extend_line_segment,
intersect_line_segments,
)
from colour.algebra import euclidean_distance, sdiv, sdiv_mode
from colour.colorimetry import MultiSpectralDistributions, handle_spectral_arguments
from colour.geometry import extend_line_segment, intersect_line_segments

if typing.TYPE_CHECKING: # pragma: no cover
from colour.hints import ArrayLike, NDArrayFloat, NDArrayInt, Tuple
Expand Down
6 changes: 1 addition & 5 deletions colour/colorimetry/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

import numpy as np

from colour.colorimetry import (
SDS_LEFS_PHOTOPIC,
SpectralDistribution,
reshape_sd,
)
from colour.colorimetry import SDS_LEFS_PHOTOPIC, SpectralDistribution, reshape_sd
from colour.constants import CONSTANT_K_M
from colour.utilities import as_float_scalar, optional

Expand Down
5 changes: 1 addition & 4 deletions colour/colorimetry/tests/test_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

import numpy as np

from colour.colorimetry import (
SpectralDistribution,
bandpass_correction_Stearns1988,
)
from colour.colorimetry import SpectralDistribution, bandpass_correction_Stearns1988
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

__author__ = "Colour Developers"
Expand Down
4 changes: 1 addition & 3 deletions colour/colorimetry/tests/test_dominant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
dominant_wavelength,
excitation_purity,
)
from colour.colorimetry.dominant import (
closest_spectral_locus_wavelength,
)
from colour.colorimetry.dominant import closest_spectral_locus_wavelength
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.models import XYZ_to_xy
from colour.utilities import ignore_numpy_errors
Expand Down
5 changes: 1 addition & 4 deletions colour/colorimetry/tests/test_yellowness.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
yellowness_ASTME313,
yellowness_ASTME313_alternative,
)
from colour.colorimetry.yellowness import (
YELLOWNESS_COEFFICIENTS_ASTME313,
yellowness,
)
from colour.colorimetry.yellowness import YELLOWNESS_COEFFICIENTS_ASTME313, yellowness
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.utilities import domain_range_scale, ignore_numpy_errors

Expand Down
1 change: 1 addition & 0 deletions colour/colorimetry/whiteness.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

if typing.TYPE_CHECKING: # pragma: no cover
from colour.hints import Any, ArrayLike, Literal, NDArrayFloat

from colour.utilities import (
CanonicalMapping,
as_float,
Expand Down
5 changes: 1 addition & 4 deletions colour/constants/cie.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
ISBN:978-0-471-39918-6
"""

from colour.utilities.documentation import (
DocstringFloat,
is_documentation_building,
)
from colour.utilities.documentation import DocstringFloat, is_documentation_building

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
5 changes: 1 addition & 4 deletions colour/constants/codata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
Science and Technology (CODATA).
"""

from colour.utilities.documentation import (
DocstringFloat,
is_documentation_building,
)
from colour.utilities.documentation import DocstringFloat, is_documentation_building

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
5 changes: 1 addition & 4 deletions colour/constants/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
import numpy as np

from colour.hints import DTypeFloat, Type, cast
from colour.utilities.documentation import (
DocstringFloat,
is_documentation_building,
)
from colour.utilities.documentation import DocstringFloat, is_documentation_building

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
12 changes: 1 addition & 11 deletions colour/continuous/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@
import typing
from collections.abc import Iterator, KeysView, Mapping, Sequence, ValuesView
from operator import pow # noqa: A004
from operator import (
add,
iadd,
imul,
ipow,
isub,
itruediv,
mul,
sub,
truediv,
)
from operator import add, iadd, imul, ipow, isub, itruediv, mul, sub, truediv

import numpy as np

Expand Down
6 changes: 1 addition & 5 deletions colour/continuous/tests/test_multi_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
import numpy as np
import pytest

from colour.algebra import (
CubicSplineInterpolator,
Extrapolator,
KernelInterpolator,
)
from colour.algebra import CubicSplineInterpolator, Extrapolator, KernelInterpolator
from colour.constants import DTYPE_FLOAT_DEFAULT, TOLERANCE_ABSOLUTE_TESTS
from colour.continuous import MultiSignals, Signal
from colour.utilities import (
Expand Down
6 changes: 1 addition & 5 deletions colour/continuous/tests/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
import numpy as np
import pytest

from colour.algebra import (
CubicSplineInterpolator,
Extrapolator,
KernelInterpolator,
)
from colour.algebra import CubicSplineInterpolator, Extrapolator, KernelInterpolator
from colour.constants import DTYPE_FLOAT_DEFAULT, TOLERANCE_ABSOLUTE_TESTS
from colour.continuous import Signal
from colour.utilities import ColourRuntimeWarning, attest, is_pandas_installed
Expand Down
5 changes: 1 addition & 4 deletions colour/corresponding/datasets/breneman1987.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
from colour.hints import NDArrayFloat, Tuple

from colour.utilities import MixinDataclassIterable, as_float_array
from colour.utilities.documentation import (
DocstringDict,
is_documentation_building,
)
from colour.utilities.documentation import DocstringDict, is_documentation_building

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
4 changes: 1 addition & 3 deletions colour/difference/cam16_ucs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
delta_E_CAM02UCS,
delta_E_Luo2006,
)
from colour.models.cam16_ucs import (
_UCS_Luo2006_callable_to_UCS_Li2017_docstring,
)
from colour.models.cam16_ucs import _UCS_Luo2006_callable_to_UCS_Li2017_docstring
from colour.utilities import copy_definition

__author__ = "Colour Developers"
Expand Down
5 changes: 1 addition & 4 deletions colour/difference/delta_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@
tsplit,
zeros,
)
from colour.utilities.documentation import (
DocstringFloat,
is_documentation_building,
)
from colour.utilities.documentation import DocstringFloat, is_documentation_building

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
7 changes: 1 addition & 6 deletions colour/difference/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@
if typing.TYPE_CHECKING: # pragma: no cover
from colour.hints import ArrayLike, Literal, NDArrayFloat

from colour.utilities import (
CanonicalMapping,
as_float,
as_float_array,
validate_method,
)
from colour.utilities import CanonicalMapping, as_float, as_float_array, validate_method

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
6 changes: 1 addition & 5 deletions colour/difference/tests/test_cam02_ucs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import numpy as np

from colour.constants import TOLERANCE_ABSOLUTE_TESTS
from colour.difference import (
delta_E_CAM02LCD,
delta_E_CAM02SCD,
delta_E_CAM02UCS,
)
from colour.difference import delta_E_CAM02LCD, delta_E_CAM02SCD, delta_E_CAM02UCS
from colour.difference.cam02_ucs import delta_E_Luo2006
from colour.models.cam02_ucs import COEFFICIENTS_UCS_LUO2006
from colour.utilities import ignore_numpy_errors
Expand Down
Loading

0 comments on commit f8a54c5

Please sign in to comment.