From 0cd32bfddd171aab512829e06b9af2e1de848cf2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 09:25:42 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- colour/algebra/common.py | 22 +++++----- colour/appearance/tests/test_llab.py | 1 - colour/colorimetry/generation.py | 2 +- colour/io/luts/lut.py | 1 - colour/io/tm2714.py | 66 +++++++++++++++------------- colour/recovery/jiang2013.py | 11 +++-- colour/utilities/deprecation.py | 2 - 7 files changed, 55 insertions(+), 50 deletions(-) diff --git a/colour/algebra/common.py b/colour/algebra/common.py index 87300c45f0..984f97a6b0 100644 --- a/colour/algebra/common.py +++ b/colour/algebra/common.py @@ -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. diff --git a/colour/appearance/tests/test_llab.py b/colour/appearance/tests/test_llab.py index 7ce0bc1594..408ee13027 100644 --- a/colour/appearance/tests/test_llab.py +++ b/colour/appearance/tests/test_llab.py @@ -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 diff --git a/colour/colorimetry/generation.py b/colour/colorimetry/generation.py index 481438e791..62a0c0f90f 100644 --- a/colour/colorimetry/generation.py +++ b/colour/colorimetry/generation.py @@ -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 += ( diff --git a/colour/io/luts/lut.py b/colour/io/luts/lut.py index 27c35c06ca..60b6b20c28 100644 --- a/colour/io/luts/lut.py +++ b/colour/io/luts/lut.py @@ -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) diff --git a/colour/io/tm2714.py b/colour/io/tm2714.py index 2478ffb66f..10cc79e498 100644 --- a/colour/io/tm2714.py +++ b/colour/io/tm2714.py @@ -176,7 +176,6 @@ def __init__( document_creation_date: str | None = None, comments: str | None = None, ) -> None: - self._mapping: Structure = Structure( **{ "element": "Header", @@ -923,7 +922,6 @@ def __init__( bandwidth_corrected: bool | None = None, **kwargs, ) -> None: - super().__init__(**kwargs) self._mapping: Structure = Structure( @@ -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. @@ -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. @@ -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 ) diff --git a/colour/recovery/jiang2013.py b/colour/recovery/jiang2013.py index 2c68225933..9971af8390 100644 --- a/colour/recovery/jiang2013.py +++ b/colour/recovery/jiang2013.py @@ -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. diff --git a/colour/utilities/deprecation.py b/colour/utilities/deprecation.py index 9bbb5276ac..d3e9dc48f5 100644 --- a/colour/utilities/deprecation.py +++ b/colour/utilities/deprecation.py @@ -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 ( @@ -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):