Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #33

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -15,7 +15,7 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ["--ignore-words-list=exitance,seperately"]
Expand All @@ -30,17 +30,17 @@ repos:
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.14"
rev: "v0.7.4"
hooks:
- id: ruff-format
- id: ruff
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
rev: 1.19.1
hooks:
- id: blacken-docs
language_version: python3.10
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down
136 changes: 74 additions & 62 deletions colour_datasets/loaders/dyer2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions colour_datasets/loaders/ebner1998.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_asano2015.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.asano2015` module."""


import numpy as np
from colour import SpectralShape
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_dyer2017.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.dyer2017` module."""


import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_hung1995.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.hung1995` module."""


import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_jakob2019.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.jakob2019` module."""


from colour_datasets.loaders import DatasetLoader_Jakob2019, build_Jakob2019

__author__ = "Colour Developers"
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_jiang2013.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.jiang2013` module."""


from colour import SpectralShape

from colour_datasets.loaders import DatasetLoader_Jiang2013, build_Jiang2013
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_karge2015.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.karge2015` module."""


from colour import SpectralShape

from colour_datasets.loaders import DatasetLoader_Karge2015, build_Karge2015
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_labsphere2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module.
"""


from colour import SpectralShape

from colour_datasets.loaders import (
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_luo1997.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.luo1997` module."""


import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_luo1999.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.luo1999` module."""


import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_solomotav2023.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.solomotav2023` module."""


from colour import SpectralShape

from colour_datasets.loaders import (
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_winquist2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module.
"""


import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS

Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_xrite2016.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.xrite2016` module."""


from colour.characterisation import ColourChecker

from colour_datasets.loaders import DatasetLoader_XRite2016, build_XRite2016
Expand Down
1 change: 0 additions & 1 deletion colour_datasets/loaders/tests/test_zhao2009.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define the unit tests for the :mod:`colour_datasets.loaders.zhao2009` module."""


from colour import SpectralShape

from colour_datasets.loaders import DatasetLoader_Zhao2009, build_Zhao2009
Expand Down
7 changes: 4 additions & 3 deletions colour_datasets/utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,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
Expand Down
Loading