Skip to content

Commit 24fecb3

Browse files
committed
Merge branch 'release/v0.2.6'
2 parents dfbc94c + 0a3108b commit 24fecb3

22 files changed

+397
-433
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ is available to guide the process: https://www.colour-science.org/contributing/.
1818
- [ ] Pyright static checking has been run and passed.
1919
- [ ] Pre-commit hooks have been run and passed.
2020

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

2424
**Documentation**
2525

.github/workflows/continuous-integration-documentation.yml

+9-13
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [ubuntu-22.04]
11-
python-version: [3.12]
10+
os: [ubuntu-latest]
11+
python-version: [3.13]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
- name: Environment Variables
1717
run: |
1818
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
@@ -22,27 +22,23 @@ jobs:
2222
echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV
2323
shell: bash
2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
- name: Install Dependencies
2929
run: |
3030
sudo apt-get update
3131
sudo apt-get --yes install latexmk texlive-full
32-
- name: Install Poetry
33-
env:
34-
POETRY_VERSION: 1.4.0
32+
- name: Install uv
3533
run: |
36-
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
37-
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
34+
pip install uv
3835
shell: bash
3936
- name: Install Package Dependencies
4037
run: |
41-
poetry run python -m pip install --upgrade pip
42-
poetry install
43-
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
38+
uv sync --all-extras --no-dev
39+
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
4440
shell: bash
4541
- name: Build Documentation
4642
run: |
47-
poetry run invoke docs
43+
uv run invoke docs
4844
shell: bash

.github/workflows/continuous-integration-quality-unit-tests.yml

+22-20
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [macOS-latest, ubuntu-22.04, windows-latest]
11-
python-version: [3.9, "3.10", 3.11, 3.12]
10+
os: [macOS-latest, ubuntu-latest, windows-latest]
11+
python-version: ["3.10", 3.11, 3.12, 3.13]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
with:
1717
submodules: true
1818
- name: Environment Variables
@@ -22,41 +22,43 @@ jobs:
2222
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
2323
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2424
shell: bash
25-
- name: Set up Python 3.9 for Pre-Commit
26-
uses: actions/setup-python@v4
25+
- name: Set up Python 3.10 for Pre-Commit
26+
uses: actions/setup-python@v5
2727
with:
28-
python-version: 3.9
28+
python-version: "3.10"
2929
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
3131
with:
3232
python-version: ${{ matrix.python-version }}
33-
- name: Install Poetry
34-
env:
35-
POETRY_VERSION: 1.4.0
33+
- name: Install Dependencies (macOS)
34+
if: matrix.os == 'macOS-latest'
3635
run: |
37-
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
38-
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
36+
brew install freeimage
37+
# TODO: Drop when https://github.com/imageio/imageio/issues/628 is addressed
38+
echo "IMAGEIO_FREEIMAGE_LIB=/opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.3.18.0.dylib" >> $GITHUB_ENV
39+
- name: Install uv
40+
run: |
41+
pip install uv
3942
shell: bash
4043
- name: Install Package Dependencies
4144
run: |
42-
poetry run python -m pip install --upgrade pip
43-
poetry install
44-
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
45+
uv sync --all-extras --no-dev
46+
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
4547
shell: bash
4648
- name: Pre-Commit (All Files)
4749
run: |
48-
poetry run pre-commit run --all-files
50+
uv run pre-commit run --all-files
4951
shell: bash
5052
- name: Test Optimised Python Execution
5153
run: |
52-
poetry run python -OO -c "import $CI_PACKAGE"
54+
uv run python -OO -c "import $CI_PACKAGE"
5355
shell: bash
5456
- name: Test with Pytest
5557
run: |
56-
poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
58+
uv run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
5759
shell: bash
5860
- name: Upload Coverage to coveralls.io
59-
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.11'
61+
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12'
6062
run: |
61-
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
63+
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else uv run coveralls; fi
6264
shell: bash

