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 Jun 27, 2024
2 parents dfd5930 + 7054cce commit ff4a27e
Show file tree
Hide file tree
Showing 39 changed files with 256 additions and 379 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
python-version: [3.12]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [macOS-latest, ubuntu-22.04, windows-latest]
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.9, "3.10", 3.11, 3.12]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
brew install --cask adobe-dng-converter
shell: bash
- 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
Expand Down
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion 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
12 changes: 3 additions & 9 deletions colour_hdri/calibration/tests/test_absolute_luminance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# !/usr/bin/env python
"""
Define the unit tests for the
:mod:`colour_hdri.calibration.absolute_luminance` module.
Expand All @@ -7,7 +6,6 @@
from __future__ import annotations

import os
import unittest

import numpy as np
from colour import read_image
Expand Down Expand Up @@ -42,7 +40,7 @@
)


class TestUpperHemisphereIlluminanceLagarde2016(unittest.TestCase):
class TestUpperHemisphereIlluminanceLagarde2016:
"""
Define :func:`colour_hdri.calibration.absolute_luminance.\
upper_hemisphere_illuminance_Lagarde2016` definition unit tests methods.
Expand Down Expand Up @@ -73,7 +71,7 @@ def test_upper_hemisphere_illuminance_Lagarde2016(self):
)


class TestUpperHemisphereIlluminanceWeightsLagarde2016(unittest.TestCase):
class TestUpperHemisphereIlluminanceWeightsLagarde2016:
"""
Define :func:`colour_hdri.calibration.absolute_luminance.\
upper_hemisphere_illuminance_weights_Lagarde2016` definition unit tests
Expand Down Expand Up @@ -130,7 +128,7 @@ def test_upper_hemisphere_illuminance_weights_Lagarde2016(self):
)


class TestAbsoluteLuminanceCalibrationLagarde2016(unittest.TestCase):
class TestAbsoluteLuminanceCalibrationLagarde2016:
"""
Define :func:`colour_hdri.calibration.absolute_luminance.\
absolute_luminance_calibration_Lagarde2016` definition unit tests methods.
Expand Down Expand Up @@ -171,7 +169,3 @@ def test_absolute_luminance_calibration_Lagarde2016(self):
rtol=0.0000001,
atol=0.0000001,
)


if __name__ == "__main__":
unittest.main()
10 changes: 2 additions & 8 deletions colour_hdri/calibration/tests/test_debevec1997.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# !/usr/bin/env python
"""
Define the unit tests for the :mod:`colour_hdri.calibration.debevec1997`
module.
Expand All @@ -7,7 +6,6 @@
from __future__ import annotations

import os
import unittest

import numpy as np
from colour.hints import List
Expand Down Expand Up @@ -45,7 +43,7 @@
IMAGES_JPG: List[str] = filter_files(ROOT_RESOURCES_FROBISHER_001, ("jpg",))


class TestGSolve(unittest.TestCase):
class TestGSolve:
"""
Define :func:`colour_hdri.calibration.debevec1997.g_solve` definition
unit tests methods.
Expand Down Expand Up @@ -87,7 +85,7 @@ def test_g_solve(self):
)


class TestCameraResponseFunctionsDebevec1997(unittest.TestCase):
class TestCameraResponseFunctionsDebevec1997:
"""
Define :func:`colour_hdri.calibration.debevec1997.\
camera_response_functions_Debevec1997` definition unit tests methods.
Expand All @@ -110,7 +108,3 @@ def test_camera_response_function_Debevec1997(self):
),
atol=0.00001,
)


if __name__ == "__main__":
unittest.main()
30 changes: 12 additions & 18 deletions colour_hdri/distortion/tests/test_vignette.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# !/usr/bin/env python
"""
Define the unit tests for the :mod:`colour_hdri.distortion.vignette` module.
"""

from __future__ import annotations

import os
import unittest

import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
Expand Down Expand Up @@ -55,7 +53,7 @@
)


class TestApplyRadialGradient(unittest.TestCase):
class TestApplyRadialGradient:
"""
Define :func:`colour_hdri.distortion.vignette.apply_radial_gradient`
definition unit tests methods.
Expand Down Expand Up @@ -122,7 +120,7 @@ def test_apply_radial_gradient(self):
)


