Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 14, 2023
1 parent 8cf1b1b commit 1139346
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 57 deletions.
22 changes: 12 additions & 10 deletions colour/algebra/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@
"""


def get_sdiv_mode() -> Literal[
"Numpy",
"Ignore",
"Warning",
"Raise",
"Ignore Zero Conversion",
"Warning Zero Conversion",
"Ignore Limit Conversion",
"Warning Limit Conversion",
]:
def get_sdiv_mode() -> (
Literal[
"Numpy",
"Ignore",
"Warning",
"Raise",
"Ignore Zero Conversion",
"Warning Zero Conversion",
"Ignore Limit Conversion",
"Warning Limit Conversion",
]
):
"""
Return *Colour* safe division mode.
Expand Down
1 change: 0 additions & 1 deletion colour/appearance/tests/test_llab.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def test_XYZ_to_LLAB(self):
"colour.appearance.llab.MATRIX_RGB_TO_XYZ_LLAB",
np.around(np.linalg.inv(llab.MATRIX_XYZ_TO_RGB_LLAB), decimals=4),
):

XYZ = np.array([19.01, 20.00, 21.78])
XYZ_0 = np.array([95.05, 100.00, 108.88])
Y_b = 20
Expand Down
7 changes: 4 additions & 3 deletions colour/characterisation/aces_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,10 @@ def matrix_idt(
| str
| None = "CAT02",
additional_data: bool = False,
) -> Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat, NDArrayFloat] | Tuple[
NDArrayFloat, NDArrayFloat
]:
) -> (
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat, NDArrayFloat]
| Tuple[NDArrayFloat, NDArrayFloat]
):
"""
Compute an *Input Device Transform* (IDT) matrix for given camera *RGB*
spectral sensitivities, illuminant, training data, standard observer colour
Expand Down
2 changes: 1 addition & 1 deletion colour/colorimetry/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ def sd_multi_leds_Ohno2005(

sd = sd_zeros(shape)

for (peak_wavelength, fwhm_s, peak_power_ratio) in zip(
for peak_wavelength, fwhm_s, peak_power_ratio in zip(
peak_wavelengths, fwhm, peak_power_ratios
):
sd += (
Expand Down
1 change: 0 additions & 1 deletion colour/io/luts/lut.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ def __init__(
size: ArrayLike | None = None,
comments: Sequence | None = None,
) -> None:

domain = as_float_array(optional(domain, np.array([0, 1])))
size = optional(size, 10)

Expand Down
66 changes: 35 additions & 31 deletions colour/io/tm2714.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def __init__(
document_creation_date: str | None = None,
comments: str | None = None,
) -> None:

self._mapping: Structure = Structure(
**{
"element": "Header",
Expand Down Expand Up @@ -923,7 +922,6 @@ def __init__(
bandwidth_corrected: bool | None = None,
**kwargs,
) -> None:

super().__init__(**kwargs)

self._mapping: Structure = Structure(
Expand Down Expand Up @@ -1081,20 +1079,23 @@ def header(self, value: Header_IESTM2714):
@property
def spectral_quantity(
self,
) -> Literal[
"absorptance",
"exitance",
"flux",
"intensity",
"irradiance",
"radiance",
"reflectance",
"relative",
"transmittance",
"R-Factor",
"T-Factor",
"other",
] | None:
) -> (
Literal[
"absorptance",
"exitance",
"flux",
"intensity",
"irradiance",
"radiance",
"reflectance",
"relative",
"transmittance",
"R-Factor",
"T-Factor",
"other",
]
| None
):
"""
Getter and setter property for the spectral quantity.
Expand Down Expand Up @@ -1143,20 +1144,23 @@ def spectral_quantity(
@property
def reflection_geometry(
self,
) -> Literal[
"di:8",
"de:8",
"8:di",
"8:de",
"d:d",
"d:0",
"45a:0",
"45c:0",
"0:45a",
"45x:0",
"0:45x",
"other",
] | None:
) -> (
Literal[
"di:8",
"de:8",
"8:di",
"8:de",
"d:d",
"d:0",
"45a:0",
"45c:0",
"0:45a",
"45x:0",
"0:45x",
"other",
]
| None
):
"""
Getter and setter property for the reflection geometry.
Expand Down Expand Up @@ -1782,7 +1786,7 @@ def write(self) -> bool:
spectral_distribution = element

# Writing spectral data.
for (wavelength, value) in tstack([self.wavelengths, self.values]):
for wavelength, value in tstack([self.wavelengths, self.values]):
element_child = ElementTree.SubElement(
spectral_distribution, mapping.data.element
)
Expand Down
1 change: 0 additions & 1 deletion colour/plotting/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ def plot_RGB_colourspaces_gamuts(
RGB_cf: list = []
RGB_ce: list = []
for i, colourspace in enumerate(colourspaces):

if chromatically_adapt and not np.array_equal(
colourspace.whitepoint, plotting_colourspace.whitepoint
):
Expand Down
7 changes: 4 additions & 3 deletions colour/recovery/jakob2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ def error_function(
illuminant: SpectralDistribution,
max_error: float | None = None,
additional_data: bool = False,
) -> Tuple[float, NDArrayFloat] | Tuple[
float, NDArrayFloat, NDArrayFloat, NDArrayFloat, NDArrayFloat
]:
) -> (
Tuple[float, NDArrayFloat]
| Tuple[float, NDArrayFloat, NDArrayFloat, NDArrayFloat, NDArrayFloat]
):
"""
Compute :math:`\\Delta E_{76}` between the target colour and the colour
defined by given spectral model, along with its gradient.
Expand Down
11 changes: 7 additions & 4 deletions colour/recovery/jiang2013.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ def PCA_Jiang2013(
msds_camera_sensitivities: Mapping[str, MultiSpectralDistributions],
eigen_w_v_count: int | None = None,
additional_data: bool = False,
) -> Tuple[
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
] | Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat]:
) -> (
Tuple[
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
]
| Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat]
):
"""
Perform the *Principal Component Analysis* (PCA) on given camera *RGB*
sensitivities.
Expand Down
2 changes: 0 additions & 2 deletions colour/utilities/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ def __getattr__(self, attribute: str) -> Any:

if change is not None:
if not isinstance(change, ObjectRemoved):

usage_warning(str(change))

return (
Expand Down Expand Up @@ -564,7 +563,6 @@ def handle_arguments_deprecation(changes: dict, **kwargs: Any) -> dict:
continue

if not isinstance(change, ArgumentRemoved):

usage_warning(str(change))

if isinstance(change, ArgumentFutureRemove):
Expand Down

0 comments on commit 1139346

Please sign in to comment.