Skip to content

Commit 2100d72

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3b59648 commit 2100d72

16 files changed

+86
-86
lines changed

colour_datasets/loaders/dyer2017.py

Lines changed: 74 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -564,39 +564,45 @@ def __init__(
564564
self.path = path
565565
self._header: SpectralDataHeader_AMPAS = SpectralDataHeader_AMPAS()
566566
self.header = optional(header, self._header)
567-
self._units: Literal[
568-
"absorptance",
569-
"exitance",
570-
"flux",
571-
"intensity",
572-
"irradiance",
573-
"radiance",
574-
"reflectance",
575-
"relative",
576-
"transmittance",
577-
"R-Factor",
578-
"T-Factor",
579-
"other",
580-
] | None = None
567+
self._units: (
568+
Literal[
569+
"absorptance",
570+
"exitance",
571+
"flux",
572+
"intensity",
573+
"irradiance",
574+
"radiance",
575+
"reflectance",
576+
"relative",
577+
"transmittance",
578+
"R-Factor",
579+
"T-Factor",
580+
"other",
581+
]
582+
| None
583+
) = None
581584
self.units = units
582-
self._reflection_geometry: Literal[
583-
"di:8",
584-
"de:8",
585-
"8:di",
586-
"8:de",
587-
"d:d",
588-
"d:0",
589-
"45a:0",
590-
"45c:0",
591-
"0:45a",
592-
"45x:0",
593-
"0:45x",
594-
"other",
595-
] | None = None
585+
self._reflection_geometry: (
586+
Literal[
587+
"di:8",
588+
"de:8",
589+
"8:di",
590+
"8:de",
591+
"d:d",
592+
"d:0",
593+
"45a:0",
594+
"45c:0",
595+
"0:45a",
596+
"45x:0",
597+
"0:45x",
598+
"other",
599+
]
600+
| None
601+
) = None
596602
self.reflection_geometry = reflection_geometry
597-
self._transmission_geometry: Literal[
598-
"0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"
599-
] | None = None
603+
self._transmission_geometry: (
604+
Literal["0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"] | None
605+
) = None
600606
self.transmission_geometry = transmission_geometry
601607
self._bandwidth_FWHM: float | None = None
602608
self.bandwidth_FWHM = bandwidth_FWHM
@@ -1062,39 +1068,45 @@ def __init__(
10621068
self.path = path
10631069
self._header: SpectralDataHeader_AMPAS = SpectralDataHeader_AMPAS()
10641070
self.header = optional(header, self._header)
1065-
self._units: Literal[
1066-
"absorptance",
1067-
"exitance",
1068-
"flux",
1069-
"intensity",
1070-
"irradiance",
1071-
"radiance",
1072-
"reflectance",
1073-
"relative",
1074-
"transmittance",
1075-
"R-Factor",
1076-
"T-Factor",
1077-
"other",
1078-
] | None = None
1071+
self._units: (
1072+
Literal[
1073+
"absorptance",
1074+
"exitance",
1075+
"flux",
1076+
"intensity",
1077+
"irradiance",
1078+
"radiance",
1079+
"reflectance",
1080+
"relative",
1081+
"transmittance",
1082+
"R-Factor",
1083+
"T-Factor",
1084+
"other",
1085+
]
1086+
| None
1087+
) = None
10791088
self.units = units
1080-
self._reflection_geometry: Literal[
1081-
"di:8",
1082-
"de:8",
1083-
"8:di",
1084-
"8:de",
1085-
"d:d",
1086-
"d:0",
1087-
"45a:0",
1088-
"45c:0",
1089-
"0:45a",
1090-
"45x:0",
1091-
"0:45x",
1092-
"other",
1093-
] | None = None
1089+
self._reflection_geometry: (
1090+
Literal[
1091+
"di:8",
1092+
"de:8",
1093+
"8:di",
1094+
"8:de",
1095+
"d:d",
1096+
"d:0",
1097+
"45a:0",
1098+
"45c:0",
1099+
"0:45a",
1100+
"45x:0",
1101+
"0:45x",
1102+
"other",
1103+
]
1104+
| None
1105+
) = None
10941106
self.reflection_geometry = reflection_geometry
1095-
self._transmission_geometry: Literal[
1096-
"0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"
1097-
] | None = None
1107+
self._transmission_geometry: (
1108+
Literal["0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"] | None
1109+
) = None
10981110
self.transmission_geometry = transmission_geometry
10991111
self._bandwidth_FWHM: float | None = None
11001112
self.bandwidth_FWHM = bandwidth_FWHM

colour_datasets/loaders/ebner1998.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ def _parse_float_values(data: str) -> NDArrayFloat:
148148
attribute, value = line.split("\t", 1)
149149
hue, data = int(attribute), _parse_float_values(value)
150150

151-
self._content["Constant Perceived-Hue Data"][
152-
hue
153-
] = ConstantPerceivedHueColourMatches_Ebner1998(
154-
f"Reference Hue Angle - {hue}",
155-
XYZ_r,
156-
data[0],
157-
data[1:],
158-
{"h": hue},
151+
self._content["Constant Perceived-Hue Data"][hue] = (
152+
ConstantPerceivedHueColourMatches_Ebner1998(
153+
f"Reference Hue Angle - {hue}",
154+
XYZ_r,
155+
data[0],
156+
data[1:],
157+
{"h": hue},
158+
)
159159
)
160160

161161
return self._content

colour_datasets/loaders/tests/test_asano2015.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.asano2015` module."""
22

3-
43
import numpy as np
54
from colour import SpectralShape
65
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

colour_datasets/loaders/tests/test_dyer2017.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.dyer2017` module."""
22

3-
43
import numpy as np
54
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
65

colour_datasets/loaders/tests/test_hung1995.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.hung1995` module."""
22

3-
43
import numpy as np
54
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
65

colour_datasets/loaders/tests/test_jakob2019.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.jakob2019` module."""
22

3-
43
from colour_datasets.loaders import DatasetLoader_Jakob2019, build_Jakob2019
54

65
__author__ = "Colour Developers"

colour_datasets/loaders/tests/test_jiang2013.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.jiang2013` module."""
22

3-
43
from colour import SpectralShape
54

65
from colour_datasets.loaders import DatasetLoader_Jiang2013, build_Jiang2013

colour_datasets/loaders/tests/test_karge2015.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.karge2015` module."""
22

3-
43
from colour import SpectralShape
54

65
from colour_datasets.loaders import DatasetLoader_Karge2015, build_Karge2015

colour_datasets/loaders/tests/test_labsphere2019.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module.
44
"""
55

6-
76
from colour import SpectralShape
87

98
from colour_datasets.loaders import (

colour_datasets/loaders/tests/test_luo1997.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.luo1997` module."""
22

3-
43
import numpy as np
54
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
65

colour_datasets/loaders/tests/test_luo1999.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.luo1999` module."""
22

3-
43
import numpy as np
54
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
65

colour_datasets/loaders/tests/test_solomotav2023.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.solomotav2023` module."""
22

3-
43
from colour import SpectralShape
54

65
from colour_datasets.loaders import (

colour_datasets/loaders/tests/test_winquist2022.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module.
44
"""
55

6-
76
import numpy as np
87
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
98

colour_datasets/loaders/tests/test_xrite2016.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.xrite2016` module."""
22

3-
43
from colour.characterisation import ColourChecker
54

65
from colour_datasets.loaders import DatasetLoader_XRite2016, build_XRite2016

colour_datasets/loaders/tests/test_zhao2009.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Define the unit tests for the :mod:`colour_datasets.loaders.zhao2009` module."""
22

3-
43
from colour import SpectralShape
54

65
from colour_datasets.loaders import DatasetLoader_Zhao2009, build_Zhao2009

colour_datasets/utilities/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,10 @@ def unpack_gzipfile(
280280
os.makedirs(extraction_directory)
281281

282282
try:
283-
with gzip.open(filename) as gzip_file, open(
284-
extraction_path, "wb"
285-
) as output_file:
283+
with (
284+
gzip.open(filename) as gzip_file,
285+
open(extraction_path, "wb") as output_file,
286+
):
286287
shutil.copyfileobj(gzip_file, output_file)
287288
except Exception as error:
288289
print(error) # noqa: T201

0 commit comments

Comments
 (0)