diff --git a/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py b/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py index 619b902..386c7be 100644 --- a/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py +++ b/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py @@ -11,6 +11,7 @@ import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour_demosaicing import ROOT_RESOURCES_TESTS from colour_demosaicing.bayer import demosaicing_CFA_Bayer_bilinear @@ -52,12 +53,12 @@ def test_demosaicing_CFA_Bayer_bilinear(self): ROOT_RESOURCES_BAYER, f"Lighthouse_Bilinear_{pattern}.exr" ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( demosaicing_CFA_Bayer_bilinear( read_image(str(CFA))[..., 0], pattern ), read_image(str(RGB)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py b/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py index a49ecff..7eb5d59 100644 --- a/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py +++ b/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py @@ -11,6 +11,7 @@ import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour_demosaicing import ROOT_RESOURCES_TESTS from colour_demosaicing.bayer import demosaicing_CFA_Bayer_Malvar2004 @@ -52,12 +53,12 @@ def test_demosaicing_CFA_Bayer_Malvar2004(self): ROOT_RESOURCES_BAYER, f"Lighthouse_Malvar2004_{pattern}.exr" ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( demosaicing_CFA_Bayer_Malvar2004( read_image(str(CFA))[..., 0], pattern ), read_image(str(RGB)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py b/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py index ce4a02f..b04bbd1 100644 --- a/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py +++ b/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py @@ -11,6 +11,7 @@ import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour_demosaicing import ROOT_RESOURCES_TESTS from colour_demosaicing.bayer import demosaicing_CFA_Bayer_Menon2007 @@ -52,25 +53,25 @@ def test_demosaicing_CFA_Bayer_Menon2007(self): ROOT_RESOURCES_BAYER, f"Lighthouse_Menon2007_{pattern}.exr" ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( demosaicing_CFA_Bayer_Menon2007( read_image(str(CFA))[..., 0], pattern ), read_image(str(RGB)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) RGB = os.path.join( ROOT_RESOURCES_BAYER, f"Lighthouse_Menon2007_NR_{pattern}.exr" ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( demosaicing_CFA_Bayer_Menon2007( read_image(str(CFA))[..., 0], pattern, refining_step=False, ), read_image(str(RGB)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_demosaicing/bayer/tests/test_masks.py b/colour_demosaicing/bayer/tests/test_masks.py index b002524..2f98d08 100644 --- a/colour_demosaicing/bayer/tests/test_masks.py +++ b/colour_demosaicing/bayer/tests/test_masks.py @@ -8,6 +8,7 @@ import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour.utilities import tstack from colour_demosaicing import ROOT_RESOURCES_TESTS @@ -44,10 +45,10 @@ def test_masks_CFA_Bayer(self): for pattern in ("RGGB", "BGGR", "GRBG", "GBRG"): mask = os.path.join(ROOT_RESOURCES_BAYER, f"{pattern}_Masks.exr") - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( tstack(masks_CFA_Bayer((8, 8), pattern)), read_image(str(mask)), - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/colour_demosaicing/bayer/tests/test_mosaicing.py b/colour_demosaicing/bayer/tests/test_mosaicing.py index 94c7072..562dc79 100644 --- a/colour_demosaicing/bayer/tests/test_mosaicing.py +++ b/colour_demosaicing/bayer/tests/test_mosaicing.py @@ -11,6 +11,7 @@ import numpy as np from colour import read_image +from colour.constants import TOLERANCE_ABSOLUTE_TESTS from colour_demosaicing import ROOT_RESOURCES_TESTS from colour_demosaicing.bayer import mosaicing_CFA_Bayer @@ -52,10 +53,10 @@ def test_mosaicing_CFA_Bayer(self): CFA = os.path.join( ROOT_RESOURCES_BAYER, f"Lighthouse_CFA_{pattern}.exr" ) - np.testing.assert_array_almost_equal( + np.testing.assert_allclose( mosaicing_CFA_Bayer(image, pattern), read_image(str(CFA))[..., 0], - decimal=7, + atol=TOLERANCE_ABSOLUTE_TESTS, )