class TestParabolic2DFunction(unittest.TestCase):
class TestParabolic2DFunction:
"""
Define :func:`colour_hdri.distortion.vignette.parabolic_2D_function`
definition unit tests methods.
Expand Down Expand Up @@ -194,7 +192,7 @@ def test_parabolic_2D_function(self):
)


class TestHyperbolicCosine2DFunction(unittest.TestCase):
class TestHyperbolicCosine2DFunction:
"""
Define :func:`colour_hdri.distortion.vignette.hyperbolic_cosine_2D_function`
definition unit tests methods.
Expand Down Expand Up @@ -266,7 +264,7 @@ def test_hyperbolic_cosine_2D_function(self):
)


class TestVignettePrincipalPoint(unittest.TestCase):
class TestVignettePrincipalPoint:
"""
Define :func:`colour_hdri.distortion.vignette.vignette_principal_point`
definition unit tests methods.
Expand All @@ -285,7 +283,7 @@ def test_vignette_principal_point(self):
)


class TestCharacteriseVignette2DFunction(unittest.TestCase):
class TestCharacteriseVignette2DFunction:
"""
Define :func:`colour_hdri.distortion.vignette.\
characterise_vignette_2D_function` definition unit tests methods.
Expand Down Expand Up @@ -378,7 +376,7 @@ def test_characterise_vignette_2D_function(self):
)


class TestCorrectVignette2DFunction(unittest.TestCase):
class TestCorrectVignette2DFunction:
"""
Define :func:`colour_hdri.distortion.vignette.correct_vignette_2D_function`
definition unit tests methods.
Expand Down Expand Up @@ -508,7 +506,7 @@ def test_correct_vignette_2D_function(self):
)


class TestCharacteriseVignetteBivariateSpline(unittest.TestCase):
class TestCharacteriseVignetteBivariateSpline:
"""
Define :func:`colour_hdri.distortion.vignette.\
characterise_vignette_bivariate_spline` definition unit tests methods.
Expand Down Expand Up @@ -541,7 +539,7 @@ def test_characterise_vignette_bivariate_spline(self):
)


class TestCorrectVignetteBivariateSpline(unittest.TestCase):
class TestCorrectVignetteBivariateSpline:
"""
Define :func:`colour_hdri.distortion.vignette.\
correct_vignette_bivariate_spline` definition unit tests methods.
Expand Down Expand Up @@ -611,7 +609,7 @@ def test_correct_vignette_bivariate_spline(self):
)


class TestRadialSamplingFunction(unittest.TestCase):
class TestRadialSamplingFunction:
"""
Define :func:`colour_hdri.distortion.vignette.radial_sampling_function`
definition unit tests methods.
Expand Down Expand Up @@ -822,7 +820,7 @@ def test_radial_sampling_function(self):
)


class TestVignetteSamplingCoordinates(unittest.TestCase):
class TestVignetteSamplingCoordinates:
"""
Define :func:`colour_hdri.distortion.vignette.vignette_sampling_coordinates`
definition unit tests methods.
Expand Down Expand Up @@ -1009,7 +1007,7 @@ def test_vignette_sampling_coordinates(self):
)


class TestCharacteriseVignetteRBF(unittest.TestCase):
class TestCharacteriseVignetteRBF:
"""
Define :func:`colour_hdri.distortion.vignette.characterise_vignette_RBF`
definition unit tests methods.
Expand Down Expand Up @@ -1211,7 +1209,7 @@ def test_characterise_vignette_RBF(self):
)


