Skip to content

Commit a08c95b

Browse files
committed
Merge branch 'feature/v0.2.1' into develop
2 parents d1d84d2 + 3876ebe commit a08c95b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+713
-523
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [ubuntu-20.04]
11-
python-version: [3.8]
10+
os: [ubuntu-22.04]
11+
python-version: [3.11]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
@@ -31,8 +31,7 @@ jobs:
3131
sudo apt-get --yes install latexmk texlive-full
3232
- name: Install Poetry
3333
run: |
34-
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
35-
python get-poetry.py
34+
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
3635
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
3736
shell: bash
3837
- name: Install Package Dependencies

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [macOS-latest, ubuntu-20.04, windows-latest]
11-
python-version: [3.8, 3.9, '3.10']
12-
exclude:
13-
- os: windows-latest
14-
python-version: 3.8
10+
os: [macOS-latest, ubuntu-22.04, windows-latest]
11+
python-version: [3.9, '3.10', 3.11]
1512
fail-fast: false
1613
runs-on: ${{ matrix.os }}
1714
steps:
@@ -26,6 +23,10 @@ jobs:
2623
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2724
echo "MPLBACKEND=AGG" >> $GITHUB_ENV
2825
shell: bash
26+
- name: Set up Python 3.9 for Pre-Commit
27+
uses: actions/setup-python@v1
28+
with:
29+
python-version: 3.9
2930
- name: Set up Python ${{ matrix.python-version }}
3031
uses: actions/setup-python@v1
3132
with:
@@ -37,28 +38,27 @@ jobs:
3738
brew install --cask adobe-dng-converter
3839
shell: bash
3940
- name: Install Dependencies (Ubuntu)
40-
if: matrix.os == 'ubuntu-20.04'
41+
if: matrix.os == 'ubuntu-22.04'
4142
run: |
4243
sudo apt-get update
4344
sudo apt-get --yes install dcraw exiftool
4445
shell: bash
4546
- name: Install Dependencies (Windows)
4647
if: matrix.os == 'windows-latest'
4748
run: |
48-
curl -L https://exiftool.org/exiftool-12.40.zip -o exiftool-12.40.zip
49-
unzip -d exiftool exiftool-12.40.zip
49+
curl -L https://exiftool.org/exiftool-12.51.zip -o exiftool-12.51.zip
50+
unzip -d exiftool exiftool-12.51.zip
5051
cp exiftool/exiftool\(-k\).exe exiftool/exiftool.exe
51-
echo "$PWD/exiftool" >> $GITHUB_PATH
52+
echo "$PWD/exiftool" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH
5253
curl -L https://cdn.fastpictureviewer.com/bin/dcraw.zip?v=201605100 -o dcraw.zip
5354
unzip -d dcraw dcraw.zip
54-
echo "$PWD/dcraw" >> $GITHUB_PATH
55+
echo "$PWD/dcraw" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH
5556
shell: bash
5657
- name: Install Adobe DNG Converter (Windows)
5758
if: matrix.os == 'windows-latest'
5859
run: |
5960
curl -L https://download.adobe.com/pub/adobe/dng/win/DNGConverter_11_4.exe -o DNGConverter_11_4.exe
6061
DNGConverter_11_4.exe /S
61-
echo "C:\Program Files\Adobe\Adobe DNG Converter" >> $GITHUB_PATH
6262
shell: cmd
6363
- name: Add Adobe DNG Converter to %PATH% (Windows)
6464
if: matrix.os == 'windows-latest'
@@ -67,8 +67,7 @@ jobs:
6767
shell: bash
6868
- name: Install Poetry
6969
run: |
70-
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
71-
python get-poetry.py --version 1.1.12
70+
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
7271
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
7372
shell: bash
7473
- name: Install Package Dependencies

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ jobs:
88
strategy:
99
matrix:
1010
os: [macOS-latest]
11-
python-version: [3.9]
11+
python-version: [3.11]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
1515
- uses: actions/checkout@v1
1616
- name: Environment Variables
1717
run: |
18-
echo "CI_PACKAGE=colour" >> $GITHUB_ENV
18+
echo "CI_PACKAGE=colour_hdri" >> $GITHUB_ENV
1919
shell: bash
2020
- name: Set up Python ${{ matrix.python-version }}
2121
uses: actions/setup-python@v1
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- name: Static Type Checking
24+
- name: Install Package Dependencies
2525
run: |
2626
pip install -r requirements.txt
27-
mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts -p $CI_PACKAGE
27+
- name: Static Type Checking
28+
run: |
29+
mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts $CI_PACKAGE

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
*.egg-info
12
*.pyc
3+
*.pyo
24
.DS_Store
35
.coverage
46
.dmypy.json
7+
.fleet
58
.idea
6-
.ipynb_checkpoints/
9+
.ipynb_checkpoints
710
.mypy_cache
8-
.vscode
911
.sandbox
12+
.vs
13+
.vscode
1014

1115
__pycache__
1216

.pre-commit-config.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.37.3
3+
rev: v3.2.2
44
hooks:
55
- id: pyupgrade
6-
args: [--py38-plus]
6+
args: [--py39-plus]
77
- repo: https://github.com/ikamensh/flynt/
8-
rev: '0.76'
8+
rev: '0.77'
99
hooks:
1010
- id: flynt
1111
- repo: https://github.com/psf/black
12-
rev: 22.6.0
12+
rev: 22.10.0
1313
hooks:
1414
- id: black
15-
language_version: python3.8
15+
language_version: python3.9
16+
- repo: https://github.com/keewis/blackdoc
17+
rev: v0.3.8
18+
hooks:
19+
- id: blackdoc
20+
language_version: python3.9
1621
- repo: https://github.com/PyCQA/flake8
17-
rev: 5.0.3
22+
rev: 6.0.0
1823
hooks:
1924
- id: flake8
2025
- repo: https://github.com/pycqa/pydocstyle

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-20.04
55
tools:
6-
python: "3.8"
6+
python: "3.11"
77

88
sphinx:
99
configuration: docs/conf.py

CONTRIBUTORS.rst

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

7-
- **Thomas Mansencal**, *Lead Pipeline Developer @ WetaFX*
7+
- **Thomas Mansencal**, *Technology Supervisor @ Wētā FX*
88

99
Project coordination, overall development.
1010

TODO.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ TODO
66

77
- colour_hdri/__init__.py
88

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

1111

1212
- colour_hdri/tonemapping/global_operators/operators.py
1313

14-
- Line 518 : # TODO: Implement automatic *p* and *non-uniform* computations support.
14+
- Line 593 : # TODO: Implement automatic *p* and *non-uniform* computations support.
1515

1616

1717
- colour_hdri/utilities/exif.py
1818

19-
- Line 314 : # TODO: Find a better name.
19+
- Line 319 : # TODO: Find a better name.
2020

2121

2222
- colour_hdri/utilities/image.py

colour_hdri/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,19 @@
228228
"tonemapping_operator_Tumblin1999",
229229
]
230230

231-
RESOURCES_DIRECTORY = os.path.join(os.path.dirname(__file__), "resources")
232-
EXAMPLES_RESOURCES_DIRECTORY = os.path.join(
233-
RESOURCES_DIRECTORY, "colour-hdri-examples-datasets"
231+
ROOT_RESOURCES = os.path.join(os.path.dirname(__file__), "resources")
232+
ROOT_RESOURCES_EXAMPLES = os.path.join(
233+
ROOT_RESOURCES, "colour-hdri-examples-datasets"
234234
)
235-
TESTS_RESOURCES_DIRECTORY = os.path.join(
236-
RESOURCES_DIRECTORY, "colour-hdri-tests-datasets"
235+
ROOT_RESOURCES_TESTS = os.path.join(
236+
ROOT_RESOURCES, "colour-hdri-tests-datasets"
237237
)
238238

239239
__application_name__ = "Colour - HDRI"
240240

241241
__major_version__ = "0"
242242
__minor_version__ = "2"
243-
__change_version__ = "0"
243+
__change_version__ = "1"
244244
__version__ = ".".join(
245245
(__major_version__, __minor_version__, __change_version__)
246246
)

colour_hdri/calibration/absolute_luminance.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ def upper_hemisphere_illuminance_weights_Lagarde2016(
113113
Examples
114114
--------
115115
>>> upper_hemisphere_illuminance_weights_Lagarde2016( # doctest: +ELLIPSIS
116-
... 16, 1)
116+
... 16, 1
117+
... )
117118
array([[ 0... ],
118119
[ 4.0143297...],
119120
[ 7.3345454...],
@@ -174,7 +175,8 @@ def absolute_luminance_calibration_Lagarde2016(
174175
--------
175176
>>> RGB = np.ones((4, 8, 3))
176177
>>> absolute_luminance_calibration_Lagarde2016( # doctest: +ELLIPSIS
177-
... RGB, 500)
178+
... RGB, 500
179+
... )
178180
array([[[ 233.9912506..., 233.9912506..., 233.9912506...],
179181
[ 233.9912506..., 233.9912506..., 233.9912506...],
180182
[ 233.9912506..., 233.9912506..., 233.9912506...],

colour_hdri/calibration/tests/test_absolute_luminance.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from colour import read_image
1414

15-
from colour_hdri import TESTS_RESOURCES_DIRECTORY
15+
from colour_hdri import ROOT_RESOURCES_TESTS
1616
from colour_hdri.calibration import (
1717
upper_hemisphere_illuminance_weights_Lagarde2016,
1818
absolute_luminance_calibration_Lagarde2016,
@@ -34,10 +34,10 @@
3434
"TestAbsoluteLuminanceCalibrationLagarde2016",
3535
]
3636

37-
UNITY_001_DIRECTORY: str = os.path.join(TESTS_RESOURCES_DIRECTORY, "unity_001")
37+
ROOT_RESOURCES_UNITY_001: str = os.path.join(ROOT_RESOURCES_TESTS, "unity_001")
3838

39-
CALIBRATION_DIRECTORY: str = os.path.join(
40-
TESTS_RESOURCES_DIRECTORY, "colour_hdri", "calibration"
39+
ROOT_RESOURCES_CALIBRATION: str = os.path.join(
40+
ROOT_RESOURCES_TESTS, "colour_hdri", "calibration"
4141
)
4242

4343

@@ -153,7 +153,7 @@ def test_absolute_luminance_calibration_Lagarde2016(self):
153153
reference_exr_file = read_image(
154154
str(
155155
os.path.join(
156-
UNITY_001_DIRECTORY,
156+
ROOT_RESOURCES_UNITY_001,
157157
"Unity_Treasure_Island_White_Balanced.exr",
158158
)
159159
)
@@ -162,7 +162,7 @@ def test_absolute_luminance_calibration_Lagarde2016(self):
162162
test_exr_file = read_image(
163163
str(
164164
os.path.join(
165-
CALIBRATION_DIRECTORY,
165+
ROOT_RESOURCES_CALIBRATION,
166166
"Unity_Treasure_Island_White_Balanced_Absolute.exr",
167167
)
168168
)

colour_hdri/calibration/tests/test_debevec1997.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from colour.hints import List
1414

15-
from colour_hdri import TESTS_RESOURCES_DIRECTORY
15+
from colour_hdri import ROOT_RESOURCES_TESTS
1616
from colour_hdri.calibration import (
1717
g_solve,
1818
camera_response_functions_Debevec1997,
@@ -29,22 +29,22 @@
2929
__status__ = "Production"
3030

3131
__all__ = [
32-
"FROBISHER_001_DIRECTORY",
33-
"CALIBRATION_DIRECTORY",
34-
"JPG_IMAGES",
32+
"ROOT_RESOURCES_FROBISHER_001",
33+
"ROOT_RESOURCES_CALIBRATION",
34+
"IMAGES_JPG",
3535
"TestGSolve",
3636
"TestCameraResponseFunctionsDebevec1997",
3737
]
3838

39-
FROBISHER_001_DIRECTORY: str = os.path.join(
40-
TESTS_RESOURCES_DIRECTORY, "frobisher_001"
39+
ROOT_RESOURCES_FROBISHER_001: str = os.path.join(
40+
ROOT_RESOURCES_TESTS, "frobisher_001"
4141
)
4242

43-
CALIBRATION_DIRECTORY: str = os.path.join(
44-
TESTS_RESOURCES_DIRECTORY, "colour_hdri", "calibration"
43+
ROOT_RESOURCES_CALIBRATION: str = os.path.join(
44+
ROOT_RESOURCES_TESTS, "colour_hdri", "calibration"
4545
)
4646

47-
JPG_IMAGES: List[str] = filter_files(FROBISHER_001_DIRECTORY, ("jpg",))
47+
IMAGES_JPG: List[str] = filter_files(ROOT_RESOURCES_FROBISHER_001, ("jpg",))
4848

4949

5050
class TestGSolve(unittest.TestCase):
@@ -56,7 +56,7 @@ class TestGSolve(unittest.TestCase):
5656
def test_g_solve(self):
5757
"""Test :func:`colour_hdri.calibration.debevec1997.g_solve` definition."""
5858

59-
image_stack = ImageStack.from_files(JPG_IMAGES)
59+
image_stack = ImageStack.from_files(IMAGES_JPG)
6060
L_l = np.log(
6161
1
6262
/ average_luminance(
@@ -75,7 +75,7 @@ def test_g_solve(self):
7575
g,
7676
np.load(
7777
os.path.join(
78-
CALIBRATION_DIRECTORY, f"test_g_solve_g_{i}.npy"
78+
ROOT_RESOURCES_CALIBRATION, f"test_g_solve_g_{i}.npy"
7979
)
8080
),
8181
rtol=0.001,
@@ -87,7 +87,7 @@ def test_g_solve(self):
8787
lE,
8888
np.load(
8989
os.path.join(
90-
CALIBRATION_DIRECTORY, f"test_g_solve_lE_{i}.npy"
90+
ROOT_RESOURCES_CALIBRATION, f"test_g_solve_lE_{i}.npy"
9191
)
9292
),
9393
rtol=0.001,
@@ -110,11 +110,11 @@ def test_camera_response_function_Debevec1997(self):
110110
# Lower precision for unit tests under *Github Actions*.
111111
np.testing.assert_allclose(
112112
camera_response_functions_Debevec1997(
113-
ImageStack.from_files(JPG_IMAGES)
113+
ImageStack.from_files(IMAGES_JPG)
114114
),
115115
np.load(
116116
os.path.join(
117-
CALIBRATION_DIRECTORY,
117+
ROOT_RESOURCES_CALIBRATION,
118118
"test_camera_response_function_Debevec1997_crfs.npy",
119119
)
120120
),

colour_hdri/distortion/tests/test_vignette.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import unittest
1111

12-
from colour_hdri import TESTS_RESOURCES_DIRECTORY
12+
from colour_hdri import ROOT_RESOURCES_TESTS
1313
from colour_hdri.distortion import (
1414
apply_radial_gradient,
1515
parabolic_2D_function,
@@ -49,7 +49,7 @@
4949
]
5050

5151
DIRECTORY_DISTORTION: str = os.path.join(
52-
TESTS_RESOURCES_DIRECTORY, "colour_hdri", "distortion"
52+
ROOT_RESOURCES_TESTS, "colour_hdri", "distortion"
5353
)
5454

5555

0 commit comments

Comments
 (0)