.github/workflows/continuous-integration-static-type-checking.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ jobs:
88
strategy:
99
matrix:
1010
os: [macOS-latest]
11-
python-version: [3.12]
11+
python-version: [3.13]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
- name: Environment Variables
1717
run: |
1818
echo "CI_PACKAGE=colour_demosaicing" >> $GITHUB_ENV
1919
shell: bash
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install Package Dependencies
2525
run: |
26-
pip install -r requirements.txt
26+
cat requirements.txt | grep -Eo '(^[^#]+)' | xargs -n 1 pip install || true
2727
- name: Static Type Checking
2828
run: |
29-
pyright --skipunannotated
29+
pyright --threads --skipunannotated

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.fleet
77
.idea
88
.ipynb_checkpoints
9+
.python-version
910
.sandbox
1011
.vs
1112
.vscode
@@ -17,4 +18,4 @@ colour_demosaicing.egg-info
1718
dist
1819
docs/_build
1920
docs/generated
20-
poetry.lock
21+
uv.lock

.pre-commit-config.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,23 @@ repos:
2525
- id: flynt
2626
args: [--verbose]
2727
- repo: https://github.com/PyCQA/isort
28-
rev: "5.12.0"
28+
rev: "5.13.2"
2929
hooks:
3030
- id: isort
3131
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: "v0.1.6"
32+
rev: "v0.1.14"
3333
hooks:
34+
- id: ruff-format
3435
- id: ruff
35-
- repo: https://github.com/psf/black-pre-commit-mirror
36-
rev: 23.11.0
37-
hooks:
38-
- id: black
39-
language_version: python3.9
4036
- repo: https://github.com/adamchainz/blacken-docs
4137
rev: 1.16.0
4238
hooks:
4339
- id: blacken-docs
44-
language_version: python3.9
40+
language_version: python3.10
4541
- repo: https://github.com/pre-commit/mirrors-prettier
4642
rev: "v3.1.0"
4743
hooks:
4844
- id: prettier
49-
exclude: config-aces-reference.ocio.yaml
5045
- repo: https://github.com/pre-commit/pygrep-hooks
5146
rev: "v1.10.0"
5247
hooks:

CONTRIBUTORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributors
44
Development & Technical Support
55
-------------------------------
66

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

99
Project coordination, overall development.
1010

README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Colour - Demosaicing
1212
:target: https://coveralls.io/r/colour-science/colour-demosaicing
1313
:alt: Coverage Status
1414
.. |codacy| image:: https://img.shields.io/codacy/grade/2862b4f2217742ae83c972d7e3af44d7/develop.svg?style=flat-square
15-
:target: https://www.codacy.com/app/colour-science/colour-demosaicing
15+
:target: https://app.codacy.com/gh/colour-science/colour-demosaicing
1616
:alt: Code Grade
1717
.. |version| image:: https://img.shields.io/pypi/v/colour-demosaicing.svg?style=flat-square
1818
:target: https://pypi.org/project/colour-demosaicing
@@ -67,11 +67,11 @@ Primary Dependencies
6767

6868
**Colour - Demosaicing** requires various dependencies in order to run:
6969

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

7676
Pypi
7777
~~~~

TODO.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TODO
66

77
- colour_demosaicing/__init__.py
88

9-
- Line 82 : # TODO: Remove legacy printing support when deemed appropriate.
9+
- Line 80 : # TODO: Remove legacy printing support when deemed appropriate.
1010

1111
About
1212
-----

colour_demosaicing/__init__.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151
ROOT_RESOURCES, "colour-demosaicing-tests-datasets"
5252
)
5353

54+
__all__ += ["ROOT_RESOURCES", "ROOT_RESOURCES_EXAMPLES", "ROOT_RESOURCES_TESTS"]
55+
5456
__application_name__ = "Colour - Demosaicing"
5557

5658
__major_version__ = "0"
5759
__minor_version__ = "2"
58-
__change_version__ = "5"
59-
__version__ = ".".join(
60-
(__major_version__, __minor_version__, __change_version__)
61-
)
60+
__change_version__ = "6"
61+
__version__ = ".".join((__major_version__, __minor_version__, __change_version__))
6262