class TestCorrectVignetteRBF(unittest.TestCase):
class TestCorrectVignetteRBF:
"""
Define :func:`colour_hdri.distortion.vignette.correct_vignette_RBF`
definition unit tests methods.
Expand Down Expand Up @@ -1279,7 +1277,3 @@ def test_correct_vignette_RBF(self):
),
atol=TOLERANCE_ABSOLUTE_TESTS,
)


if __name__ == "__main__":
unittest.main()
6 changes: 4 additions & 2 deletions colour_hdri/distortion/vignette.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Lens Vignette Characterisation & Correction
===========================================
Defines various objects to correct camera lens vignette:
Define various objects to correct camera lens vignette:
- :func:`colour_hdri.distortion.apply_radial_gradient`
- :func:`colour_hdri.distortion.parabolic_2D_function`
Expand Down Expand Up @@ -944,7 +944,9 @@ def correct_vignette_RBF(
epsilon=epsilon,
)

I_v = interpolator(tstack([y_1, x_1]).reshape([-1, 2])).reshape(height, width)
I_v = np.reshape(
interpolator(np.reshape(tstack([y_1, x_1]), (-1, 2))), (height, width)
)

image[..., i] /= I_v

Expand Down
2 changes: 1 addition & 1 deletion colour_hdri/exposure/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Exposure Value Computation
==========================
Defines the exposure value computation objects:
Define the exposure value computation objects:
- :func:`colour_hdri.average_luminance`
- :func:`colour_hdri.average_illuminance`
Expand Down
2 changes: 1 addition & 1 deletion colour_hdri/exposure/dsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Digital Still Camera Exposure
=============================
Defines various objects for modeling Digital Still Camera (DSC) exposure:
Define various objects for modeling Digital Still Camera (DSC) exposure:
- :func:`colour_hdri.focal_plane_exposure`
- :func:`colour_hdri.arithmetic_mean_focal_plane_exposure`
Expand Down
16 changes: 5 additions & 11 deletions colour_hdri/exposure/tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour_hdri.exposure.common` module."""

import unittest

import numpy as np
from colour.constants import TOLERANCE_ABSOLUTE_TESTS
Expand Down Expand Up @@ -29,7 +27,7 @@
]


class TestAverageLuminance(unittest.TestCase):
class TestAverageLuminance:
"""
Define :func:`colour_hdri.exposure.common.average_luminance` definition
unit tests methods.
Expand All @@ -49,7 +47,7 @@ def test_average_luminance(self):
)


class TestAverageIlluminance(unittest.TestCase):
class TestAverageIlluminance:
"""
Define :func:`colour_hdri.exposure.common.average_illuminance` definition
unit tests methods.
Expand All @@ -72,7 +70,7 @@ def test_average_illuminance(self):
)


class TestLuminanceToExposureValue(unittest.TestCase):
class TestLuminanceToExposureValue:
"""
Define :func:`colour_hdri.exposure.common.luminance_to_exposure_value`
definition unit tests methods.
Expand All @@ -95,7 +93,7 @@ def test_luminance_to_exposure_value(self):
)


class TestIlluminanceToExposureValue(unittest.TestCase):
class TestIlluminanceToExposureValue:
"""
Define :func:`colour_hdri.exposure.common.illuminance_to_exposure_value`
definition unit tests methods.
Expand All @@ -118,7 +116,7 @@ def test_illuminance_to_exposure_value(self):
)


class TestAdjustExposure(unittest.TestCase):
class TestAdjustExposure:
"""
Define :func:`colour_hdri.exposure.common.adjust_exposure` definition
unit tests methods.
Expand All @@ -132,7 +130,3 @@ def test_adjust_exposure(self):
np.array([0.5, 1.0, 1.5, 2.0]),
atol=TOLERANCE_ABSOLUTE_TESTS,
)


if __name__ == "__main__":
unittest.main()
Loading

0 comments on commit ff4a27e

Please sign in to comment.