Skip to content

Commit

Permalink
Merge branch 'release/v0.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Oct 13, 2024
2 parents 743f8ba + 0c08dd1 commit 2eb0a13
Show file tree
Hide file tree
Showing 53 changed files with 846 additions and 1,142 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ is available to guide the process: https://www.colour-science.org/contributing/.
- [ ] Pyright static checking has been run and passed.
- [ ] Pre-commit hooks have been run and passed.

<!-- The unit tests can be invoked with `poetry run invoke tests` -->
<!-- Pyright can be started with `pyright --skipunannotated` -->
<!-- The unit tests can be invoked with `uv run invoke tests` -->
<!-- Pyright can be started with `pyright --threads --skipunannotated` -->

**Documentation**

Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-22.04]
python-version: [3.12]
os: [ubuntu-latest]
python-version: [3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Environment Variables
run: |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
Expand All @@ -22,27 +22,23 @@ jobs:
echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
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
- name: Install uv
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
pip install uv
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()"
uv sync --all-extras --no-dev
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Build Documentation
run: |
poetry run invoke docs
uv run invoke docs
shell: bash
50 changes: 24 additions & 26 deletions .github/workflows/continuous-integration-quality-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [macOS-latest, ubuntu-22.04, windows-latest]
python-version: [3.9, "3.10", 3.11, 3.12]
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.10", 3.11, 3.12, 3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true
- name: Environment Variables
Expand All @@ -23,33 +23,34 @@ jobs:
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
- name: Set up Python 3.10 for Pre-Commit
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
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
brew install freeimage
# TODO: Drop when https://github.com/imageio/imageio/issues/628 is addressed
echo "IMAGEIO_FREEIMAGE_LIB=/opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.3.18.0.dylib" >> $GITHUB_ENV
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-latest'
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://exiftool.org/exiftool-12.98_64.zip -o exiftool-12.98_64.zip
unzip -d exiftool exiftool-12.98_64.zip
cp exiftool/exiftool-12.98_64/exiftool\(-k\).exe exiftool/exiftool-12.98_64/exiftool.exe
echo "$PWD/exiftool/exiftool-12.98_64" | 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
Expand All @@ -65,32 +66,29 @@ jobs:
run: |
echo "C:\Program Files\Adobe\Adobe DNG Converter" >> $GITHUB_PATH
shell: bash
- name: Install Poetry
env:
POETRY_VERSION: 1.4.0
- name: Install uv
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
pip install uv
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()"
uv sync --all-extras --no-dev
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Pre-Commit (All Files)
run: |
poetry run pre-commit run --all-files
uv run pre-commit run --all-files
shell: bash
- name: Test Optimised Python Execution
run: |
poetry run python -OO -c "import $CI_PACKAGE"
uv 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
uv 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
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12'
run: |
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else uv run coveralls; fi
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ jobs:
strategy:
matrix:
os: [macOS-latest]
python-version: [3.12]
python-version: [3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- 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
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Package Dependencies
run: |
pip install -r requirements.txt
cat requirements.txt | grep -Eo '(^[^#]+)' | xargs -n 1 pip install || true
- name: Static Type Checking
run: |
pyright --skipunannotated
pyright --threads --skipunannotated
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.fleet
.idea
.ipynb_checkpoints
.python-version
.sandbox
.vs
.vscode
Expand All @@ -17,4 +18,4 @@ colour_hdri.egg-info
dist
docs/_build
docs/generated
poetry.lock
uv.lock
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,23 @@ repos:
- id: flynt
args: [--verbose]
- repo: https://github.com/PyCQA/isort
rev: "5.12.0"
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
rev: "v0.1.14"
hooks:
- id: ruff-format
- 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
language_version: python3.10
- 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:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors
Development & Technical Support
-------------------------------

- **Thomas Mansencal**, *Technology Supervisor @ Wētā FX*
- **Thomas Mansencal**, *Principal Pipeline Programmer @ Epic Games*

Project coordination, overall development.

Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Colour - HDRI
:target: https://coveralls.io/r/colour-science/colour-hdri
:alt: Coverage Status
.. |codacy| image:: https://img.shields.io/codacy/grade/f422dc0703dd4653b2b766217c745813/develop.svg?style=flat-square
:target: https://www.codacy.com/app/colour-science/colour-hdri
:target: https://app.codacy.com/gh/colour-science/colour-hdri
:alt: Code Grade
.. |version| image:: https://img.shields.io/pypi/v/colour-hdri.svg?style=flat-square
:target: https://pypi.org/project/colour-hdri
Expand Down Expand Up @@ -74,18 +74,18 @@ Primary Dependencies

**Colour - HDRI** requires various dependencies in order to run:

- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
- `colour-science >= 4.3 <https://pypi.org/project/colour-science>`__
- `python >= 3.10, < 3.14 <https://www.python.org/download/releases>`__
- `colour-science >= 4.4 <https://pypi.org/project/colour-science>`__
- `imageio >= 2, < 3 <https://imageio.github.io>`__
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__
- `numpy >= 1.24, < 3 <https://pypi.org/project/numpy>`__
- `scipy >= 1.10, < 2 <https://pypi.org/project/scipy>`__

Optional Features Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- `colour-demosaicing <https://pypi.org/project/colour-demosaicing>`__
- `Adobe DNG Converter <https://www.adobe.com/support/downloads/product.jsp?product=106&platform=Mac>`__
- `dcraw <https://www.cybercom.net/~dcoffin/dcraw>`__
- `Adobe DNG Converter <https://helpx.adobe.com/nz/camera-raw/using/adobe-dng-converter.html>`__
- `dcraw <https://dechifro.org/dcraw/>`__
- `ExifTool <http://www.sno.phy.queensu.ca/~phil/exiftool>`__
- `rawpy <https://pypi.org/project/rawpy>`__

Expand Down
8 changes: 4 additions & 4 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ TODO

- colour_hdri/__init__.py

- Line 287 : # TODO: Remove legacy printing support when deemed appropriate.
- Line 281 : # TODO: Remove legacy printing support when deemed appropriate.


- colour_hdri/tonemapping/global_operators/operators.py

- Line 584 : # TODO: Implement automatic *p* and *non-uniform* computations support.
- Line 582 : # TODO: Implement automatic *p* and *non-uniform* computations support.


- colour_hdri/utilities/exif.py

- Line 318 : # TODO: Find a better name.
- Line 317 : # TODO: Find a better name.


- colour_hdri/utilities/image.py

- Line 443 : # TODO: Revise then "MixinDataclassArray" is improved.
- Line 438 : # TODO: Revise then "MixinDataclassArray" is improved.

About
-----
Expand Down
14 changes: 4 additions & 10 deletions colour_hdri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,14 @@ def __getattr__(self, attribute) -> Any:
ROOT_RESOURCES_EXAMPLES: str = os.path.join(
ROOT_RESOURCES, "colour-hdri-examples-datasets"
)
ROOT_RESOURCES_TESTS: str = os.path.join(
ROOT_RESOURCES, "colour-hdri-tests-datasets"
)
ROOT_RESOURCES_TESTS: str = os.path.join(ROOT_RESOURCES, "colour-hdri-tests-datasets")

__application_name__ = "Colour - HDRI"

__major_version__ = "0"
__minor_version__ = "2"
__change_version__ = "3"
__version__ = ".".join(
(__major_version__, __minor_version__, __change_version__)
)
__change_version__ = "4"
__version__ = ".".join((__major_version__, __minor_version__, __change_version__))

try:
_version: str = (
Expand All @@ -278,9 +274,7 @@ def __getattr__(self, attribute) -> Any:
except Exception:
_version: str = __version__

colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ # pyright: ignore
"colour-hdri"
] = _version
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES["colour-hdri"] = _version # pyright: ignore

del _version

Expand Down
4 changes: 2 additions & 2 deletions colour_hdri/calibration/absolute_luminance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Absolute Luminance Calibration - Lagarde (2016)
===============================================
Defines the *Lagarde (2016)* panoramic images absolute *Luminance* calibration
Define the *Lagarde (2016)* panoramic images absolute *Luminance* calibration
objects:
- :func:`colour_hdri.absolute_luminance_calibration_Lagarde2016`
Expand Down Expand Up @@ -91,7 +91,7 @@ def upper_hemisphere_illuminance_weights_Lagarde2016(
) -> NDArrayFloat:
"""
Compute upper hemisphere illuminance weights for use with applications
unable to perform the computation directly, i.e. *Adobe Photoshop*.
unable to perform the computation directly, i.e., *Adobe Photoshop*.
Parameters
----------
Expand Down
8 changes: 3 additions & 5 deletions colour_hdri/calibration/debevec1997.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Debevec (1997) Camera Response Function Computation
===================================================
Defines the *Debevec (1997)* camera responses computation objects:
Define the *Debevec (1997)* camera responses computation objects:
- :func:`colour_hdri.g_solve`
- :func:`colour_hdri.camera_response_functions_Debevec1997`
Expand Down Expand Up @@ -139,7 +139,7 @@ def extrapolating_function_polynomial(
given camera response functions.
The extrapolation occurs where the weighting function masks fully the
camera response functions, e.g. at both ends for *Debevec (1997)*.
camera response functions, e.g., at both ends for *Debevec (1997)*.
Parameters
----------
Expand Down Expand Up @@ -246,9 +246,7 @@ def camera_response_functions_Debevec1997(

w = partial(weighting_function, **weighting_function_kwargs)

g_c = [
g_solve(s_o[..., x], L_l, l_s, w, n)[0] for x in range(s_o.shape[-1])
]
g_c = [g_solve(s_o[..., x], L_l, l_s, w, n)[0] for x in range(s_o.shape[-1])]
crfs = np.exp(tstack(np.array(g_c)))

if extrapolating_function is not None:
Expand Down
Loading

0 comments on commit 2eb0a13

Please sign in to comment.