diff --git a/colour_datasets/loaders/dyer2017.py b/colour_datasets/loaders/dyer2017.py index bb5be94..33f2535 100644 --- a/colour_datasets/loaders/dyer2017.py +++ b/colour_datasets/loaders/dyer2017.py @@ -564,39 +564,45 @@ def __init__( self.path = path self._header: SpectralDataHeader_AMPAS = SpectralDataHeader_AMPAS() self.header = optional(header, self._header) - self._units: Literal[ - "absorptance", - "exitance", - "flux", - "intensity", - "irradiance", - "radiance", - "reflectance", - "relative", - "transmittance", - "R-Factor", - "T-Factor", - "other", - ] | None = None + self._units: ( + Literal[ + "absorptance", + "exitance", + "flux", + "intensity", + "irradiance", + "radiance", + "reflectance", + "relative", + "transmittance", + "R-Factor", + "T-Factor", + "other", + ] + | None + ) = None self.units = units - self._reflection_geometry: 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 = None + self._reflection_geometry: ( + 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 + ) = None self.reflection_geometry = reflection_geometry - self._transmission_geometry: Literal[ - "0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other" - ] | None = None + self._transmission_geometry: ( + Literal["0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"] | None + ) = None self.transmission_geometry = transmission_geometry self._bandwidth_FWHM: float | None = None self.bandwidth_FWHM = bandwidth_FWHM @@ -1062,39 +1068,45 @@ def __init__( self.path = path self._header: SpectralDataHeader_AMPAS = SpectralDataHeader_AMPAS() self.header = optional(header, self._header) - self._units: Literal[ - "absorptance", - "exitance", - "flux", - "intensity", - "irradiance", - "radiance", - "reflectance", - "relative", - "transmittance", - "R-Factor", - "T-Factor", - "other", - ] | None = None + self._units: ( + Literal[ + "absorptance", + "exitance", + "flux", + "intensity", + "irradiance", + "radiance", + "reflectance", + "relative", + "transmittance", + "R-Factor", + "T-Factor", + "other", + ] + | None + ) = None self.units = units - self._reflection_geometry: 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 = None + self._reflection_geometry: ( + 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 + ) = None self.reflection_geometry = reflection_geometry - self._transmission_geometry: Literal[ - "0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other" - ] | None = None + self._transmission_geometry: ( + Literal["0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"] | None + ) = None self.transmission_geometry = transmission_geometry self._bandwidth_FWHM: float | None = None self.bandwidth_FWHM = bandwidth_FWHM diff --git a/colour_datasets/loaders/ebner1998.py b/colour_datasets/loaders/ebner1998.py index 025bd4e..de3ebd4 100644 --- a/colour_datasets/loaders/ebner1998.py +++ b/colour_datasets/loaders/ebner1998.py @@ -148,14 +148,14 @@ def _parse_float_values(data: str) -> NDArrayFloat: attribute, value = line.split("\t", 1) hue, data = int(attribute), _parse_float_values(value) - self._content["Constant Perceived-Hue Data"][ - hue - ] = ConstantPerceivedHueColourMatches_Ebner1998( - f"Reference Hue Angle - {hue}", - XYZ_r, - data[0], - data[1:], - {"h": hue}, + self._content["Constant Perceived-Hue Data"][hue] = ( + ConstantPerceivedHueColourMatches_Ebner1998( + f"Reference Hue Angle - {hue}", + XYZ_r, + data[0], + data[1:], + {"h": hue}, + ) ) return self._content diff --git a/colour_datasets/utilities/common.py b/colour_datasets/utilities/common.py index fc97fc8..92d8dc4 100644 --- a/colour_datasets/utilities/common.py +++ b/colour_datasets/utilities/common.py @@ -274,9 +274,10 @@ def unpack_gzipfile( os.makedirs(extraction_directory) try: - with gzip.open(filename) as gzip_file, open( - extraction_path, "wb" - ) as output_file: + with ( + gzip.open(filename) as gzip_file, + open(extraction_path, "wb") as output_file, + ): shutil.copyfileobj(gzip_file, output_file) except Exception as error: print(error) # noqa: T201