Skip to content

Commit 0cd32bf

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent daff15a commit 0cd32bf

File tree

7 files changed

+55
-50
lines changed

7 files changed

+55
-50
lines changed

colour/algebra/common.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,18 @@
7474
"""
7575

7676

77-
def get_sdiv_mode() -> Literal[
78-
"Numpy",
79-
"Ignore",
80-
"Warning",
81-
"Raise",
82-
"Ignore Zero Conversion",
83-
"Warning Zero Conversion",
84-
"Ignore Limit Conversion",
85-
"Warning Limit Conversion",
86-
]:
77+
def get_sdiv_mode() -> (
78+
Literal[
79+
"Numpy",
80+
"Ignore",
81+
"Warning",
82+
"Raise",
83+
"Ignore Zero Conversion",
84+
"Warning Zero Conversion",
85+
"Ignore Limit Conversion",
86+
"Warning Limit Conversion",
87+
]
88+
):
8789
"""
8890
Return *Colour* safe division mode.
8991

colour/appearance/tests/test_llab.py

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def test_XYZ_to_LLAB(self):
5151
"colour.appearance.llab.MATRIX_RGB_TO_XYZ_LLAB",
5252
np.around(np.linalg.inv(llab.MATRIX_XYZ_TO_RGB_LLAB), decimals=4),
5353
):
54-
5554
XYZ = np.array([19.01, 20.00, 21.78])
5655
XYZ_0 = np.array([95.05, 100.00, 108.88])
5756
Y_b = 20

colour/colorimetry/generation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ def sd_multi_leds_Ohno2005(
755755

756756
sd = sd_zeros(shape)
757757

758-
for (peak_wavelength, fwhm_s, peak_power_ratio) in zip(
758+
for peak_wavelength, fwhm_s, peak_power_ratio in zip(
759759
peak_wavelengths, fwhm, peak_power_ratios
760760
):
761761
sd += (

colour/io/luts/lut.py

-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,6 @@ def __init__(
892892
size: ArrayLike | None = None,
893893
comments: Sequence | None = None,
894894
) -> None:
895-
896895
domain = as_float_array(optional(domain, np.array([0, 1])))
897896
size = optional(size, 10)
898897

colour/io/tm2714.py

+35-31
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def __init__(
176176
document_creation_date: str | None = None,
177177
comments: str | None = None,
178178
) -> None:
179-
180179
self._mapping: Structure = Structure(
181180
**{
182181
"element": "Header",
@@ -923,7 +922,6 @@ def __init__(
923922
bandwidth_corrected: bool | None = None,
924923
**kwargs,
925924
) -> None:
926-
927925
super().__init__(**kwargs)
928926

929927
self._mapping: Structure = Structure(
@@ -1081,20 +1079,23 @@ def header(self, value: Header_IESTM2714):
10811079
@property
10821080
def spectral_quantity(
10831081
self,
1084-
) -> Literal[
1085-
"absorptance",
1086-
"exitance",
1087-
"flux",
1088-
"intensity",
1089-
"irradiance",
1090-
"radiance",
1091-
"reflectance",
1092-
"relative",
1093-
"transmittance",
1094-
"R-Factor",
1095-
"T-Factor",
1096-
"other",
1097-
] | None:
1082+
) -> (
1083+
Literal[
1084+
"absorptance",
1085+
"exitance",
1086+
"flux",
1087+
"intensity",
1088+
"irradiance",
1089+
"radiance",
1090+
"reflectance",
1091+
"relative",
1092+
"transmittance",
1093+
"R-Factor",
1094+
"T-Factor",
1095+
"other",
1096+
]
1097+
| None
1098+
):
10981099
"""
10991100
Getter and setter property for the spectral quantity.
11001101
@@ -1143,20 +1144,23 @@ def spectral_quantity(
11431144
@property
11441145
def reflection_geometry(
11451146
self,
1146-
) -> Literal[
1147-
"di:8",
1148-
"de:8",
1149-
"8:di",
1150-
"8:de",
1151-
"d:d",
1152-
"d:0",
1153-
"45a:0",
1154-
"45c:0",
1155-
"0:45a",
1156-
"45x:0",
1157-
"0:45x",
1158-
"other",
1159-
] | None:
1147+
) -> (
1148+
Literal[
1149+
"di:8",
1150+
"de:8",
1151+
"8:di",
1152+
"8:de",
1153+
"d:d",
1154+
"d:0",
1155+
"45a:0",
1156+
"45c:0",
1157+
"0:45a",
1158+
"45x:0",
1159+
"0:45x",
1160+
"other",
1161+
]
1162+
| None
1163+
):
11601164
"""
11611165
Getter and setter property for the reflection geometry.
11621166
@@ -1782,7 +1786,7 @@ def write(self) -> bool:
17821786
spectral_distribution = element
17831787

17841788
# Writing spectral data.
1785-
for (wavelength, value) in tstack([self.wavelengths, self.values]):
1789+
for wavelength, value in tstack([self.wavelengths, self.values]):
17861790
element_child = ElementTree.SubElement(
17871791
spectral_distribution, mapping.data.element
17881792
)

colour/recovery/jiang2013.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ def PCA_Jiang2013(
5959
msds_camera_sensitivities: Mapping[str, MultiSpectralDistributions],
6060
eigen_w_v_count: int | None = None,
6161
additional_data: bool = False,
62-
) -> Tuple[
63-
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
64-
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
65-
] | Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat]:
62+
) -> (
63+
Tuple[
64+
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
65+
Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat],
66+
]
67+
| Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat]
68+
):
6669
"""
6770
Perform the *Principal Component Analysis* (PCA) on given camera *RGB*
6871
sensitivities.

colour/utilities/deprecation.py

-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ def __getattr__(self, attribute: str) -> Any:
360360

361361
if change is not None:
362362
if not isinstance(change, ObjectRemoved):
363-
364363
usage_warning(str(change))
365364

366365
return (
@@ -564,7 +563,6 @@ def handle_arguments_deprecation(changes: dict, **kwargs: Any) -> dict:
564563
continue
565564

566565
if not isinstance(change, ArgumentRemoved):
567-
568566
usage_warning(str(change))
569567

570568
if isinstance(change, ArgumentFutureRemove):

0 commit comments

Comments
 (0)