6363
try:
6464
_version: str = (
@@ -73,9 +73,7 @@
7373
except Exception:
7474
_version: str = __version__
7575

76-
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ # pyright: ignore
77-
"colour-demosaicing"
78-
] = _version
76+
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES["colour-demosaicing"] = _version # pyright: ignore
7977

8078
del _version
8179

colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# !/usr/bin/env python
21
"""
32
Define the unit tests for the
43
:mod:`colour_demosaicing.bayer.demosaicing.bilinear` module.
@@ -7,7 +6,6 @@
76
from __future__ import annotations
87

98
import os
10-
import unittest
119

1210
import numpy as np
1311
from colour import read_image
@@ -33,7 +31,7 @@
3331
)
3432

3533

36-
class TestDemosaicing_CFA_Bayer_bilinear(unittest.TestCase):
34+
class TestDemosaicing_CFA_Bayer_bilinear:
3735
"""
3836
Define :func:`colour_demosaicing.bayer.demosaicing.bilinear.\
3937
demosaicing_CFA_Bayer_bilinear` definition unit tests methods.
@@ -46,21 +44,13 @@ def test_demosaicing_CFA_Bayer_bilinear(self):
4644
"""
4745

4846
for pattern in ("RGGB", "BGGR", "GRBG", "GBRG"):
49-
CFA = os.path.join(
50-
ROOT_RESOURCES_BAYER, f"Lighthouse_CFA_{pattern}.exr"
51-
)
47+
CFA = os.path.join(ROOT_RESOURCES_BAYER, f"Lighthouse_CFA_{pattern}.exr")
5248
RGB = os.path.join(
5349
ROOT_RESOURCES_BAYER, f"Lighthouse_Bilinear_{pattern}.exr"
5450
)
5551

5652
np.testing.assert_allclose(
57-
demosaicing_CFA_Bayer_bilinear(
58-
read_image(str(CFA))[..., 0], pattern
59-
),
53+
demosaicing_CFA_Bayer_bilinear(read_image(str(CFA))[..., 0], pattern),
6054
read_image(str(RGB)),
6155
atol=TOLERANCE_ABSOLUTE_TESTS,
6256
)
63-
64-
65-
if __name__ == "__main__":
66-
unittest.main()

colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# !/usr/bin/env python
21
"""
32
Define the unit tests for the
43
:mod:`colour_demosaicing.bayer.demosaicing.malvar2004` module.
@@ -7,7 +6,6 @@
76
from __future__ import annotations
87

98
import os
10-
import unittest
119

1210
import numpy as np
1311
from colour import read_image
@@ -33,7 +31,7 @@
3331
)
3432

3533

36-
class TestDemosaicing_CFA_Bayer_Malvar2004(unittest.TestCase):
34+
class TestDemosaicing_CFA_Bayer_Malvar2004:
3735
"""
3836
Define :func:`colour_demosaicing.bayer.demosaicing.malvar2004.\
3937
demosaicing_CFA_Bayer_Malvar2004` definition unit tests methods.
@@ -46,21 +44,13 @@ def test_demosaicing_CFA_Bayer_Malvar2004(self):
4644
"""
4745

4846
for pattern in ("RGGB", "BGGR", "GRBG", "GBRG"):
49-
CFA = os.path.join(
50-
ROOT_RESOURCES_BAYER, f"Lighthouse_CFA_{pattern}.exr"
51-
)
47+
CFA = os.path.join(ROOT_RESOURCES_BAYER, f"Lighthouse_CFA_{pattern}.exr")
5248
RGB = os.path.join(
5349
ROOT_RESOURCES_BAYER, f"Lighthouse_Malvar2004_{pattern}.exr"
5450
)
5551

5652
np.testing.assert_allclose(
57-
demosaicing_CFA_Bayer_Malvar2004(
58-
read_image(str(CFA))[..., 0], pattern
59-
),
53+
demosaicing_CFA_Bayer_Malvar2004(read_image(str(CFA))[..., 0], pattern),
6054
read_image(str(RGB)),
6155
atol=TOLERANCE_ABSOLUTE_TESTS,
6256
)
63-
64-
65-
if __name__ == "__main__":
66-
unittest.main()

0 commit comments

Comments
 (0)