Skip to content

Commit 4afa18a

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

3 files changed

Lines changed: 86 additions & 73 deletions

File tree

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/utilities/common.py

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

276276
try:
277-
with gzip.open(filename) as gzip_file, open(
278-
extraction_path, "wb"
279-
) as output_file:
277+
with (
278+
gzip.open(filename) as gzip_file,
279+
open(extraction_path, "wb") as output_file,
280+
):
280281
shutil.copyfileobj(gzip_file, output_file)
281282
except Exception as error:
282283
print(error) # noqa: T201

0 commit comments

Comments
 (0)