diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 06d9ed0..c52759f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,7 +1,7 @@ name: Bug Report description: Report an issue or a bug. title: "[BUG]: << Please use a comprehensive title... >>" -labels: [ Defect ] +labels: [Defect] body: - type: markdown diff --git a/.github/ISSUE_TEMPLATE/documentation-improvement.yml b/.github/ISSUE_TEMPLATE/documentation-improvement.yml index 624ec52..e82080f 100644 --- a/.github/ISSUE_TEMPLATE/documentation-improvement.yml +++ b/.github/ISSUE_TEMPLATE/documentation-improvement.yml @@ -1,7 +1,7 @@ name: Documentation Improvement description: Report a documentation improvement. title: "[DOCUMENTATION]: << Please use a comprehensive title... >>" -labels: [ Documentation ] +labels: [Documentation] body: - type: markdown diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 6ae5acf..49a8dee 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,7 +1,7 @@ name: Feature Request description: Suggest a new feature to implement. title: "[FEATURE]: << Please use a comprehensive title... >>" -labels: [ Feature ] +labels: [Feature] body: - type: markdown diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index fbadf9d..79ad3c6 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -1,7 +1,7 @@ name: Question description: Ask a question. title: "[DISCUSSION]: << Please use a comprehensive title... >>" -labels: [ Discussion ] +labels: [Discussion] body: - type: markdown diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index e1cb43c..6fbdda2 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -8,41 +8,41 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - python-version: [3.11] + python-version: [3.12] fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 - - name: Environment Variables - run: | - echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV - echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV - echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV - echo "MPLBACKEND=AGG" >> $GITHUB_ENV - echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV - shell: bash - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get --yes install latexmk texlive-full - - name: Install Poetry - env: - POETRY_VERSION: 1.4.0 - run: | - curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - shell: bash - - name: Install Package Dependencies - run: | - poetry run python -m pip install --upgrade pip - poetry install - poetry run python -c "import imageio;imageio.plugins.freeimage.download()" - shell: bash - - name: Build Documentation - run: | - poetry run invoke docs - shell: bash + - uses: actions/checkout@v1 + - name: Environment Variables + run: | + echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV + echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV + echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV + echo "MPLBACKEND=AGG" >> $GITHUB_ENV + echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV + shell: bash + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get --yes install latexmk texlive-full + - name: Install Poetry + env: + POETRY_VERSION: 1.4.0 + run: | + curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - + echo "$HOME/.poetry/bin" >> $GITHUB_PATH + shell: bash + - name: Install Package Dependencies + run: | + poetry run python -m pip install --upgrade pip + poetry install + poetry run python -c "import imageio;imageio.plugins.freeimage.download()" + shell: bash + - name: Build Documentation + run: | + poetry run invoke docs + shell: bash diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index 0954c4b..580ee23 100644 --- a/.github/workflows/continuous-integration-quality-unit-tests.yml +++ b/.github/workflows/continuous-integration-quality-unit-tests.yml @@ -8,89 +8,89 @@ jobs: strategy: matrix: os: [macOS-latest, ubuntu-22.04, windows-latest] - python-version: [3.9, '3.10', 3.11] + python-version: [3.9, "3.10", 3.11, 3.12] fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 - with: - submodules: true - - name: Environment Variables - run: | - echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV - echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV - echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV - echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV - echo "MPLBACKEND=AGG" >> $GITHUB_ENV - shell: bash - - name: Set up Python 3.9 for Pre-Commit - uses: actions/setup-python@v1 - with: - python-version: 3.9 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Dependencies (macOS) - if: matrix.os == 'macOS-latest' - run: | - brew install dcraw exiftool - brew install --cask adobe-dng-converter - shell: bash - - name: Install Dependencies (Ubuntu) - if: matrix.os == 'ubuntu-22.04' - run: | - sudo apt-get update - sudo apt-get --yes install dcraw exiftool - shell: bash - - name: Install Dependencies (Windows) - if: matrix.os == 'windows-latest' - run: | - curl -L https://exiftool.org/exiftool-12.51.zip -o exiftool-12.51.zip - unzip -d exiftool exiftool-12.51.zip - cp exiftool/exiftool\(-k\).exe exiftool/exiftool.exe - echo "$PWD/exiftool" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH - curl -L https://cdn.fastpictureviewer.com/bin/dcraw.zip?v=201605100 -o dcraw.zip - unzip -d dcraw dcraw.zip - echo "$PWD/dcraw" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH - shell: bash - - name: Install Adobe DNG Converter (Windows) - if: matrix.os == 'windows-latest' - run: | - curl -L https://download.adobe.com/pub/adobe/dng/win/DNGConverter_11_4.exe -o DNGConverter_11_4.exe - DNGConverter_11_4.exe /S - shell: cmd - - name: Add Adobe DNG Converter to %PATH% (Windows) - if: matrix.os == 'windows-latest' - run: | - echo "C:\Program Files\Adobe\Adobe DNG Converter" >> $GITHUB_PATH - shell: bash - - name: Install Poetry - env: - POETRY_VERSION: 1.4.0 - run: | - curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - shell: bash - - name: Install Package Dependencies - run: | - poetry run python -m pip install --upgrade pip - poetry install - poetry run python -c "import imageio;imageio.plugins.freeimage.download()" - shell: bash - - name: Pre-Commit (All Files) - run: | - poetry run pre-commit run --all-files - shell: bash - - name: Test Optimised Python Execution - run: | - poetry run python -OO -c "import $CI_PACKAGE" - shell: bash - - name: Test with Pytest - run: | - poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE - shell: bash - - name: Upload Coverage to coveralls.io - run: | - if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi - shell: bash + - uses: actions/checkout@v1 + with: + submodules: true + - name: Environment Variables + run: | + echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV + echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV + echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV + echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV + echo "MPLBACKEND=AGG" >> $GITHUB_ENV + shell: bash + - name: Set up Python 3.9 for Pre-Commit + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies (macOS) + if: matrix.os == 'macOS-latest' + run: | + brew install dcraw exiftool + brew install --cask adobe-dng-converter + shell: bash + - name: Install Dependencies (Ubuntu) + if: matrix.os == 'ubuntu-22.04' + run: | + sudo apt-get update + sudo apt-get --yes install dcraw exiftool + shell: bash + - name: Install Dependencies (Windows) + if: matrix.os == 'windows-latest' + run: | + curl -L https://exiftool.org/exiftool-12.51.zip -o exiftool-12.51.zip + unzip -d exiftool exiftool-12.51.zip + cp exiftool/exiftool\(-k\).exe exiftool/exiftool.exe + echo "$PWD/exiftool" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH + curl -L https://cdn.fastpictureviewer.com/bin/dcraw.zip?v=201605100 -o dcraw.zip + unzip -d dcraw dcraw.zip + echo "$PWD/dcraw" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH + shell: bash + - name: Install Adobe DNG Converter (Windows) + if: matrix.os == 'windows-latest' + run: | + curl -L https://download.adobe.com/pub/adobe/dng/win/DNGConverter_11_4.exe -o DNGConverter_11_4.exe + DNGConverter_11_4.exe /S + shell: cmd + - name: Add Adobe DNG Converter to %PATH% (Windows) + if: matrix.os == 'windows-latest' + run: | + echo "C:\Program Files\Adobe\Adobe DNG Converter" >> $GITHUB_PATH + shell: bash + - name: Install Poetry + env: + POETRY_VERSION: 1.4.0 + run: | + curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - + echo "$HOME/.poetry/bin" >> $GITHUB_PATH + shell: bash + - name: Install Package Dependencies + run: | + poetry run python -m pip install --upgrade pip + poetry install + poetry run python -c "import imageio;imageio.plugins.freeimage.download()" + shell: bash + - name: Pre-Commit (All Files) + run: | + poetry run pre-commit run --all-files + shell: bash + - name: Test Optimised Python Execution + run: | + poetry run python -OO -c "import $CI_PACKAGE" + shell: bash + - name: Test with Pytest + run: | + poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE + shell: bash + - name: Upload Coverage to coveralls.io + run: | + if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi + shell: bash diff --git a/.github/workflows/continuous-integration-static-type-checking.yml b/.github/workflows/continuous-integration-static-type-checking.yml index 6a7da84..1df15e0 100644 --- a/.github/workflows/continuous-integration-static-type-checking.yml +++ b/.github/workflows/continuous-integration-static-type-checking.yml @@ -8,22 +8,22 @@ jobs: strategy: matrix: os: [macOS-latest] - python-version: [3.11] + python-version: [3.12] fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 - - name: Environment Variables - run: | - echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV - shell: bash - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Package Dependencies - run: | - pip install -r requirements.txt - - name: Static Type Checking - run: | - pyright --skipunannotated + - uses: actions/checkout@v1 + - name: Environment Variables + run: | + echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV + shell: bash + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Package Dependencies + run: | + pip install -r requirements.txt + - name: Static Type Checking + run: | + pyright --skipunannotated diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b527df6..054a788 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,55 @@ repos: -- repo: https://github.com/ikamensh/flynt/ - rev: '1.0.1' + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.5.0" hooks: - - id: flynt -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.285' + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + - id: name-tests-test + args: ["--pytest-test-first"] + - id: requirements-txt-fixer + - id: trailing-whitespace + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 hooks: - - id: ruff -- repo: https://github.com/psf/black - rev: 23.7.0 + - id: codespell + exclude: "BIBLIOGRAPHY.bib|CONTRIBUTORS.rst|.*.ipynb" + - repo: https://github.com/ikamensh/flynt + rev: "1.0.1" hooks: - - id: black - language_version: python3.9 -- repo: https://github.com/keewis/blackdoc - rev: v0.3.8 + - id: flynt + args: [--verbose] + - repo: https://github.com/PyCQA/isort + rev: "5.12.0" hooks: - - id: blackdoc - language_version: python3.9 + - id: isort + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.1.6" + hooks: + - id: ruff + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.11.0 + hooks: + - id: black + language_version: python3.9 + - repo: https://github.com/adamchainz/blacken-docs + rev: 1.16.0 + hooks: + - id: blacken-docs + language_version: python3.9 + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.1.0" + hooks: + - id: prettier + exclude: config-aces-reference.ocio.yaml + - repo: https://github.com/pre-commit/pygrep-hooks + rev: "v1.10.0" + hooks: + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c93eb8a..47935c5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,7 +6,7 @@ build: python: "3.11" sphinx: - configuration: docs/conf.py + configuration: docs/conf.py formats: - htmlzip @@ -14,4 +14,4 @@ formats: python: install: - - requirements: docs/requirements.txt \ No newline at end of file + - requirements: docs/requirements.txt diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 67ab8e5..58ec1de 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -8,23 +8,22 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others’ private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others’ private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities - Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. @@ -35,7 +34,6 @@ This Code of Conduct applies within all project spaces, and it also applies when ## Enforcement - Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Thomas Mansencal and Michael Mauderer via email at thomas@colour-science.org and michael@colour-science.org respectively. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership. @@ -46,6 +44,5 @@ This Code of Conduct is adapted from the Contributor Covenant, version 1.4, avai For answers to common questions about this code of conduct, see [https://www.contributor-covenant.org/faq][faq]. - [homepage]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html -[faq]: https://www.contributor-covenant.org/faq \ No newline at end of file +[faq]: https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 703f6ae..552cb2e 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -7,7 +7,7 @@ Development & Technical Support - **Thomas Mansencal**, *Technology Supervisor @ Wētā FX* Project coordination, overall development. - + About ----- diff --git a/TODO.rst b/TODO.rst index f461742..3be677f 100644 --- a/TODO.rst +++ b/TODO.rst @@ -6,17 +6,17 @@ TODO - colour_hdri/__init__.py - - Line 291 : # TODO: Remove legacy printing support when deemed appropriate. + - Line 287 : # TODO: Remove legacy printing support when deemed appropriate. - colour_hdri/tonemapping/global_operators/operators.py - - Line 585 : # TODO: Implement automatic *p* and *non-uniform* computations support. + - Line 584 : # TODO: Implement automatic *p* and *non-uniform* computations support. - colour_hdri/utilities/exif.py - - Line 319 : # TODO: Find a better name. + - Line 318 : # TODO: Find a better name. - colour_hdri/utilities/image.py diff --git a/colour_hdri/__init__.py b/colour_hdri/__init__.py index 85452a6..5d03f31 100644 --- a/colour_hdri/__init__.py +++ b/colour_hdri/__init__.py @@ -24,52 +24,30 @@ from __future__ import annotations import contextlib -import sys - -from colour.utilities.deprecation import ModuleAPI, build_API_changes -from colour.utilities.documentation import is_documentation_building - -from colour.hints import Any - -import numpy as np import os import subprocess +import sys import colour +import numpy as np +from colour.hints import Any +from colour.utilities import is_matplotlib_installed +from colour.utilities.deprecation import ModuleAPI, build_API_changes +from colour.utilities.documentation import is_documentation_building -from .utilities import ( - EXIF_EXECUTABLE, - EXIFTag, - Image, - ImageStack, - Metadata, - copy_exif_tags, - delete_exif_tags, - filter_files, - parse_exif_array, - parse_exif_data, - parse_exif_fraction, - parse_exif_number, - parse_exif_string, - path_exists, - read_exif_tag, - read_exif_tags, - update_exif_tags, - vivification, - vivified_to_dict, - write_exif_tag, +from .calibration import ( + absolute_luminance_calibration_Lagarde2016, + camera_response_functions_Debevec1997, + g_solve, + upper_hemisphere_illuminance_weights_Lagarde2016, ) from .distortion import ( - DataVignetteCharacterisation, VIGNETTE_CHARACTERISATION_METHODS, - characterise_vignette, VIGNETTE_CORRECTION_METHODS, + DataVignetteCharacterisation, + characterise_vignette, correct_vignette, ) -from .sampling import ( - light_probe_sampling_variance_minimization_Viriyothai2009, - samples_Grossberg2003, -) from .exposure import ( adjust_exposure, arithmetic_mean_focal_plane_exposure, @@ -77,23 +55,17 @@ average_luminance, exposure_index_values, exposure_value_100, - photometric_exposure_scale_factor_Lagarde2014, focal_plane_exposure, illuminance_to_exposure_value, luminance_to_exposure_value, + photometric_exposure_scale_factor_Lagarde2014, saturation_based_speed_focal_plane_exposure, ) from .generation import ( - normal_distribution_function, hat_function, - weighting_function_Debevec1997, image_stack_to_HDRI, -) -from .calibration import ( - absolute_luminance_calibration_Lagarde2016, - camera_response_functions_Debevec1997, - g_solve, - upper_hemisphere_illuminance_weights_Lagarde2016, + normal_distribution_function, + weighting_function_Debevec1997, ) from .models import ( camera_neutral_to_xy, @@ -115,6 +87,10 @@ read_dng_files_exif_tags, ) from .recovery import highlights_recovery_blend, highlights_recovery_LCHab +from .sampling import ( + light_probe_sampling_variance_minimization_Viriyothai2009, + samples_Grossberg2003, +) from .tonemapping import ( tonemapping_operator_exponential, tonemapping_operator_exponentiation_mapping, @@ -128,8 +104,28 @@ tonemapping_operator_simple, tonemapping_operator_Tumblin1999, ) - -from colour.utilities import is_matplotlib_installed +from .utilities import ( + EXIF_EXECUTABLE, + EXIFTag, + Image, + ImageStack, + Metadata, + copy_exif_tags, + delete_exif_tags, + filter_files, + parse_exif_array, + parse_exif_data, + parse_exif_fraction, + parse_exif_number, + parse_exif_string, + path_exists, + read_exif_tag, + read_exif_tags, + update_exif_tags, + vivification, + vivified_to_dict, + write_exif_tag, +) # Exposing "colour.plotting" sub-package if "Matplotlib" is available. if is_matplotlib_installed(): @@ -264,7 +260,7 @@ def __getattr__(self, attribute) -> Any: __major_version__ = "0" __minor_version__ = "2" -__change_version__ = "2" +__change_version__ = "3" __version__ = ".".join( (__major_version__, __minor_version__, __change_version__) ) @@ -272,7 +268,7 @@ def __getattr__(self, attribute) -> Any: try: _version: str = ( subprocess.check_output( - ["git", "describe"], # noqa: S603,S607 + ["git", "describe"], # noqa: S603, S607 cwd=os.path.dirname(__file__), stderr=subprocess.STDOUT, ) diff --git a/colour_hdri/calibration/absolute_luminance.py b/colour_hdri/calibration/absolute_luminance.py index d2b770e..5281a57 100644 --- a/colour_hdri/calibration/absolute_luminance.py +++ b/colour_hdri/calibration/absolute_luminance.py @@ -20,7 +20,6 @@ from __future__ import annotations import numpy as np - from colour import RGB_COLOURSPACES, RGB_Colourspace, RGB_luminance from colour.hints import ArrayLike, NDArrayFloat from colour.utilities import as_float_array diff --git a/colour_hdri/calibration/debevec1997.py b/colour_hdri/calibration/debevec1997.py index a05d70e..abfe8f8 100644 --- a/colour_hdri/calibration/debevec1997.py +++ b/colour_hdri/calibration/debevec1997.py @@ -23,9 +23,9 @@ from __future__ import annotations -import numpy as np from functools import partial +import numpy as np from colour.hints import ( Any, ArrayLike, diff --git a/colour_hdri/calibration/tests/test_absolute_luminance.py b/colour_hdri/calibration/tests/test_absolute_luminance.py index 5a711ae..e0e53a3 100644 --- a/colour_hdri/calibration/tests/test_absolute_luminance.py +++ b/colour_hdri/calibration/tests/test_absolute_luminance.py @@ -6,16 +6,17 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour_hdri import ROOT_RESOURCES_TESTS from colour_hdri.calibration import ( - upper_hemisphere_illuminance_weights_Lagarde2016, absolute_luminance_calibration_Lagarde2016, + upper_hemisphere_illuminance_weights_Lagarde2016, ) from colour_hdri.calibration.absolute_luminance import ( upper_hemisphere_illuminance_Lagarde2016, @@ -53,26 +54,26 @@ def test_upper_hemisphere_illuminance_Lagarde2016(self): upper_hemisphere_illuminance_Lagarde2016` definition. """ - self.assertAlmostEqual( + np.testing.assert_allclose( upper_hemisphere_illuminance_Lagarde2016(np.ones((16, 32, 3))), 2.934469165342606, - places=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - self.assertAlmostEqual( + np.testing.assert_allclose( upper_hemisphere_illuminance_Lagarde2016( np.ones((16, 32, 3)) * 10 ), 29.344691653426061, - places=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - self.assertAlmostEqual( + np.testing.assert_allclose( upper_hemisphere_illuminance_Lagarde2016( np.ones((16, 32, 3)) * 0.1 ), 0.293446916534261, - places=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -126,10 +127,10 @@ def test_upper_hemisphere_illuminance_weights_Lagarde2016(self): ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( upper_hemisphere_illuminance_weights_Lagarde2016(32, 16), np.tile(weights, (1, 16)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/calibration/tests/test_debevec1997.py b/colour_hdri/calibration/tests/test_debevec1997.py index 2a36c7b..be1cf98 100644 --- a/colour_hdri/calibration/tests/test_debevec1997.py +++ b/colour_hdri/calibration/tests/test_debevec1997.py @@ -6,16 +6,16 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np from colour.hints import List from colour_hdri import ROOT_RESOURCES_TESTS from colour_hdri.calibration import ( - g_solve, camera_response_functions_Debevec1997, + g_solve, ) from colour_hdri.exposure import average_luminance from colour_hdri.sampling import samples_Grossberg2003 @@ -78,7 +78,6 @@ def test_g_solve(self): ROOT_RESOURCES_CALIBRATION, f"test_g_solve_g_{i}.npy" ) ), - rtol=0.001, atol=0.001, ) @@ -90,7 +89,6 @@ def test_g_solve(self): ROOT_RESOURCES_CALIBRATION, f"test_g_solve_lE_{i}.npy" ) ), - rtol=0.001, atol=0.001, ) @@ -118,7 +116,6 @@ def test_camera_response_function_Debevec1997(self): "test_camera_response_function_Debevec1997_crfs.npy", ) ), - rtol=0.00001, atol=0.00001, ) diff --git a/colour_hdri/distortion/tests/test_vignette.py b/colour_hdri/distortion/tests/test_vignette.py index d588f7b..32fea8c 100644 --- a/colour_hdri/distortion/tests/test_vignette.py +++ b/colour_hdri/distortion/tests/test_vignette.py @@ -5,25 +5,27 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri import ROOT_RESOURCES_TESTS from colour_hdri.distortion import ( apply_radial_gradient, - parabolic_2D_function, - hyperbolic_cosine_2D_function, characterise_vignette_2D_function, - correct_vignette_2D_function, characterise_vignette_bivariate_spline, - correct_vignette_bivariate_spline, characterise_vignette_RBF, + correct_vignette_2D_function, + correct_vignette_bivariate_spline, correct_vignette_RBF, + hyperbolic_cosine_2D_function, + parabolic_2D_function, ) from colour_hdri.distortion.vignette import ( - vignette_principal_point, radial_sampling_function, + vignette_principal_point, vignette_sampling_coordinates, ) @@ -65,7 +67,7 @@ def test_apply_radial_gradient(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( apply_radial_gradient(np.ones([5, 7])), np.array( [ @@ -116,7 +118,7 @@ def test_apply_radial_gradient(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -133,7 +135,7 @@ def test_parabolic_2D_function(self): """ x_1, y_1 = np.meshgrid(np.linspace(0, 1, 5), np.linspace(0, 1, 7)) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( parabolic_2D_function((x_1, y_1), -0.5, 0, 1, -0.5, 0, 1), np.array( [ @@ -188,7 +190,7 @@ def test_parabolic_2D_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -205,7 +207,7 @@ def test_hyperbolic_cosine_2D_function(self): """ x_1, y_1 = np.meshgrid(np.linspace(0, 1, 5), np.linspace(0, 1, 7)) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( hyperbolic_cosine_2D_function((x_1, y_1), 1, -0.5, 1, -0.5, 1), np.array( [ @@ -260,7 +262,7 @@ def test_hyperbolic_cosine_2D_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -276,12 +278,12 @@ def test_vignette_principal_point(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( vignette_principal_point( apply_radial_gradient(np.ones([50, 70, 3])) ), np.array([0.49000000, 0.49285714]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -300,7 +302,7 @@ def test_characterise_vignette_2D_function(self): parameters, principal_point = characterise_vignette_2D_function( apply_radial_gradient(np.ones([50, 70, 3])) ).values - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( parameters, np.array( [ @@ -330,19 +332,19 @@ def test_characterise_vignette_2D_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( principal_point, np.array([0.49000000, 0.49285714]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) parameters, principal_point = characterise_vignette_2D_function( apply_radial_gradient(np.ones([50, 70, 3])), function="Hyperbolic Cosine", ).values - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( parameters, np.array( [ @@ -369,12 +371,12 @@ def test_characterise_vignette_2D_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( principal_point, np.array([0.49000000, 0.49285714]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -393,7 +395,7 @@ def test_correct_vignette_2D_function(self): image = apply_radial_gradient(np.ones([5, 7])) characterisation_data = characterise_vignette_2D_function(image) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( correct_vignette_2D_function(image, characterisation_data), np.array( [ @@ -444,14 +446,14 @@ def test_correct_vignette_2D_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) characterisation_data = characterise_vignette_2D_function( image, function="Hyperbolic Cosine" ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( correct_vignette_2D_function( image, characterisation_data, function="Hyperbolic Cosine" ), @@ -504,7 +506,7 @@ def test_correct_vignette_2D_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -524,7 +526,7 @@ def test_characterise_vignette_bivariate_spline(self): apply_radial_gradient(np.ones([200, 300, 3])) ).values - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( parameters, np.load( os.path.join( @@ -532,12 +534,12 @@ def test_characterise_vignette_bivariate_spline(self): "test_characterise_vignette_bivariate_spline.npy", ) ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( principal_point, np.array([0.49750000, 0.49833333]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -556,7 +558,7 @@ def test_correct_vignette_bivariate_spline(self): image = apply_radial_gradient(np.ones([5, 7])) characterisation_data = characterise_vignette_bivariate_spline(image) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( correct_vignette_bivariate_spline(image, characterisation_data), np.array( [ @@ -607,7 +609,7 @@ def test_correct_vignette_bivariate_spline(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -623,7 +625,7 @@ def test_radial_sampling_function(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( radial_sampling_function(), np.array( [ @@ -818,7 +820,7 @@ def test_radial_sampling_function(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -834,7 +836,7 @@ def test_vignette_sampling_coordinates(self): vignette_sampling_coordinates` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( vignette_sampling_coordinates( principal_point=(0.55, 0.55), aspect_ratio=1.5 ), @@ -1005,7 +1007,7 @@ def test_vignette_sampling_coordinates(self): [0.05501353, 0.55007621], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -1025,7 +1027,7 @@ def test_characterise_vignette_RBF(self): apply_radial_gradient(np.ones([200, 300, 3])) ).values - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( parameters, np.array( [ @@ -1202,12 +1204,12 @@ def test_characterise_vignette_RBF(self): [0.39424641, 0.39424641, 0.39424641], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( principal_point, np.array([0.49750000, 0.49833333]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -1226,7 +1228,7 @@ def test_correct_vignette_RBF(self): image = apply_radial_gradient(np.ones([5, 7])) characterisation_data = characterise_vignette_RBF(image) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( correct_vignette_RBF(image, characterisation_data), np.array( [ @@ -1277,7 +1279,7 @@ def test_correct_vignette_RBF(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/distortion/vignette.py b/colour_hdri/distortion/vignette.py index d6b1537..07672d6 100644 --- a/colour_hdri/distortion/vignette.py +++ b/colour_hdri/distortion/vignette.py @@ -32,12 +32,9 @@ from __future__ import annotations -import numpy as np from dataclasses import dataclass -from scipy.interpolate import RBFInterpolator, RectBivariateSpline -from scipy.ndimage import center_of_mass, gaussian_filter -from scipy.optimize import curve_fit +import numpy as np from colour.algebra import ( LinearInterpolator, linear_conversion, @@ -62,6 +59,9 @@ validate_method, zeros, ) +from scipy.interpolate import RBFInterpolator, RectBivariateSpline +from scipy.ndimage import center_of_mass, gaussian_filter +from scipy.optimize import curve_fit __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers" @@ -111,7 +111,7 @@ def apply_radial_gradient( scale Radial gradient scale as a ratio of the image height. offset - Radial gradiant offset from the image center and as a ratio of image + Radial gradient offset from the image center and as a ratio of image dimensions. intensity Radial gradient intensity where a value of 1 produces black at the diff --git a/colour_hdri/exposure/common.py b/colour_hdri/exposure/common.py index 62508bb..2abfe1b 100644 --- a/colour_hdri/exposure/common.py +++ b/colour_hdri/exposure/common.py @@ -21,9 +21,7 @@ from __future__ import annotations import numpy as np - from colour.hints import ArrayLike, NDArrayFloat - from colour.utilities import as_float, as_float_array __author__ = "Colour Developers" diff --git a/colour_hdri/exposure/dsc.py b/colour_hdri/exposure/dsc.py index 6f6a101..04abd12 100644 --- a/colour_hdri/exposure/dsc.py +++ b/colour_hdri/exposure/dsc.py @@ -23,10 +23,9 @@ from __future__ import annotations import numpy as np - from colour.hints import ArrayLike, NDArrayFloat - from colour.utilities import as_float, as_float_array + from colour_hdri.exposure import ( average_luminance, luminance_to_exposure_value, diff --git a/colour_hdri/exposure/tests/test_common.py b/colour_hdri/exposure/tests/test_common.py index 1f3dba4..6ca6fc8 100644 --- a/colour_hdri/exposure/tests/test_common.py +++ b/colour_hdri/exposure/tests/test_common.py @@ -1,15 +1,17 @@ # !/usr/bin/env python """Define the unit tests for the :mod:`colour_hdri.exposure.common` module.""" -import numpy as np import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri.exposure import ( - average_luminance, + adjust_exposure, average_illuminance, - luminance_to_exposure_value, + average_luminance, illuminance_to_exposure_value, - adjust_exposure, + luminance_to_exposure_value, ) __author__ = "Colour Developers" @@ -36,14 +38,14 @@ class TestAverageLuminance(unittest.TestCase): def test_average_luminance(self): """Test :func:`colour_hdri.exposure.common.average_luminance` definition.""" - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( average_luminance( np.array([2.8, 5.6, 8]), np.array([0.125, 0.5, 1.0]), np.array([100, 800, 16000]), ), np.array([7.84000000, 0.98000000, 0.05000000]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -59,14 +61,14 @@ def test_average_illuminance(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( average_illuminance( np.array([2.8, 5.6, 8]), np.array([0.125, 0.5, 1.0]), np.array([100, 800, 16000]), ), np.array([156.80000000, 19.60000000, 1.00000000]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -82,14 +84,14 @@ def test_luminance_to_exposure_value(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( luminance_to_exposure_value( np.array([0.125, 0.250, 0.125]), np.array([100, 100, 100]), np.array([12.5, 12.5, 14]), ), np.array([0.00000000, 1.00000000, -0.16349873]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -105,14 +107,14 @@ def test_illuminance_to_exposure_value(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( illuminance_to_exposure_value( np.array([2.5, 5.0, 0.125]), np.array([100, 100, 100]), np.array([250, 250, 340]), ), np.array([0.00000000, 1.00000000, -4.76553475]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -125,10 +127,10 @@ class TestAdjustExposure(unittest.TestCase): def test_adjust_exposure(self): """Test :func:`colour_hdri.exposure.common.adjust_exposure` definition.""" - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( adjust_exposure(np.array([0.25, 0.5, 0.75, 1]), 1), np.array([0.5, 1.0, 1.5, 2.0]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/exposure/tests/test_dsc.py b/colour_hdri/exposure/tests/test_dsc.py index d8095f8..a124687 100644 --- a/colour_hdri/exposure/tests/test_dsc.py +++ b/colour_hdri/exposure/tests/test_dsc.py @@ -1,18 +1,20 @@ # !/usr/bin/env python """Define the unit tests for the :mod:`colour_hdri.exposure.dsc` module.""" -import numpy as np import unittest -from colour_hdri.exposure.dsc import q_factor +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri.exposure import ( - focal_plane_exposure, arithmetic_mean_focal_plane_exposure, - saturation_based_speed_focal_plane_exposure, exposure_index_values, exposure_value_100, + focal_plane_exposure, photometric_exposure_scale_factor_Lagarde2014, + saturation_based_speed_focal_plane_exposure, ) +from colour_hdri.exposure.dsc import q_factor __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers" @@ -41,14 +43,14 @@ class TestQFactor(unittest.TestCase): def test_q_factor(self): """Test :func:`colour_hdri.exposure.dsc.q_factor` definition.""" - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( q_factor( np.array([9 / 10, 8 / 10, 9 / 10]), np.array([98 / 100, 98 / 100, 94 / 100]), np.array([10, 10, 20]), ), np.array([0.65157483, 0.57917763, 0.51808797]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -61,7 +63,7 @@ class TestFocalPlaneExposure(unittest.TestCase): def test_focal_plane_exposure(self): """Test :func:`colour_hdri.exposure.dsc.focal_plane_exposure` definition.""" - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( focal_plane_exposure( np.array([4000, 2000, 1000]), np.array([8, 5.6, 2.8]), @@ -74,7 +76,7 @@ def test_focal_plane_exposure(self): 10, ), np.array([0.16439371, 0.08810904, 0.09310904]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -90,14 +92,14 @@ def test_arithmetic_mean_focal_plane_exposure(self): arithmetic_mean_focal_plane_exposure` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( arithmetic_mean_focal_plane_exposure( np.array([4000, 2000, 1000]), np.array([8, 5.6, 2.8]), np.array([1 / 250, 1 / 500, 1 / 1000]), ), np.array([0.16289371, 0.08310904, 0.08310904]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -113,7 +115,7 @@ def test_saturation_based_speed_focal_plane_exposure(self): saturation_based_speed_focal_plane_exposure` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( saturation_based_speed_focal_plane_exposure( np.array([4000, 2000, 1000]), np.array([8, 5.6, 2.8]), @@ -127,7 +129,7 @@ def test_saturation_based_speed_focal_plane_exposure(self): 10, ), np.array([0.21076116, 0.90368241, 1.90992892]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -143,12 +145,12 @@ def test_exposure_index_values(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( exposure_index_values( np.array([0.16439371, 0.08810904, 0.09310904]) ), np.array([60.82957797, 113.49573211, 107.40095699]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -164,14 +166,14 @@ def test_exposure_value_100(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( exposure_value_100( np.array([8, 5.6, 2.8]), np.array([1 / 250, 1 / 500, 1 / 1000]), np.array([100, 800, 1600]), ), np.array([13.96578428, 10.93663794, 8.93663794]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -188,7 +190,7 @@ def test_photometric_exposure_scale_factor_Lagarde2014(self): photometric_exposure_scale_factor_Lagarde2014` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( photometric_exposure_scale_factor_Lagarde2014( np.array([13.96578428, 10.93663794, 8.93663794]), np.array([9 / 10, 8 / 10, 9 / 10]), @@ -196,7 +198,7 @@ def test_photometric_exposure_scale_factor_Lagarde2014(self): np.array([10, 10, 20]), ), np.array([0.00005221, 0.00037884, 0.00135554]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/generation/hdri.py b/colour_hdri/generation/hdri.py index f5d0c50..8b1e809 100644 --- a/colour_hdri/generation/hdri.py +++ b/colour_hdri/generation/hdri.py @@ -23,9 +23,8 @@ from __future__ import annotations import numpy as np - -from colour.utilities import as_float_array, tsplit, tstack, warning from colour.hints import ArrayLike, Callable, NDArrayFloat +from colour.utilities import as_float_array, tsplit, tstack, warning from colour_hdri.exposure import average_luminance from colour_hdri.generation import weighting_function_Debevec1997 diff --git a/colour_hdri/generation/tests/test_hdri.py b/colour_hdri/generation/tests/test_hdri.py index 61addf4..4e6a951 100644 --- a/colour_hdri/generation/tests/test_hdri.py +++ b/colour_hdri/generation/tests/test_hdri.py @@ -3,16 +3,16 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np from colour import RGB_COLOURSPACES from colour.hints import List from colour_hdri import ROOT_RESOURCES_TESTS -from colour_hdri.generation import image_stack_to_HDRI from colour_hdri.calibration import camera_response_functions_Debevec1997 +from colour_hdri.generation import image_stack_to_HDRI from colour_hdri.utilities import ImageStack, filter_files __author__ = "Colour Developers" diff --git a/colour_hdri/generation/tests/test_weighting_functions.py b/colour_hdri/generation/tests/test_weighting_functions.py index 614f8b8..b150ad3 100644 --- a/colour_hdri/generation/tests/test_weighting_functions.py +++ b/colour_hdri/generation/tests/test_weighting_functions.py @@ -4,12 +4,14 @@ :mod:`colour_hdri.generation.weighting_functions` module. """ -import numpy as np import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri.generation import ( - normal_distribution_function, hat_function, + normal_distribution_function, weighting_function_Debevec1997, ) @@ -39,7 +41,7 @@ def test_normal_distribution_function(self): normal_distribution_function` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( normal_distribution_function(np.linspace(0, 1, 10)), np.array( [ @@ -55,10 +57,10 @@ def test_normal_distribution_function(self): 0.00386592, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( normal_distribution_function(np.linspace(0, 1, 10), 0, 1), np.array( [ @@ -74,10 +76,10 @@ def test_normal_distribution_function(self): 0.60653066, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( normal_distribution_function(np.linspace(0, 1, 10), 0.5, 0.5), np.array( [ @@ -93,7 +95,7 @@ def test_normal_distribution_function(self): 0.60653066, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -109,7 +111,7 @@ def test_hat_function(self): definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( hat_function(np.linspace(0, 1, 10)), np.array( [ @@ -125,7 +127,7 @@ def test_hat_function(self): 0.00000000, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -141,7 +143,7 @@ def test_weighting_function_Debevec1997(self): weighting_function_Debevec1997` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( weighting_function_Debevec1997(np.linspace(0, 1, 10)), np.array( [ @@ -157,10 +159,10 @@ def test_weighting_function_Debevec1997(self): 0.00000000, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( weighting_function_Debevec1997(np.linspace(0, 1, 10), 0, 1), np.array( [ @@ -176,10 +178,10 @@ def test_weighting_function_Debevec1997(self): 0.00000000, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( weighting_function_Debevec1997(np.linspace(0, 1, 10), 0.25, 0.75), np.array( [ @@ -195,7 +197,7 @@ def test_weighting_function_Debevec1997(self): 0.00000000, ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/generation/weighting_functions.py b/colour_hdri/generation/weighting_functions.py index ba35845..479e416 100644 --- a/colour_hdri/generation/weighting_functions.py +++ b/colour_hdri/generation/weighting_functions.py @@ -19,9 +19,7 @@ from __future__ import annotations import numpy as np - from colour.hints import ArrayLike, NDArrayFloat - from colour.utilities import as_float_array __author__ = "Colour Developers" diff --git a/colour_hdri/models/dng.py b/colour_hdri/models/dng.py index f741308..b1f62f4 100644 --- a/colour_hdri/models/dng.py +++ b/colour_hdri/models/dng.py @@ -111,7 +111,6 @@ from __future__ import annotations import numpy as np - from colour.adaptation import matrix_chromatic_adaptation_VonKries from colour.algebra import ( is_identity, @@ -119,11 +118,11 @@ matrix_dot, vector_dot, ) -from colour.hints import ArrayLike, Literal, NDArrayFloat from colour.constants import EPSILON +from colour.hints import ArrayLike, Literal, NDArrayFloat from colour.models import UCS_to_uv, XYZ_to_UCS, XYZ_to_xy, xy_to_XYZ -from colour.utilities import as_float_array, tstack from colour.temperature import uv_to_CCT_Robertson1968 +from colour.utilities import as_float_array, tstack from colour_hdri.models import CCS_ILLUMINANT_ADOBEDNG diff --git a/colour_hdri/models/rgb.py b/colour_hdri/models/rgb.py index 215821e..9bfe180 100644 --- a/colour_hdri/models/rgb.py +++ b/colour_hdri/models/rgb.py @@ -11,7 +11,6 @@ from __future__ import annotations import numpy as np - from colour.algebra import matrix_dot, vector_dot from colour.hints import ArrayLike, NDArrayFloat from colour.models import RGB_COLOURSPACES diff --git a/colour_hdri/models/tests/test_adobe_dng.py b/colour_hdri/models/tests/test_adobe_dng.py index 5cee96d..2b4bdb2 100644 --- a/colour_hdri/models/tests/test_adobe_dng.py +++ b/colour_hdri/models/tests/test_adobe_dng.py @@ -10,18 +10,19 @@ from __future__ import annotations -import numpy as np import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour.hints import NDArrayFloat -from colour_hdri.models.dng import matrix_interpolated from colour_hdri.models import ( - xy_to_camera_neutral, camera_neutral_to_xy, - matrix_XYZ_to_camera_space, matrix_camera_space_to_XYZ, + matrix_XYZ_to_camera_space, + xy_to_camera_neutral, ) +from colour_hdri.models.dng import matrix_interpolated __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers" @@ -117,44 +118,44 @@ def test_matrix_interpolated(self): [-0.13369466, 0.17678740, 0.66540452], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_interpolated( 5000, 2850, 6500, M_COLOR_MATRIX_1, M_COLOR_MATRIX_2 ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_interpolated( 2850, 2850, 6500, M_COLOR_MATRIX_1, M_COLOR_MATRIX_2 ), M_COLOR_MATRIX_1, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_interpolated( 1000, 2850, 6500, M_COLOR_MATRIX_1, M_COLOR_MATRIX_2 ), M_COLOR_MATRIX_1, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_interpolated( 6500, 2850, 6500, M_COLOR_MATRIX_1, M_COLOR_MATRIX_2 ), M_COLOR_MATRIX_2, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_interpolated( 10000, 2850, 6500, M_COLOR_MATRIX_1, M_COLOR_MATRIX_2 ), M_COLOR_MATRIX_2, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -170,7 +171,7 @@ def test_xy_to_camera_neutral(self): xy_to_camera_neutral` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( xy_to_camera_neutral( np.array([0.32816244, 0.34698169]), 2850, @@ -182,10 +183,10 @@ def test_xy_to_camera_neutral(self): ANALOG_BALANCE, ), np.array([0.41306999, 1.00000000, 0.64646500]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( xy_to_camera_neutral( np.array([0.32816244, 0.34698169]), 2850, @@ -197,10 +198,10 @@ def test_xy_to_camera_neutral(self): ANALOG_BALANCE, ), np.array([0.42696744, 1.00000000, 0.63712786]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( xy_to_camera_neutral( np.array([0.32816244, 0.34698169]), 2850, @@ -212,7 +213,7 @@ def test_xy_to_camera_neutral(self): ANALOG_BALANCE, ), np.array([0.39667111, 1.00000000, 0.62474378]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -228,7 +229,7 @@ def test_camera_neutral_to_xy(self): camera_neutral_to_xy` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( camera_neutral_to_xy( np.array([0.41306999, 1.00000000, 0.64646500]), 2850, @@ -240,10 +241,10 @@ def test_camera_neutral_to_xy(self): ANALOG_BALANCE, ), np.array([0.32816244, 0.34698169]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( camera_neutral_to_xy( np.array([0.42696744, 1.00000000, 0.63712786]), 2850, @@ -255,10 +256,10 @@ def test_camera_neutral_to_xy(self): ANALOG_BALANCE, ), np.array([0.32816244, 0.34698169]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( camera_neutral_to_xy( np.array([0.39667111, 1.00000000, 0.62474378]), 2850, @@ -270,7 +271,7 @@ def test_camera_neutral_to_xy(self): ANALOG_BALANCE, ), np.array([0.32816244, 0.34698169]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -292,7 +293,7 @@ def test_matrix_XYZ_to_camera_space(self): [-0.14199759, 0.18561614, 0.66524555], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_XYZ_to_camera_space( np.array([0.32816244, 0.34698169]), 2850, @@ -304,7 +305,7 @@ def test_matrix_XYZ_to_camera_space(self): ANALOG_BALANCE, ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) M_reference = np.array( @@ -314,7 +315,7 @@ def test_matrix_XYZ_to_camera_space(self): [-0.14199759, 0.18561614, 0.66524555], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_XYZ_to_camera_space( np.array([0.32816244, 0.34698169]), 2850, @@ -326,7 +327,7 @@ def test_matrix_XYZ_to_camera_space(self): ANALOG_BALANCE, ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) M_reference = np.array( @@ -336,7 +337,7 @@ def test_matrix_XYZ_to_camera_space(self): [-0.14199759, 0.18561614, 0.66524555], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_XYZ_to_camera_space( np.array([0.32816244, 0.34698169]), 2850, @@ -348,7 +349,7 @@ def test_matrix_XYZ_to_camera_space(self): ANALOG_BALANCE, ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -371,7 +372,7 @@ def test_matrix_camera_space_to_XYZ(self): [0.12225531, -0.15620000, 1.43983046], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_camera_space_to_XYZ( np.array([0.32816244, 0.34698169]), 2850, @@ -385,7 +386,7 @@ def test_matrix_camera_space_to_XYZ(self): M_FORWARD_MATRIX_2, ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) M_reference = np.array( @@ -395,7 +396,7 @@ def test_matrix_camera_space_to_XYZ(self): [0.12225531, -0.15620000, 1.43983046], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_camera_space_to_XYZ( np.array([0.32816244, 0.34698169]), 2850, @@ -409,7 +410,7 @@ def test_matrix_camera_space_to_XYZ(self): M_FORWARD_MATRIX_2, ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) M_reference = np.array( @@ -419,7 +420,7 @@ def test_matrix_camera_space_to_XYZ(self): [0.12225531, -0.15620000, 1.43983046], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_camera_space_to_XYZ( np.array([0.32816244, 0.34698169]), 2850, @@ -433,7 +434,7 @@ def test_matrix_camera_space_to_XYZ(self): M_FORWARD_MATRIX_2, ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) M_reference = np.array( @@ -443,7 +444,7 @@ def test_matrix_camera_space_to_XYZ(self): [0.13472434, -0.17097714, 1.40232276], ] ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( matrix_camera_space_to_XYZ( np.array([0.32816244, 0.34698169]), 2850, @@ -457,7 +458,7 @@ def test_matrix_camera_space_to_XYZ(self): np.identity(3), ), M_reference, - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/models/tests/test_rgb.py b/colour_hdri/models/tests/test_rgb.py index 3bd9759..b90ef59 100644 --- a/colour_hdri/models/tests/test_rgb.py +++ b/colour_hdri/models/tests/test_rgb.py @@ -1,9 +1,11 @@ # !/usr/bin/env python """Define the unit tests for the :mod:`colour_hdri.models.rgb` module.""" -import numpy as np import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri.models import camera_space_to_RGB, camera_space_to_sRGB __author__ = "Colour Developers" @@ -28,7 +30,7 @@ class TestCameraSpaceToRGB(unittest.TestCase): def test_camera_space_to_RGB(self): """Test :func:`colour_hdri.models.rgb.camera_space_to_RGB` definition.""" - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( camera_space_to_RGB( np.array([0.80660, 0.81638, 0.65885]), np.array( @@ -47,7 +49,7 @@ def test_camera_space_to_RGB(self): ), ), np.array([0.75641808, 0.86831924, 0.60445896]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -60,7 +62,7 @@ class TestCameraSpaceTosRGB(unittest.TestCase): def test_camera_space_to_sRGB(self): """Test :func:`colour_hdri.models.rgb.camera_space_to_sRGB` definition.""" - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( camera_space_to_sRGB( np.array([0.80660, 0.81638, 0.65885]), np.array( @@ -72,7 +74,7 @@ def test_camera_space_to_sRGB(self): ), ), np.array([0.75643502, 0.86831555, 0.60447061]), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/plotting/conftest.py b/colour_hdri/plotting/conftest.py index 62a1d63..1af1607 100644 --- a/colour_hdri/plotting/conftest.py +++ b/colour_hdri/plotting/conftest.py @@ -9,7 +9,6 @@ import matplotlib as mpl import pytest - from colour.hints import Generator __author__ = "Colour Developers" diff --git a/colour_hdri/plotting/hdri.py b/colour_hdri/plotting/hdri.py index 5c769f9..71a8e71 100644 --- a/colour_hdri/plotting/hdri.py +++ b/colour_hdri/plotting/hdri.py @@ -12,10 +12,11 @@ import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np - from colour.hints import Any, ArrayLike, Callable, Tuple from colour.plotting import CONSTANTS_COLOUR_STYLE, override_style, render from colour.utilities import as_float_array +from matplotlib.axes import Axes +from matplotlib.figure import Figure from colour_hdri.exposure import adjust_exposure @@ -38,7 +39,7 @@ def plot_HDRI_strip( ev_steps: float = -2, cctf_encoding: Callable = CONSTANTS_COLOUR_STYLE.colour.colourspace.cctf_encoding, **kwargs: Any, -) -> Tuple[plt.Figure, plt.Axes]: +) -> Tuple[Figure, Axes]: """ Plot given HDRI as strip of images of varying exposure. diff --git a/colour_hdri/plotting/tonemapping.py b/colour_hdri/plotting/tonemapping.py index 5895833..b7fd4b0 100644 --- a/colour_hdri/plotting/tonemapping.py +++ b/colour_hdri/plotting/tonemapping.py @@ -12,7 +12,6 @@ import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np - from colour.hints import Any, ArrayLike, Callable, Dict, Tuple from colour.plotting import ( CONSTANTS_COLOUR_STYLE, @@ -21,6 +20,8 @@ render, ) from colour.utilities import as_float_array +from matplotlib.axes import Axes +from matplotlib.figure import Figure __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers" @@ -41,7 +42,7 @@ def plot_tonemapping_operator_image( log_scale: bool = False, cctf_encoding: Callable = CONSTANTS_COLOUR_STYLE.colour.colourspace.cctf_encoding, **kwargs: Any, -) -> Tuple[plt.Figure, plt.Axes]: +) -> Tuple[Figure, Axes]: """ Plot given tonemapped image with superimposed luminance mapping function. @@ -78,7 +79,7 @@ def plot_tonemapping_operator_image( figure, axes = artist(**settings) shape = image.shape - bounding_box = [0, 1, 0, 1] + bounding_box = (0.0, 1.0, 0.0, 1.0) image = np.clip(cctf_encoding(image), 0, 1) axes.imshow( @@ -108,7 +109,9 @@ def plot_tonemapping_operator_image( settings.update( { "x_label": "$log_2$ Input Luminance", - "x_ticker_locator": matplotlib.ticker.AutoMinorLocator(0.5), + "x_ticker_locator": matplotlib.ticker.AutoMinorLocator( + 0.5 # pyright: ignore + ), } ) plt.gca().set_xscale("log", basex=2) diff --git a/colour_hdri/process/dng.py b/colour_hdri/process/dng.py index 001b776..ec80d36 100644 --- a/colour_hdri/process/dng.py +++ b/colour_hdri/process/dng.py @@ -13,13 +13,13 @@ from __future__ import annotations import logging -import numpy as np import os import platform import re import shlex import subprocess +import numpy as np from colour.hints import Callable, List, Mapping, Sequence, Tuple from colour.utilities import CanonicalMapping, optional from colour.utilities.documentation import ( diff --git a/colour_hdri/process/tests/test_dng.py b/colour_hdri/process/tests/test_dng.py index 0134549..80b8774 100644 --- a/colour_hdri/process/tests/test_dng.py +++ b/colour_hdri/process/tests/test_dng.py @@ -3,7 +3,6 @@ from __future__ import annotations -import numpy as np import os import platform import shutil @@ -11,13 +10,15 @@ import unittest import zipfile +import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour.hints import List from colour_hdri import ROOT_RESOURCES_TESTS from colour_hdri.process import ( - convert_raw_files_to_dng_files, convert_dng_files_to_intermediate_files, + convert_raw_files_to_dng_files, read_dng_files_exif_tags, ) from colour_hdri.utilities import filter_files @@ -85,10 +86,10 @@ def test_convert_raw_files_to_dng_files(self): for test_dng_file, reference_dng_file in zip( test_dng_files, reference_dng_files ): - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( read_image(str(test_dng_file)), read_image(str(reference_dng_file)), - decimal=7, + atol=0.005, ) @@ -162,10 +163,10 @@ def test_convert_dng_files_to_intermediate_files(self): for test_tiff_file, reference_tiff_file in zip( test_tiff_files, reference_tiff_files ): - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( read_image(str(test_tiff_file)), read_image(str(reference_tiff_file)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -187,8 +188,10 @@ def test_read_dng_files_exif_tags(self): self.assertIn("EXIF", exif_tags[0]) self.assertIn("Make", exif_tags[0]["EXIF"]) - self.assertAlmostEqual( - exif_tags[0]["EXIF"]["Exposure Time"], 0.12500000, places=7 + np.testing.assert_allclose( + exif_tags[0]["EXIF"]["Exposure Time"], + 0.12500000, + atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_array_equal( diff --git a/colour_hdri/recovery/highlights.py b/colour_hdri/recovery/highlights.py index 0fc4d76..b24bd9e 100644 --- a/colour_hdri/recovery/highlights.py +++ b/colour_hdri/recovery/highlights.py @@ -22,18 +22,17 @@ from __future__ import annotations import numpy as np - from colour.algebra import vector_dot from colour.hints import ArrayLike, NDArrayFloat from colour.models import ( - RGB_Colourspace, - LCHab_to_Lab, Lab_to_LCHab, Lab_to_XYZ, + LCHab_to_Lab, + RGB_Colourspace, + RGB_COLOURSPACE_sRGB, RGB_to_XYZ, XYZ_to_Lab, XYZ_to_RGB, - RGB_COLOURSPACE_sRGB, ) from colour.utilities import tsplit, tstack diff --git a/colour_hdri/recovery/tests/test_recovery.py b/colour_hdri/recovery/tests/test_recovery.py index 5116608..6eb60cd 100644 --- a/colour_hdri/recovery/tests/test_recovery.py +++ b/colour_hdri/recovery/tests/test_recovery.py @@ -3,7 +3,6 @@ from __future__ import annotations -import numpy as np import os import platform import re @@ -13,10 +12,12 @@ import tempfile import unittest +import numpy as np from colour import read_image from colour.hints import List, NDArrayFloat from colour_hdri import ROOT_RESOURCES_TESTS +from colour_hdri.models import camera_space_to_sRGB from colour_hdri.process import ( RAW_CONVERTER, RAW_CONVERTER_ARGUMENTS_DEMOSAICING, @@ -25,7 +26,6 @@ highlights_recovery_blend, highlights_recovery_LCHab, ) -from colour_hdri.models import camera_space_to_sRGB from colour_hdri.utilities import filter_files __author__ = "Colour Developers" diff --git a/colour_hdri/sampling/grossberg2003.py b/colour_hdri/sampling/grossberg2003.py index ed9f21a..d6be622 100644 --- a/colour_hdri/sampling/grossberg2003.py +++ b/colour_hdri/sampling/grossberg2003.py @@ -19,7 +19,6 @@ from __future__ import annotations import numpy as np - from colour.hints import ArrayLike, NDArrayFloat from colour.utilities import as_float_array, tsplit, tstack diff --git a/colour_hdri/sampling/tests/test_grossberg2003.py b/colour_hdri/sampling/tests/test_grossberg2003.py index 01cceaa..6ee4fdb 100644 --- a/colour_hdri/sampling/tests/test_grossberg2003.py +++ b/colour_hdri/sampling/tests/test_grossberg2003.py @@ -6,10 +6,11 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour.hints import List from colour_hdri import ROOT_RESOURCES_TESTS @@ -53,14 +54,14 @@ def test_samples_Grossberg2003(self): samples_Grossberg2003` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( samples_Grossberg2003(ImageStack.from_files(IMAGES_JPG).data), np.load( os.path.join( ROOT_RESOURCES_SAMPLING, "test_samples_Grossberg2003.npy" ) ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/sampling/tests/test_variance_minimization.py b/colour_hdri/sampling/tests/test_variance_minimization.py index fed64e8..15f15d6 100644 --- a/colour_hdri/sampling/tests/test_variance_minimization.py +++ b/colour_hdri/sampling/tests/test_variance_minimization.py @@ -6,20 +6,21 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np from colour import RGB_COLOURSPACES, RGB_luminance, read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour_hdri import ROOT_RESOURCES_TESTS from colour_hdri.sampling import ( light_probe_sampling_variance_minimization_Viriyothai2009, ) from colour_hdri.sampling.variance_minimization import ( - luminance_variance, find_regions_variance_minimization_Viriyothai2009, highlight_regions_variance_minimization, + luminance_variance, ) __author__ = "Colour Developers" @@ -55,7 +56,9 @@ def test_luminance_variance(self): a = np.tile(np.arange(5), (5, 1)) - self.assertAlmostEqual(luminance_variance(a), 12.24744871, places=7) + np.testing.assert_allclose( + luminance_variance(a), 12.24744871, atol=TOLERANCE_ABSOLUTE_TESTS + ) class TestFindRegionsVarianceMinimizationViriyothai2009(unittest.TestCase): @@ -149,7 +152,7 @@ def test_highlight_regions_variance_minimization(self): Y = RGB_luminance(image, colourspace.primaries, colourspace.whitepoint) regions = find_regions_variance_minimization_Viriyothai2009(Y, n=4) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( highlight_regions_variance_minimization(image, regions), read_image( str( @@ -159,7 +162,7 @@ def test_highlight_regions_variance_minimization(self): ) ) ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -195,7 +198,7 @@ def test_light_probe_sampling_variance_minimization_Viriyothai2009(self): colours = np.array([light[1] for light in lights]) indexes = np.array([light[2] for light in lights]) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( uvs, np.array( [ @@ -217,10 +220,10 @@ def test_light_probe_sampling_variance_minimization_Viriyothai2009(self): [0.87500000, 0.80078125], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( colours, np.array( [ @@ -242,7 +245,7 @@ def test_light_probe_sampling_variance_minimization_Viriyothai2009(self): [253.65272349, 50.30476046, 303.96245855], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_array_equal( diff --git a/colour_hdri/sampling/variance_minimization.py b/colour_hdri/sampling/variance_minimization.py index 6bdb878..dda05be 100644 --- a/colour_hdri/sampling/variance_minimization.py +++ b/colour_hdri/sampling/variance_minimization.py @@ -15,9 +15,9 @@ Egsr, 1-1. doi:10.1145/1599301.1599393 """ -import numpy as np from collections import namedtuple +import numpy as np from colour.hints import ArrayLike, List, NDArrayFloat, Tuple from colour.models import RGB_COLOURSPACES, RGB_Colourspace, RGB_luminance from colour.utilities import as_float_array, as_float_scalar, centroid, warning diff --git a/colour_hdri/tonemapping/global_operators/operators.py b/colour_hdri/tonemapping/global_operators/operators.py index 1930340..122ee84 100644 --- a/colour_hdri/tonemapping/global_operators/operators.py +++ b/colour_hdri/tonemapping/global_operators/operators.py @@ -51,7 +51,6 @@ from __future__ import annotations import numpy as np - from colour.constants import EPSILON from colour.hints import ArrayLike, NDArrayFloat, cast from colour.models import RGB_COLOURSPACES, RGB_Colourspace, RGB_luminance diff --git a/colour_hdri/tonemapping/global_operators/tests/test_operators.py b/colour_hdri/tonemapping/global_operators/tests/test_operators.py index 30c42dc..9e068ed 100644 --- a/colour_hdri/tonemapping/global_operators/tests/test_operators.py +++ b/colour_hdri/tonemapping/global_operators/tests/test_operators.py @@ -4,21 +4,23 @@ :mod:`colour_hdri.tonemapping.global_operators.operators` module. """ -import numpy as np import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri.tonemapping import ( - tonemapping_operator_simple, - tonemapping_operator_normalisation, + tonemapping_operator_exponential, + tonemapping_operator_exponentiation_mapping, + tonemapping_operator_filmic, tonemapping_operator_gamma, tonemapping_operator_logarithmic, - tonemapping_operator_exponential, tonemapping_operator_logarithmic_mapping, - tonemapping_operator_exponentiation_mapping, + tonemapping_operator_normalisation, + tonemapping_operator_Reinhard2004, tonemapping_operator_Schlick1994, + tonemapping_operator_simple, tonemapping_operator_Tumblin1999, - tonemapping_operator_Reinhard2004, - tonemapping_operator_filmic, ) from colour_hdri.tonemapping.global_operators.operators import log_average @@ -74,7 +76,7 @@ def test_tonemapping_operator_simple(self): tonemapping_operator_simple` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_simple( np.array( [ @@ -101,7 +103,7 @@ def test_tonemapping_operator_simple(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -117,7 +119,7 @@ def test_tonemapping_operator_normalisation(self): tonemapping_operator_normalisation` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_normalisation( np.array( [ @@ -144,7 +146,7 @@ def test_tonemapping_operator_normalisation(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -160,7 +162,7 @@ def test_tonemapping_operator_gamma(self): tonemapping_operator_gamma` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_gamma( np.array( [ @@ -189,7 +191,7 @@ def test_tonemapping_operator_gamma(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -205,7 +207,7 @@ def test_tonemapping_operator_logarithmic(self): tonemapping_operator_logarithmic` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_logarithmic( np.array( [ @@ -234,7 +236,7 @@ def test_tonemapping_operator_logarithmic(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -250,7 +252,7 @@ def test_tonemapping_operator_exponential(self): tonemapping_operator_exponential` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_exponential( np.array( [ @@ -279,7 +281,7 @@ def test_tonemapping_operator_exponential(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -295,7 +297,7 @@ def test_tonemapping_operator_logarithmic_mapping(self): tonemapping_operator_logarithmic_mapping` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_logarithmic_mapping( np.array( [ @@ -324,7 +326,7 @@ def test_tonemapping_operator_logarithmic_mapping(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -340,7 +342,7 @@ def test_tonemapping_operator_exponentiation_mapping(self): tonemapping_operator_exponentiation_mapping` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_exponentiation_mapping( np.array( [ @@ -369,7 +371,7 @@ def test_tonemapping_operator_exponentiation_mapping(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -385,7 +387,7 @@ def test_tonemapping_operator_Schlick1994(self): tonemapping_operator_Schlick1994` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_Schlick1994( np.array( [ @@ -413,7 +415,7 @@ def test_tonemapping_operator_Schlick1994(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -429,7 +431,7 @@ def test_tonemapping_operator_Tumblin1999(self): tonemapping_operator_Tumblin1999` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_Tumblin1999( np.array( [ @@ -459,7 +461,7 @@ def test_tonemapping_operator_Tumblin1999(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -475,7 +477,7 @@ def test_tonemapping_operator_Reinhard2004(self): tonemapping_operator_Reinhard2004` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_Reinhard2004( np.array( [ @@ -506,7 +508,7 @@ def test_tonemapping_operator_Reinhard2004(self): ], ] ), - decimal=7, + atol=1e-6, ) @@ -522,7 +524,7 @@ def test_tonemapping_operator_filmic(self): tonemapping_operator_filmic` definition. """ - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tonemapping_operator_filmic( np.array( [ @@ -557,7 +559,7 @@ def test_tonemapping_operator_filmic(self): ], ] ), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/utilities/exif.py b/colour_hdri/utilities/exif.py index 24bf79c..7c142e2 100644 --- a/colour_hdri/utilities/exif.py +++ b/colour_hdri/utilities/exif.py @@ -16,7 +16,6 @@ from __future__ import annotations import logging -import numpy as np import platform import re import subprocess @@ -24,6 +23,8 @@ from dataclasses import dataclass, field from fractions import Fraction +import numpy as np +from colour.constants import DTYPE_FLOAT_DEFAULT from colour.hints import ( DTypeFloat, DTypeReal, @@ -34,8 +35,6 @@ SupportsIndex, Type, ) - -from colour.constants import DEFAULT_FLOAT_DTYPE from colour.utilities import as_array, as_float_scalar, optional from colour.utilities.documentation import ( DocstringText, @@ -138,7 +137,7 @@ def parse_exif_number( Parsed EXIF tag value. """ - dtype = optional(dtype, DEFAULT_FLOAT_DTYPE) + dtype = optional(dtype, DTYPE_FLOAT_DEFAULT) return dtype(exif_tag.value) # pyright: ignore @@ -162,7 +161,7 @@ def parse_exif_fraction( Parsed EXIF tag value. """ - dtype = optional(dtype, DEFAULT_FLOAT_DTYPE) + dtype = optional(dtype, DTYPE_FLOAT_DEFAULT) value = ( exif_tag.value @@ -196,7 +195,7 @@ def parse_exif_array( Parsed EXIF tag value. """ - dtype = optional(dtype, DEFAULT_FLOAT_DTYPE) + dtype = optional(dtype, DTYPE_FLOAT_DEFAULT) value = ( exif_tag.value if exif_tag.value is None else exif_tag.value.split() diff --git a/colour_hdri/utilities/image.py b/colour_hdri/utilities/image.py index e9c2f2e..03ec45a 100644 --- a/colour_hdri/utilities/image.py +++ b/colour_hdri/utilities/image.py @@ -12,10 +12,11 @@ from __future__ import annotations import logging -import numpy as np from collections.abc import MutableSequence from dataclasses import dataclass, field, fields +import numpy as np +from colour import read_image from colour.hints import ( Any, ArrayLike, @@ -26,7 +27,6 @@ Sequence, cast, ) -from colour import read_image from colour.utilities import ( MixinDataclassArray, as_float_array, diff --git a/colour_hdri/utilities/tests/test_common.py b/colour_hdri/utilities/tests/test_common.py index 155ff51..a359d9b 100644 --- a/colour_hdri/utilities/tests/test_common.py +++ b/colour_hdri/utilities/tests/test_common.py @@ -8,10 +8,10 @@ from colour_hdri import ROOT_RESOURCES_TESTS from colour_hdri.utilities import ( + filter_files, + path_exists, vivification, vivified_to_dict, - path_exists, - filter_files, ) __author__ = "Colour Developers" diff --git a/colour_hdri/utilities/tests/test_exif.py b/colour_hdri/utilities/tests/test_exif.py index 068264e..c3fc4a7 100644 --- a/colour_hdri/utilities/tests/test_exif.py +++ b/colour_hdri/utilities/tests/test_exif.py @@ -3,26 +3,29 @@ from __future__ import annotations -import numpy as np import os import shutil import tempfile import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri import ROOT_RESOURCES_TESTS -from colour_hdri.utilities import filter_files, vivified_to_dict from colour_hdri.utilities import ( EXIFTag, - parse_exif_string, - parse_exif_number, - parse_exif_fraction, + copy_exif_tags, + delete_exif_tags, + filter_files, parse_exif_array, parse_exif_data, + parse_exif_fraction, + parse_exif_number, + parse_exif_string, + read_exif_tag, read_exif_tags, - copy_exif_tags, update_exif_tags, - delete_exif_tags, - read_exif_tag, + vivified_to_dict, write_exif_tag, ) @@ -95,13 +98,17 @@ def test_parse_exif_fraction(self): """ exif_tag = EXIFTag("EXIF", "Exposure Time", "0.01666666667", "33434") - self.assertAlmostEqual( - parse_exif_fraction(exif_tag), 0.01666666, places=7 + np.testing.assert_allclose( + parse_exif_fraction(exif_tag), + 0.01666666, + atol=TOLERANCE_ABSOLUTE_TESTS, ) exif_tag = EXIFTag("EXIF", "Exposure Time", "10/4000", "33434") - self.assertAlmostEqual( - parse_exif_fraction(exif_tag), 0.00250000, places=7 + np.testing.assert_allclose( + parse_exif_fraction(exif_tag), + 0.00250000, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_hdri/utilities/tests/test_image.py b/colour_hdri/utilities/tests/test_image.py index 64af336..0051394 100644 --- a/colour_hdri/utilities/tests/test_image.py +++ b/colour_hdri/utilities/tests/test_image.py @@ -3,13 +3,14 @@ from __future__ import annotations -import numpy as np import os import unittest +import numpy as np +from colour.constants import TOLERANCE_ABSOLUTE_TESTS + from colour_hdri import ROOT_RESOURCES_TESTS -from colour_hdri.utilities import filter_files -from colour_hdri.utilities import Image, ImageStack +from colour_hdri.utilities import Image, ImageStack, filter_files __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers" @@ -158,14 +159,18 @@ def test__getattr__(self): self.assertTupleEqual(self._image_stack.data.shape, (426, 640, 3, 3)) - np.testing.assert_array_almost_equal( - self._image_stack.f_number, np.array([8, 8, 8]), decimal=7 + np.testing.assert_allclose( + self._image_stack.f_number, + np.array([8, 8, 8]), + atol=TOLERANCE_ABSOLUTE_TESTS, ) self.assertEqual(self._image_stack[0].metadata.f_number, 8) - np.testing.assert_array_almost_equal( - self._image_stack.exposure_time, np.array([0.125, 1, 8]), decimal=7 + np.testing.assert_allclose( + self._image_stack.exposure_time, + np.array([0.125, 1, 8]), + atol=TOLERANCE_ABSOLUTE_TESTS, ) self.assertEqual(self._image_stack[0].metadata.exposure_time, 0.125) @@ -190,14 +195,18 @@ def test__setattr__(self): self.assertTupleEqual(image_stack.data.shape, (20, 10, 3, 3)) - np.testing.assert_array_almost_equal( - image_stack.f_number, np.array([8, 8, 8]), decimal=7 + np.testing.assert_allclose( + image_stack.f_number, + np.array([8, 8, 8]), + atol=TOLERANCE_ABSOLUTE_TESTS, ) image_stack.f_number = np.array([1, 2, 3]) - np.testing.assert_array_almost_equal( - image_stack.f_number, np.array([1, 2, 3]), decimal=7 + np.testing.assert_allclose( + image_stack.f_number, + np.array([1, 2, 3]), + atol=TOLERANCE_ABSOLUTE_TESTS, ) self.assertEqual(image_stack[0].metadata.f_number, 1) @@ -208,8 +217,10 @@ def test__setattr__(self): image_stack.black_level = np.array([2048, 2048, 2048]) - np.testing.assert_array_almost_equal( - image_stack.black_level, np.array([2048, 2048, 2048]), decimal=7 + np.testing.assert_allclose( + image_stack.black_level, + np.array([2048, 2048, 2048]), + atol=TOLERANCE_ABSOLUTE_TESTS, ) self.assertEqual(image_stack[0].metadata.black_level, 2048) diff --git a/docs/colour_hdri.sampling.rst b/docs/colour_hdri.sampling.rst index 55ce49d..8f5bea2 100644 --- a/docs/colour_hdri.sampling.rst +++ b/docs/colour_hdri.sampling.rst @@ -24,5 +24,3 @@ Grossberg (2013) :toctree: generated/ samples_Grossberg2003 - - diff --git a/docs/colour_hdri.tonemapping.rst b/docs/colour_hdri.tonemapping.rst index a1d2840..0b1dd59 100644 --- a/docs/colour_hdri.tonemapping.rst +++ b/docs/colour_hdri.tonemapping.rst @@ -145,4 +145,4 @@ Habble (2010) - Filmic .. autosummary:: :toctree: generated/ - tonemapping_operator_filmic \ No newline at end of file + tonemapping_operator_filmic diff --git a/docs/conf.py b/docs/conf.py index 3335d99..a54aded 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,11 +31,12 @@ ] intersphinx_mapping = { - "python": ("https://docs.python.org/3.11", None), + "python": ("https://docs.python.org/3/", None), + "colour-science": ("https://colour.readthedocs.io/en/stable/", None), "matplotlib": ("https://matplotlib.org/stable", None), "numpy": ("https://numpy.org/doc/stable", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/dev", None), - "scipy": ("https://docs.scipy.org/doc/scipy-1.8.0/", None), + "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None), + "scipy": ("https://docs.scipy.org/doc/scipy/", None), } autodoc_member_order = "bysource" diff --git a/docs/requirements.txt b/docs/requirements.txt index fcac47d..3a8fc4b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,51 +1,51 @@ -accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.12" -alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.12" -babel==2.12.1 ; python_version >= "3.9" and python_version < "3.12" -beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "3.12" -biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.12" -certifi==2023.7.22 ; python_version >= "3.9" and python_version < "3.12" -charset-normalizer==3.2.0 ; python_version >= "3.9" and python_version < "3.12" -colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" -colour-demosaicing==0.2.4 ; python_version >= "3.9" and python_version < "3.12" -colour-science==0.4.3 ; python_version >= "3.9" and python_version < "3.12" -contourpy==1.1.0 ; python_version >= "3.9" and python_version < "3.12" -cycler==0.11.0 ; python_version >= "3.9" and python_version < "3.12" -docutils==0.17.1 ; python_version >= "3.9" and python_version < "3.12" -fonttools==4.42.1 ; python_version >= "3.9" and python_version < "3.12" -idna==3.4 ; python_version >= "3.9" and python_version < "3.12" -imageio==2.31.2 ; python_version >= "3.9" and python_version < "3.12" -imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.12" -importlib-metadata==6.8.0 ; python_version >= "3.9" and python_version < "3.10" -importlib-resources==6.0.1 ; python_version >= "3.9" and python_version < "3.10" -jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.12" -kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.12" -latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.12" -markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.12" -matplotlib==3.7.2 ; python_version >= "3.9" and python_version < "3.12" -numpy==1.25.2 ; python_version >= "3.9" and python_version < "3.12" -packaging==23.1 ; python_version >= "3.9" and python_version < "3.12" -pillow==10.0.0 ; python_version >= "3.9" and python_version < "3.12" -pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.12" -pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.12" -pydata-sphinx-theme==0.13.3 ; python_version >= "3.9" and python_version < "3.12" -pygments==2.16.1 ; python_version >= "3.9" and python_version < "3.12" -pyparsing==3.0.9 ; python_version >= "3.9" and python_version < "3.12" -python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "3.12" -pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.12" -requests==2.31.0 ; python_version >= "3.9" and python_version < "3.12" -restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.12" -scipy==1.11.2 ; python_version >= "3.9" and python_version < "3.12" -six==1.16.0 ; python_version >= "3.9" and python_version < "3.12" -snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.12" -soupsieve==2.4.1 ; python_version >= "3.9" and python_version < "3.12" -sphinx==4.5.0 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-bibtex==2.6.0 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.9" and python_version < "3.12" -typing-extensions==4.7.1 ; python_version >= "3.9" and python_version < "3.12" -urllib3==2.0.4 ; python_version >= "3.9" and python_version < "3.12" -zipp==3.16.2 ; python_version >= "3.9" and python_version < "3.10" +accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.13" +alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.13" +babel==2.14.0 ; python_version >= "3.9" and python_version < "3.13" +beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "3.13" +biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.13" +certifi==2023.11.17 ; python_version >= "3.9" and python_version < "3.13" +charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "3.13" +colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "win32" +colour-demosaicing==0.2.5 ; python_version >= "3.9" and python_version < "3.13" +colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13" +contourpy==1.2.0 ; python_version >= "3.9" and python_version < "3.13" +cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13" +docutils==0.20.1 ; python_version >= "3.9" and python_version < "3.13" +fonttools==4.47.0 ; python_version >= "3.9" and python_version < "3.13" +idna==3.6 ; python_version >= "3.9" and python_version < "3.13" +imageio==2.33.1 ; python_version >= "3.9" and python_version < "3.13" +imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.13" +importlib-metadata==7.0.0 ; python_version >= "3.9" and python_version < "3.10" +importlib-resources==6.1.1 ; python_version >= "3.9" and python_version < "3.10" +jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.13" +kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.13" +latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.13" +markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.13" +matplotlib==3.8.2 ; python_version >= "3.9" and python_version < "3.13" +numpy==1.26.2 ; python_version >= "3.9" and python_version < "3.13" +packaging==23.2 ; python_version >= "3.9" and python_version < "3.13" +pillow==10.1.0 ; python_version >= "3.9" and python_version < "3.13" +pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.13" +pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.13" +pydata-sphinx-theme==0.14.4 ; python_version >= "3.9" and python_version < "3.13" +pygments==2.17.2 ; python_version >= "3.9" and python_version < "3.13" +pyparsing==3.1.1 ; python_version >= "3.9" and python_version < "3.13" +python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "3.13" +pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.13" +requests==2.31.0 ; python_version >= "3.9" and python_version < "3.13" +restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.13" +scipy==1.11.4 ; python_version >= "3.9" and python_version < "3.13" +six==1.16.0 ; python_version >= "3.9" and python_version < "3.13" +snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.13" +soupsieve==2.5 ; python_version >= "3.9" and python_version < "3.13" +sphinx==7.2.6 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-applehelp==1.0.7 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-bibtex==2.6.1 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-devhelp==1.0.5 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-htmlhelp==2.0.4 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-qthelp==1.0.6 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-serializinghtml==1.1.9 ; python_version >= "3.9" and python_version < "3.13" +typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "3.13" +urllib3==2.1.0 ; python_version >= "3.9" and python_version < "3.13" +zipp==3.17.0 ; python_version >= "3.9" and python_version < "3.10" diff --git a/pyproject.toml b/pyproject.toml index 004622e..c7527b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "colour-hdri" -version = "0.2.2" +version = "0.2.3" description = "HDRI processing algorithms for Python" license = "BSD-3-Clause" authors = [ "Colour Developers " ] @@ -58,8 +58,8 @@ exclude = [ ] [tool.poetry.dependencies] -python = ">= 3.9, < 3.12" -colour-science = ">= 0.4.3" +python = ">= 3.9, < 3.13" +colour-science = ">= 0.4.4" imageio = ">= 2, < 3" numpy = ">= 1.22, < 2" scipy = ">= 1.8, < 2" @@ -70,19 +70,15 @@ colour-demosaicing = ">= 0.2.4" matplotlib = ">= 3.5, != 3.5.0, != 3.5.1" [tool.poetry.group.dev.dependencies] -black = "*" -blackdoc = "*" coverage = "!= 6.3" coveralls = "*" -flynt = "*" invoke = "*" jupyter = "*" -pre-commit = "*" +pre-commit = ">= 3.5" pyright = "*" pytest = "*" pytest-cov = "*" pytest-xdist = "*" -ruff = "*" toml = "*" twine = "*" @@ -90,7 +86,7 @@ twine = "*" biblib-simple = "*" pydata-sphinx-theme = "*" restructuredtext-lint = "*" -sphinx = ">= 4, < 5" +sphinx = "*" sphinxcontrib-bibtex = "*" [tool.black] @@ -106,6 +102,16 @@ exclude = ''' [tool.flynt] line_length=999 +[tool.isort] +ensure_newline_before_comments = true +force_grid_wrap = 0 +include_trailing_comma = true +line_length = 88 +multi_line_output = 3 +skip_glob = ["colour_hdri/**/__init__.py"] +split_on_trailing_comma = true +use_parentheses = true + [tool.pyright] reportMissingImports = false reportMissingModuleSource = false diff --git a/requirements.txt b/requirements.txt index 3784040..37b28e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,181 +1,172 @@ -accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.12" -alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.12" -anyio==3.7.1 ; python_version >= "3.9" and python_version < "3.12" -appnope==0.1.3 ; python_version >= "3.9" and python_version < "3.12" and (platform_system == "Darwin" or sys_platform == "darwin") -argon2-cffi-bindings==21.2.0 ; python_version >= "3.9" and python_version < "3.12" -argon2-cffi==23.1.0 ; python_version >= "3.9" and python_version < "3.12" -arrow==1.2.3 ; python_version >= "3.9" and python_version < "3.12" -astor==0.8.1 ; python_version >= "3.9" and python_version < "3.12" -asttokens==2.2.1 ; python_version >= "3.9" and python_version < "3.12" -async-lru==2.0.4 ; python_version >= "3.9" and python_version < "3.12" -attrs==23.1.0 ; python_version >= "3.9" and python_version < "3.12" -babel==2.12.1 ; python_version >= "3.9" and python_version < "3.12" -backcall==0.2.0 ; python_version >= "3.9" and python_version < "3.12" -beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "3.12" -biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.12" -black==23.7.0 ; python_version >= "3.9" and python_version < "3.12" -blackdoc==0.3.8 ; python_version >= "3.9" and python_version < "3.12" -bleach==6.0.0 ; python_version >= "3.9" and python_version < "3.12" -certifi==2023.7.22 ; python_version >= "3.9" and python_version < "3.12" -cffi==1.15.1 ; python_version >= "3.9" and python_version < "3.12" -cfgv==3.4.0 ; python_version >= "3.9" and python_version < "3.12" -charset-normalizer==3.2.0 ; python_version >= "3.9" and python_version < "3.12" -click==8.1.7 ; python_version >= "3.9" and python_version < "3.12" -colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and (sys_platform == "win32" or platform_system == "Windows") -colour-demosaicing==0.2.4 ; python_version >= "3.9" and python_version < "3.12" -colour-science==0.4.3 ; python_version >= "3.9" and python_version < "3.12" -comm==0.1.4 ; python_version >= "3.9" and python_version < "3.12" -contourpy==1.1.0 ; python_version >= "3.9" and python_version < "3.12" -coverage==6.5.0 ; python_version >= "3.9" and python_version < "3.12" -coverage[toml]==6.5.0 ; python_version >= "3.9" and python_version < "3.12" -coveralls==3.3.1 ; python_version >= "3.9" and python_version < "3.12" -cryptography==41.0.3 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "linux" -cycler==0.11.0 ; python_version >= "3.9" and python_version < "3.12" -debugpy==1.6.7.post1 ; python_version >= "3.9" and python_version < "3.12" -decorator==5.1.1 ; python_version >= "3.9" and python_version < "3.12" -defusedxml==0.7.1 ; python_version >= "3.9" and python_version < "3.12" -distlib==0.3.7 ; python_version >= "3.9" and python_version < "3.12" -docopt==0.6.2 ; python_version >= "3.9" and python_version < "3.12" -docutils==0.17.1 ; python_version >= "3.9" and python_version < "3.12" -exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.11" -execnet==2.0.2 ; python_version >= "3.9" and python_version < "3.12" -executing==1.2.0 ; python_version >= "3.9" and python_version < "3.12" -fastjsonschema==2.18.0 ; python_version >= "3.9" and python_version < "3.12" -filelock==3.12.2 ; python_version >= "3.9" and python_version < "3.12" -flynt==1.0.1 ; python_version >= "3.9" and python_version < "3.12" -fonttools==4.42.1 ; python_version >= "3.9" and python_version < "3.12" -fqdn==1.5.1 ; python_version >= "3.9" and python_version < "3.12" -identify==2.5.27 ; python_version >= "3.9" and python_version < "3.12" -idna==3.4 ; python_version >= "3.9" and python_version < "3.12" -imageio==2.31.2 ; python_version >= "3.9" and python_version < "3.12" -imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.12" -importlib-metadata==6.8.0 ; python_version >= "3.9" and python_version < "3.12" -importlib-resources==6.0.1 ; python_version >= "3.9" and python_version < "3.10" -iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.12" -invoke==2.2.0 ; python_version >= "3.9" and python_version < "3.12" -ipykernel==6.25.1 ; python_version >= "3.9" and python_version < "3.12" -ipython-genutils==0.2.0 ; python_version >= "3.9" and python_version < "3.12" -ipython==8.14.0 ; python_version >= "3.9" and python_version < "3.12" -ipywidgets==8.1.0 ; python_version >= "3.9" and python_version < "3.12" -isoduration==20.11.0 ; python_version >= "3.9" and python_version < "3.12" -jaraco-classes==3.3.0 ; python_version >= "3.9" and python_version < "3.12" -jedi==0.19.0 ; python_version >= "3.9" and python_version < "3.12" -jeepney==0.8.0 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "linux" -jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.12" -json5==0.9.14 ; python_version >= "3.9" and python_version < "3.12" -jsonpointer==2.4 ; python_version >= "3.9" and python_version < "3.12" -jsonschema-specifications==2023.7.1 ; python_version >= "3.9" and python_version < "3.12" -jsonschema==4.19.0 ; python_version >= "3.9" and python_version < "3.12" -jsonschema[format-nongpl]==4.19.0 ; python_version >= "3.9" and python_version < "3.12" -jupyter-client==8.3.0 ; python_version >= "3.9" and python_version < "3.12" -jupyter-console==6.6.3 ; python_version >= "3.9" and python_version < "3.12" -jupyter-core==5.3.1 ; python_version >= "3.9" and python_version < "3.12" -jupyter-events==0.7.0 ; python_version >= "3.9" and python_version < "3.12" -jupyter-lsp==2.2.0 ; python_version >= "3.9" and python_version < "3.12" -jupyter-server-terminals==0.4.4 ; python_version >= "3.9" and python_version < "3.12" -jupyter-server==2.7.2 ; python_version >= "3.9" and python_version < "3.12" -jupyter==1.0.0 ; python_version >= "3.9" and python_version < "3.12" -jupyterlab-pygments==0.2.2 ; python_version >= "3.9" and python_version < "3.12" -jupyterlab-server==2.24.0 ; python_version >= "3.9" and python_version < "3.12" -jupyterlab-widgets==3.0.8 ; python_version >= "3.9" and python_version < "3.12" -jupyterlab==4.0.5 ; python_version >= "3.9" and python_version < "3.12" -keyring==24.2.0 ; python_version >= "3.9" and python_version < "3.12" -kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.12" -latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.12" -markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "3.12" -markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.12" -matplotlib-inline==0.1.6 ; python_version >= "3.9" and python_version < "3.12" -matplotlib==3.7.2 ; python_version >= "3.9" and python_version < "3.12" -mdurl==0.1.2 ; python_version >= "3.9" and python_version < "3.12" -mistune==3.0.1 ; python_version >= "3.9" and python_version < "3.12" -more-itertools==10.1.0 ; python_version >= "3.9" and python_version < "3.12" -mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "3.12" -nbclient==0.8.0 ; python_version >= "3.9" and python_version < "3.12" -nbconvert==7.7.4 ; python_version >= "3.9" and python_version < "3.12" -nbformat==5.9.2 ; python_version >= "3.9" and python_version < "3.12" -nest-asyncio==1.5.7 ; python_version >= "3.9" and python_version < "3.12" -nodeenv==1.8.0 ; python_version >= "3.9" and python_version < "3.12" -notebook-shim==0.2.3 ; python_version >= "3.9" and python_version < "3.12" -notebook==7.0.2 ; python_version >= "3.9" and python_version < "3.12" -numpy==1.25.2 ; python_version >= "3.9" and python_version < "3.12" -overrides==7.4.0 ; python_version >= "3.9" and python_version < "3.12" -packaging==23.1 ; python_version >= "3.9" and python_version < "3.12" -pandocfilters==1.5.0 ; python_version >= "3.9" and python_version < "3.12" -parso==0.8.3 ; python_version >= "3.9" and python_version < "3.12" -pathspec==0.11.2 ; python_version >= "3.9" and python_version < "3.12" -pexpect==4.8.0 ; python_version >= "3.9" and python_version < "3.12" and sys_platform != "win32" -pickleshare==0.7.5 ; python_version >= "3.9" and python_version < "3.12" -pillow==10.0.0 ; python_version >= "3.9" and python_version < "3.12" -pkginfo==1.9.6 ; python_version >= "3.9" and python_version < "3.12" -platformdirs==3.10.0 ; python_version >= "3.9" and python_version < "3.12" -pluggy==1.3.0 ; python_version >= "3.9" and python_version < "3.12" -pre-commit==3.3.3 ; python_version >= "3.9" and python_version < "3.12" -prometheus-client==0.17.1 ; python_version >= "3.9" and python_version < "3.12" -prompt-toolkit==3.0.39 ; python_version >= "3.9" and python_version < "3.12" -psutil==5.9.5 ; python_version >= "3.9" and python_version < "3.12" -ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "3.12" and (sys_platform != "win32" or os_name != "nt") -pure-eval==0.2.2 ; python_version >= "3.9" and python_version < "3.12" -pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.12" -pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.12" -pycparser==2.21 ; python_version >= "3.9" and python_version < "3.12" -pydata-sphinx-theme==0.13.3 ; python_version >= "3.9" and python_version < "3.12" -pygments==2.16.1 ; python_version >= "3.9" and python_version < "3.12" -pyparsing==3.0.9 ; python_version >= "3.9" and python_version < "3.12" -pyright==1.1.324 ; python_version >= "3.9" and python_version < "3.12" -pytest-cov==4.1.0 ; python_version >= "3.9" and python_version < "3.12" -pytest-xdist==3.3.1 ; python_version >= "3.9" and python_version < "3.12" -pytest==7.4.0 ; python_version >= "3.9" and python_version < "3.12" -python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "3.12" -python-json-logger==2.0.7 ; python_version >= "3.9" and python_version < "3.12" -pywin32-ctypes==0.2.2 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" -pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "3.12" -pywinpty==2.0.11 ; python_version >= "3.9" and python_version < "3.12" and os_name == "nt" -pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.12" -pyzmq==25.1.1 ; python_version >= "3.9" and python_version < "3.12" -qtconsole==5.4.3 ; python_version >= "3.9" and python_version < "3.12" -qtpy==2.3.1 ; python_version >= "3.9" and python_version < "3.12" -readme-renderer==41.0 ; python_version >= "3.9" and python_version < "3.12" -referencing==0.30.2 ; python_version >= "3.9" and python_version < "3.12" -requests-toolbelt==1.0.0 ; python_version >= "3.9" and python_version < "3.12" -requests==2.31.0 ; python_version >= "3.9" and python_version < "3.12" -restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.12" -rfc3339-validator==0.1.4 ; python_version >= "3.9" and python_version < "3.12" -rfc3986-validator==0.1.1 ; python_version >= "3.9" and python_version < "3.12" -rfc3986==2.0.0 ; python_version >= "3.9" and python_version < "3.12" -rich==13.5.2 ; python_version >= "3.9" and python_version < "3.12" -rpds-py==0.9.2 ; python_version >= "3.9" and python_version < "3.12" -ruff==0.0.286 ; python_version >= "3.9" and python_version < "3.12" -scipy==1.11.2 ; python_version >= "3.9" and python_version < "3.12" -secretstorage==3.3.3 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "linux" -send2trash==1.8.2 ; python_version >= "3.9" and python_version < "3.12" -setuptools==68.1.2 ; python_version >= "3.9" and python_version < "3.12" -six==1.16.0 ; python_version >= "3.9" and python_version < "3.12" -sniffio==1.3.0 ; python_version >= "3.9" and python_version < "3.12" -snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.12" -soupsieve==2.4.1 ; python_version >= "3.9" and python_version < "3.12" -sphinx==4.5.0 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-bibtex==2.6.0 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.9" and python_version < "3.12" -sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.9" and python_version < "3.12" -stack-data==0.6.2 ; python_version >= "3.9" and python_version < "3.12" -terminado==0.17.1 ; python_version >= "3.9" and python_version < "3.12" -tinycss2==1.2.1 ; python_version >= "3.9" and python_version < "3.12" -toml==0.10.2 ; python_version >= "3.9" and python_version < "3.12" -tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.12" -tornado==6.3.3 ; python_version >= "3.9" and python_version < "3.12" -traitlets==5.9.0 ; python_version >= "3.9" and python_version < "3.12" -twine==4.0.2 ; python_version >= "3.9" and python_version < "3.12" -typing-extensions==4.7.1 ; python_version >= "3.9" and python_version < "3.12" -uri-template==1.3.0 ; python_version >= "3.9" and python_version < "3.12" -urllib3==2.0.4 ; python_version >= "3.9" and python_version < "3.12" -virtualenv==20.24.3 ; python_version >= "3.9" and python_version < "3.12" -wcwidth==0.2.6 ; python_version >= "3.9" and python_version < "3.12" -webcolors==1.13 ; python_version >= "3.9" and python_version < "3.12" -webencodings==0.5.1 ; python_version >= "3.9" and python_version < "3.12" -websocket-client==1.6.2 ; python_version >= "3.9" and python_version < "3.12" -widgetsnbextension==4.0.8 ; python_version >= "3.9" and python_version < "3.12" -zipp==3.16.2 ; python_version >= "3.9" and python_version < "3.12" +accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.13" +alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.13" +anyio==4.2.0 ; python_version >= "3.9" and python_version < "3.13" +appnope==0.1.3 ; python_version >= "3.9" and python_version < "3.13" and platform_system == "Darwin" +argon2-cffi==23.1.0 ; python_version >= "3.9" and python_version < "3.13" +argon2-cffi-bindings==21.2.0 ; python_version >= "3.9" and python_version < "3.13" +arrow==1.3.0 ; python_version >= "3.9" and python_version < "3.13" +asttokens==2.4.1 ; python_version >= "3.9" and python_version < "3.13" +async-lru==2.0.4 ; python_version >= "3.9" and python_version < "3.13" +attrs==23.1.0 ; python_version >= "3.9" and python_version < "3.13" +babel==2.14.0 ; python_version >= "3.9" and python_version < "3.13" +beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "3.13" +biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.13" +bleach==6.1.0 ; python_version >= "3.9" and python_version < "3.13" +certifi==2023.11.17 ; python_version >= "3.9" and python_version < "3.13" +cffi==1.16.0 ; python_version >= "3.9" and python_version < "3.13" +cfgv==3.4.0 ; python_version >= "3.9" and python_version < "3.13" +charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "3.13" +colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "win32" +colour-demosaicing==0.2.5 ; python_version >= "3.9" and python_version < "3.13" +colour-science==0.4.4 ; python_version >= "3.9" and python_version < "3.13" +comm==0.2.0 ; python_version >= "3.9" and python_version < "3.13" +contourpy==1.2.0 ; python_version >= "3.9" and python_version < "3.13" +coverage==7.3.3 ; python_version >= "3.9" and python_version < "3.13" +coverage[toml]==7.3.3 ; python_version >= "3.9" and python_version < "3.13" +coveralls==1.8.0 ; python_version >= "3.9" and python_version < "3.13" +cryptography==41.0.7 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" +cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13" +debugpy==1.8.0 ; python_version >= "3.9" and python_version < "3.13" +decorator==5.1.1 ; python_version >= "3.9" and python_version < "3.13" +defusedxml==0.7.1 ; python_version >= "3.9" and python_version < "3.13" +distlib==0.3.8 ; python_version >= "3.9" and python_version < "3.13" +docopt==0.6.2 ; python_version >= "3.9" and python_version < "3.13" +docutils==0.20.1 ; python_version >= "3.9" and python_version < "3.13" +exceptiongroup==1.2.0 ; python_version >= "3.9" and python_version < "3.11" +execnet==2.0.2 ; python_version >= "3.9" and python_version < "3.13" +executing==2.0.1 ; python_version >= "3.9" and python_version < "3.13" +fastjsonschema==2.19.0 ; python_version >= "3.9" and python_version < "3.13" +filelock==3.13.1 ; python_version >= "3.9" and python_version < "3.13" +fonttools==4.47.0 ; python_version >= "3.9" and python_version < "3.13" +fqdn==1.5.1 ; python_version >= "3.9" and python_version < "3.13" +identify==2.5.33 ; python_version >= "3.9" and python_version < "3.13" +idna==3.6 ; python_version >= "3.9" and python_version < "3.13" +imageio==2.33.1 ; python_version >= "3.9" and python_version < "3.13" +imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.13" +importlib-metadata==7.0.0 ; python_version >= "3.9" and python_version < "3.13" +importlib-resources==6.1.1 ; python_version >= "3.9" and python_version < "3.10" +iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.13" +invoke==2.2.0 ; python_version >= "3.9" and python_version < "3.13" +ipykernel==6.27.1 ; python_version >= "3.9" and python_version < "3.13" +ipython==8.18.1 ; python_version >= "3.9" and python_version < "3.13" +ipywidgets==8.1.1 ; python_version >= "3.9" and python_version < "3.13" +isoduration==20.11.0 ; python_version >= "3.9" and python_version < "3.13" +jaraco-classes==3.3.0 ; python_version >= "3.9" and python_version < "3.13" +jedi==0.19.1 ; python_version >= "3.9" and python_version < "3.13" +jeepney==0.8.0 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" +jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.13" +json5==0.9.14 ; python_version >= "3.9" and python_version < "3.13" +jsonpointer==2.4 ; python_version >= "3.9" and python_version < "3.13" +jsonschema==4.20.0 ; python_version >= "3.9" and python_version < "3.13" +jsonschema-specifications==2023.11.2 ; python_version >= "3.9" and python_version < "3.13" +jsonschema[format-nongpl]==4.20.0 ; python_version >= "3.9" and python_version < "3.13" +jupyter==1.0.0 ; python_version >= "3.9" and python_version < "3.13" +jupyter-client==8.6.0 ; python_version >= "3.9" and python_version < "3.13" +jupyter-console==6.6.3 ; python_version >= "3.9" and python_version < "3.13" +jupyter-core==5.5.1 ; python_version >= "3.9" and python_version < "3.13" +jupyter-events==0.9.0 ; python_version >= "3.9" and python_version < "3.13" +jupyter-lsp==2.2.1 ; python_version >= "3.9" and python_version < "3.13" +jupyter-server==2.12.1 ; python_version >= "3.9" and python_version < "3.13" +jupyter-server-terminals==0.5.0 ; python_version >= "3.9" and python_version < "3.13" +jupyterlab==4.0.9 ; python_version >= "3.9" and python_version < "3.13" +jupyterlab-pygments==0.3.0 ; python_version >= "3.9" and python_version < "3.13" +jupyterlab-server==2.25.2 ; python_version >= "3.9" and python_version < "3.13" +jupyterlab-widgets==3.0.9 ; python_version >= "3.9" and python_version < "3.13" +keyring==24.3.0 ; python_version >= "3.9" and python_version < "3.13" +kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.13" +latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.13" +markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "3.13" +markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.13" +matplotlib==3.8.2 ; python_version >= "3.9" and python_version < "3.13" +matplotlib-inline==0.1.6 ; python_version >= "3.9" and python_version < "3.13" +mdurl==0.1.2 ; python_version >= "3.9" and python_version < "3.13" +mistune==3.0.2 ; python_version >= "3.9" and python_version < "3.13" +more-itertools==10.1.0 ; python_version >= "3.9" and python_version < "3.13" +nbclient==0.9.0 ; python_version >= "3.9" and python_version < "3.13" +nbconvert==7.13.0 ; python_version >= "3.9" and python_version < "3.13" +nbformat==5.9.2 ; python_version >= "3.9" and python_version < "3.13" +nest-asyncio==1.5.8 ; python_version >= "3.9" and python_version < "3.13" +nh3==0.2.15 ; python_version >= "3.9" and python_version < "3.13" +nodeenv==1.8.0 ; python_version >= "3.9" and python_version < "3.13" +notebook==7.0.6 ; python_version >= "3.9" and python_version < "3.13" +notebook-shim==0.2.3 ; python_version >= "3.9" and python_version < "3.13" +numpy==1.26.2 ; python_version >= "3.9" and python_version < "3.13" +overrides==7.4.0 ; python_version >= "3.9" and python_version < "3.13" +packaging==23.2 ; python_version >= "3.9" and python_version < "3.13" +pandocfilters==1.5.0 ; python_version >= "3.9" and python_version < "3.13" +parso==0.8.3 ; python_version >= "3.9" and python_version < "3.13" +pexpect==4.9.0 ; python_version >= "3.9" and python_version < "3.13" and sys_platform != "win32" +pillow==10.1.0 ; python_version >= "3.9" and python_version < "3.13" +pkginfo==1.9.6 ; python_version >= "3.9" and python_version < "3.13" +platformdirs==4.1.0 ; python_version >= "3.9" and python_version < "3.13" +pluggy==1.3.0 ; python_version >= "3.9" and python_version < "3.13" +pre-commit==3.6.0 ; python_version >= "3.9" and python_version < "3.13" +prometheus-client==0.19.0 ; python_version >= "3.9" and python_version < "3.13" +prompt-toolkit==3.0.43 ; python_version >= "3.9" and python_version < "3.13" +psutil==5.9.7 ; python_version >= "3.9" and python_version < "3.13" +ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "3.13" and (sys_platform != "win32" or os_name != "nt") +pure-eval==0.2.2 ; python_version >= "3.9" and python_version < "3.13" +pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.13" +pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.13" +pycparser==2.21 ; python_version >= "3.9" and python_version < "3.13" +pydata-sphinx-theme==0.14.4 ; python_version >= "3.9" and python_version < "3.13" +pygments==2.17.2 ; python_version >= "3.9" and python_version < "3.13" +pyparsing==3.1.1 ; python_version >= "3.9" and python_version < "3.13" +pyright==1.1.341 ; python_version >= "3.9" and python_version < "3.13" +pytest==7.4.3 ; python_version >= "3.9" and python_version < "3.13" +pytest-cov==4.1.0 ; python_version >= "3.9" and python_version < "3.13" +pytest-xdist==3.5.0 ; python_version >= "3.9" and python_version < "3.13" +python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "3.13" +python-json-logger==2.0.7 ; python_version >= "3.9" and python_version < "3.13" +pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "3.13" +pywin32-ctypes==0.2.2 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "win32" +pywinpty==2.0.12 ; python_version >= "3.9" and python_version < "3.13" and os_name == "nt" +pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.13" +pyzmq==25.1.2 ; python_version >= "3.9" and python_version < "3.13" +qtconsole==5.5.1 ; python_version >= "3.9" and python_version < "3.13" +qtpy==2.4.1 ; python_version >= "3.9" and python_version < "3.13" +readme-renderer==42.0 ; python_version >= "3.9" and python_version < "3.13" +referencing==0.32.0 ; python_version >= "3.9" and python_version < "3.13" +requests==2.31.0 ; python_version >= "3.9" and python_version < "3.13" +requests-toolbelt==1.0.0 ; python_version >= "3.9" and python_version < "3.13" +restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.13" +rfc3339-validator==0.1.4 ; python_version >= "3.9" and python_version < "3.13" +rfc3986==2.0.0 ; python_version >= "3.9" and python_version < "3.13" +rfc3986-validator==0.1.1 ; python_version >= "3.9" and python_version < "3.13" +rich==13.7.0 ; python_version >= "3.9" and python_version < "3.13" +rpds-py==0.15.2 ; python_version >= "3.9" and python_version < "3.13" +scipy==1.11.4 ; python_version >= "3.9" and python_version < "3.13" +secretstorage==3.3.3 ; python_version >= "3.9" and python_version < "3.13" and sys_platform == "linux" +send2trash==1.8.2 ; python_version >= "3.9" and python_version < "3.13" +setuptools==69.0.2 ; python_version >= "3.9" and python_version < "3.13" +six==1.16.0 ; python_version >= "3.9" and python_version < "3.13" +sniffio==1.3.0 ; python_version >= "3.9" and python_version < "3.13" +snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.13" +soupsieve==2.5 ; python_version >= "3.9" and python_version < "3.13" +sphinx==7.2.6 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-applehelp==1.0.7 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-bibtex==2.6.1 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-devhelp==1.0.5 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-htmlhelp==2.0.4 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-qthelp==1.0.6 ; python_version >= "3.9" and python_version < "3.13" +sphinxcontrib-serializinghtml==1.1.9 ; python_version >= "3.9" and python_version < "3.13" +stack-data==0.6.3 ; python_version >= "3.9" and python_version < "3.13" +terminado==0.18.0 ; python_version >= "3.9" and python_version < "3.13" +tinycss2==1.2.1 ; python_version >= "3.9" and python_version < "3.13" +toml==0.10.2 ; python_version >= "3.9" and python_version < "3.13" +tomli==2.0.1 ; python_version >= "3.9" and python_full_version <= "3.11.0a6" +tornado==6.4 ; python_version >= "3.9" and python_version < "3.13" +traitlets==5.14.0 ; python_version >= "3.9" and python_version < "3.13" +twine==4.0.2 ; python_version >= "3.9" and python_version < "3.13" +types-python-dateutil==2.8.19.14 ; python_version >= "3.9" and python_version < "3.13" +typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "3.13" +uri-template==1.3.0 ; python_version >= "3.9" and python_version < "3.13" +urllib3==2.1.0 ; python_version >= "3.9" and python_version < "3.13" +virtualenv==20.25.0 ; python_version >= "3.9" and python_version < "3.13" +wcwidth==0.2.12 ; python_version >= "3.9" and python_version < "3.13" +webcolors==1.13 ; python_version >= "3.9" and python_version < "3.13" +webencodings==0.5.1 ; python_version >= "3.9" and python_version < "3.13" +websocket-client==1.7.0 ; python_version >= "3.9" and python_version < "3.13" +widgetsnbextension==4.0.9 ; python_version >= "3.9" and python_version < "3.13" +zipp==3.17.0 ; python_version >= "3.9" and python_version < "3.13" diff --git a/tasks.py b/tasks.py index 262ed52..8471daf 100644 --- a/tasks.py +++ b/tasks.py @@ -5,23 +5,23 @@ from __future__ import annotations -import biblib.bib import contextlib import fnmatch +import inspect import os import re import uuid -import colour_hdri +import biblib.bib from colour.utilities import message_box -import inspect +import colour_hdri if not hasattr(inspect, "getargspec"): inspect.getargspec = inspect.getfullargspec # pyright: ignore -from invoke.tasks import task from invoke.context import Context +from invoke.tasks import task __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers"