Skip to content

Commit

Permalink
Merge branch 'feature/v0.2.4' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Feb 4, 2024
2 parents 1c7d8bf + 59c5432 commit dfd5930
Show file tree
Hide file tree
Showing 38 changed files with 160 additions and 362 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
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 @@ -30,8 +30,6 @@ jobs:
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true
- name: Environment Variables
Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
- 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
curl -L https://exiftool.org/exiftool-12.74.zip -o exiftool-12.74.zip
unzip -d exiftool exiftool-12.74.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
Expand All @@ -66,8 +66,6 @@ jobs:
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
Expand All @@ -91,6 +89,7 @@ jobs:
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
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
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
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
Expand Down
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ 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:
Expand All @@ -46,7 +42,6 @@ repos:
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
6 changes: 3 additions & 3 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 @@ -84,8 +84,8 @@ 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
12 changes: 3 additions & 9 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__)
)
__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: 1 addition & 3 deletions colour_hdri/calibration/debevec1997.py
Original file line number Diff line number Diff line change
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
12 changes: 3 additions & 9 deletions colour_hdri/calibration/tests/test_absolute_luminance.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,13 @@ def test_upper_hemisphere_illuminance_Lagarde2016(self):
)

np.testing.assert_allclose(
upper_hemisphere_illuminance_Lagarde2016(
np.ones((16, 32, 3)) * 10
),
upper_hemisphere_illuminance_Lagarde2016(np.ones((16, 32, 3)) * 10),
29.344691653426061,
atol=TOLERANCE_ABSOLUTE_TESTS,
)

np.testing.assert_allclose(
upper_hemisphere_illuminance_Lagarde2016(
np.ones((16, 32, 3)) * 0.1
),
upper_hemisphere_illuminance_Lagarde2016(np.ones((16, 32, 3)) * 0.1),
0.293446916534261,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
Expand Down Expand Up @@ -170,9 +166,7 @@ def test_absolute_luminance_calibration_Lagarde2016(self):
)

np.testing.assert_allclose(
absolute_luminance_calibration_Lagarde2016(
reference_exr_file, 51000
),
absolute_luminance_calibration_Lagarde2016(reference_exr_file, 51000),
test_exr_file,
rtol=0.0000001,
atol=0.0000001,
Expand Down
16 changes: 4 additions & 12 deletions colour_hdri/calibration/tests/test_debevec1997.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
"TestCameraResponseFunctionsDebevec1997",
]

ROOT_RESOURCES_FROBISHER_001: str = os.path.join(
ROOT_RESOURCES_TESTS, "frobisher_001"
)
ROOT_RESOURCES_FROBISHER_001: str = os.path.join(ROOT_RESOURCES_TESTS, "frobisher_001")

ROOT_RESOURCES_CALIBRATION: str = os.path.join(
ROOT_RESOURCES_TESTS, "colour_hdri", "calibration"
Expand Down Expand Up @@ -74,9 +72,7 @@ def test_g_solve(self):
np.testing.assert_allclose(
g,
np.load(
os.path.join(
ROOT_RESOURCES_CALIBRATION, f"test_g_solve_g_{i}.npy"
)
os.path.join(ROOT_RESOURCES_CALIBRATION, f"test_g_solve_g_{i}.npy")
),
atol=0.001,
)
Expand All @@ -85,9 +81,7 @@ def test_g_solve(self):
np.testing.assert_allclose(
lE,
np.load(
os.path.join(
ROOT_RESOURCES_CALIBRATION, f"test_g_solve_lE_{i}.npy"
)
os.path.join(ROOT_RESOURCES_CALIBRATION, f"test_g_solve_lE_{i}.npy")
),
atol=0.001,
)
Expand All @@ -107,9 +101,7 @@ def test_camera_response_function_Debevec1997(self):

# Lower precision for unit tests under *Github Actions*.
np.testing.assert_allclose(
camera_response_functions_Debevec1997(
ImageStack.from_files(IMAGES_JPG)
),
camera_response_functions_Debevec1997(ImageStack.from_files(IMAGES_JPG)),
np.load(
os.path.join(
ROOT_RESOURCES_CALIBRATION,
Expand Down
4 changes: 1 addition & 3 deletions colour_hdri/distortion/tests/test_vignette.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,7 @@ def test_vignette_principal_point(self):
"""

np.testing.assert_allclose(
vignette_principal_point(
apply_radial_gradient(np.ones([50, 70, 3]))
),
vignette_principal_point(apply_radial_gradient(np.ones([50, 70, 3]))),
np.array([0.49000000, 0.49285714]),
atol=TOLERANCE_ABSOLUTE_TESTS,
)
Expand Down
Loading

0 comments on commit dfd5930

Please sign in to comment.