From 6aa6766457f00bb3eae1b3cddbd07ed4d0b24748 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 15:48:54 +0100 Subject: [PATCH 01/16] refactor Eyring reverberation time calculation - update input variable names - extend docstring - update tests --- pyrato/parametric.py | 70 ++++++++++++++++++++++----------- tests/test_parametric_eyring.py | 10 ++--- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index cc00a3ff..21609b79 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -214,46 +214,70 @@ def mean_free_path( return 4 * volume / surface_area -def reverberation_time_eyring(volume,surface,mean_alpha): +def reverberation_time_eyring( + volume, surface_area, mean_absorption, speed_of_sound=343.4, + ): r""" - function which calculates reverberation time in rooms as - defined by Carl F. Eyring. + Calculate the reverberation time in rooms as defined by Carl Eyring. + + The reverberation time is calculated according to Ref. [#]_ as .. math:: - T_{60} = -0.161 \frac{\text{volume}}{\text{surface} \cdot - \ln(1 - \text{mean\_alpha})} + T_{60} = \frac{24 \cdot \ln(10)}{c} + \cdot \frac{V}{S \ln(1 - \tilde{\alpha})} + + where :math:`V` is the room volume, :math:`S` is the total surface area + of the room, :math:`\tilde{\alpha}` is the average absorption coefficient + of the room surfaces, and :math:`c` is the speed of sound. Parameters ---------- - volume : float, np.ndarray - Room volume in m3 - surface : float, np.ndarray - Surface areas of all surfaces in the room in m2 - mean_alpha : float, np.ndarray - Average absorption coefficient of room surfaces + volume : float + Room volume in :math:`\mathrm{m}^3` + surface : float + Total surface area of the room in :math:`\mathrm{m}^2` + mean_absorption : float, numpy.ndarray + Average absorption coefficient of room surfaces between 0 and 1. If + an array is passed, the reverberation time is calculated for each value + in the array. + speed_of_sound : float, numpy.ndarray + Speed of sound in m/s. Default is 343.4 m/s, which corresponds to the + speed of sound in air at 20 °C. Returns ------- - reverberation_time_eyring: double - Eyring reverberation time in s + float, numpy.ndarray + Reverberation time in seconds. The shape matches the shape of the input + variable `mean_absorption`. + + Examples + -------- + + >>> from pyrato.parametric import reverberation_time_eyring + >>> import numpy as np + >>> volume = 64 + >>> surface_area = 96 + >>> mean_absorption = [0.1, 0.3, 0.4] + >>> reverb_time = reverberation_time_eyring( + >>> volume, surface_area, mean_absorption) + >>> np.round(reverb_time, 2) References ---------- - .. [#] Eyring, C.F., 1930. Reverberation time in “dead” rooms. The Journal - of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. + .. [#] Eyring, C.F., 1930. Reverberation time in "dead" rooms. The Journal + of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. """ - - if volume <= 0: + mean_absorption = np.asarray(mean_absorption) + if np.any(volume) <= 0: raise ValueError("Volume should be larger than 0") - if surface <= 0: + if np.any(surface_area) <= 0: raise ValueError("Surface should be larger than 0") - if mean_alpha <0 or mean_alpha >1: - raise ValueError("mean_alpha should be between 0 and 1") - - T60 = -0.161 * (volume / (surface * np.log(1 - mean_alpha))) + if np.any(mean_absorption < 0) or np.any(mean_absorption > 1): + raise ValueError("mean_absorption should be between 0 and 1") - return T60 + factor = 24 * np.log(10) / speed_of_sound + return -factor * (volume / (surface_area * np.log(1 - mean_absorption))) def calculate_sabine_reverberation_time(surfaces, alphas, volume): diff --git a/tests/test_parametric_eyring.py b/tests/test_parametric_eyring.py index 757a3c2e..f9967faa 100644 --- a/tests/test_parametric_eyring.py +++ b/tests/test_parametric_eyring.py @@ -7,20 +7,18 @@ def test_analytic_Eyring(): volume = 64 surface = 96 mean_alpha = 0.2 - reverb_test = reverberation_time_eyring(volume,surface,mean_alpha) + reverb_test = reverberation_time_eyring(volume, surface, mean_alpha) npt.assert_allclose(reverb_test, 0.481, rtol=1e-3) @pytest.mark.parametrize("volume, surface", [(0, -2), (-1, 0)]) def test_input_geometry_Eyring(volume, surface): mean_alpha = 0.2 with pytest.raises(ValueError, match="should be larger than 0"): - reverberation_time_eyring(volume,surface,mean_alpha) + reverberation_time_eyring(volume, surface, mean_alpha) @pytest.mark.parametrize("mean_alpha", [-1, 2]) def test_input_alpha_Eyring(mean_alpha): volume = 64 surface = 96 - with pytest.raises( - ValueError, match="mean_alpha should be between 0 and 1" - ): - reverberation_time_eyring(volume,surface,mean_alpha) + with pytest.raises(ValueError, match="should be between 0 and 1"): + reverberation_time_eyring(volume, surface, mean_alpha) From 49050488e63c45b0d766e756210899ee10d6e669 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 16:17:55 +0100 Subject: [PATCH 02/16] - Add type hints - formatting and linting fixes --- pyrato/parametric.py | 12 +++++++----- tests/test_parametric_eyring.py | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 21609b79..1978d7cd 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -215,7 +215,10 @@ def mean_free_path( def reverberation_time_eyring( - volume, surface_area, mean_absorption, speed_of_sound=343.4, + volume: float, + surface_area: float, + mean_absorption: np.typing.NDArray[float], + speed_of_sound: float = 343.4, ): r""" Calculate the reverberation time in rooms as defined by Carl Eyring. @@ -234,13 +237,13 @@ def reverberation_time_eyring( ---------- volume : float Room volume in :math:`\mathrm{m}^3` - surface : float + surface_area : float Total surface area of the room in :math:`\mathrm{m}^2` mean_absorption : float, numpy.ndarray Average absorption coefficient of room surfaces between 0 and 1. If an array is passed, the reverberation time is calculated for each value in the array. - speed_of_sound : float, numpy.ndarray + speed_of_sound : float Speed of sound in m/s. Default is 343.4 m/s, which corresponds to the speed of sound in air at 20 °C. @@ -252,7 +255,6 @@ def reverberation_time_eyring( Examples -------- - >>> from pyrato.parametric import reverberation_time_eyring >>> import numpy as np >>> volume = 64 @@ -272,7 +274,7 @@ def reverberation_time_eyring( if np.any(volume) <= 0: raise ValueError("Volume should be larger than 0") if np.any(surface_area) <= 0: - raise ValueError("Surface should be larger than 0") + raise ValueError("Surface area should be larger than 0") if np.any(mean_absorption < 0) or np.any(mean_absorption > 1): raise ValueError("mean_absorption should be between 0 and 1") diff --git a/tests/test_parametric_eyring.py b/tests/test_parametric_eyring.py index f9967faa..6cab4698 100644 --- a/tests/test_parametric_eyring.py +++ b/tests/test_parametric_eyring.py @@ -1,4 +1,4 @@ -"""Tests for Eyring's equation""" +"""Tests for Eyring's equation.""" import numpy.testing as npt import pytest from pyrato.parametric import reverberation_time_eyring @@ -10,7 +10,7 @@ def test_analytic_Eyring(): reverb_test = reverberation_time_eyring(volume, surface, mean_alpha) npt.assert_allclose(reverb_test, 0.481, rtol=1e-3) -@pytest.mark.parametrize("volume, surface", [(0, -2), (-1, 0)]) +@pytest.mark.parametrize(("volume", "surface"), [(0, -2), (-1, 0)]) def test_input_geometry_Eyring(volume, surface): mean_alpha = 0.2 with pytest.raises(ValueError, match="should be larger than 0"): From 10a3ff4f68ea6f237d8c84b8ad57221dbec803f0 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 16:19:12 +0100 Subject: [PATCH 03/16] improve grouping of input checks --- pyrato/parametric.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 1978d7cd..abf4e37a 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -270,11 +270,12 @@ def reverberation_time_eyring( of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. """ - mean_absorption = np.asarray(mean_absorption) if np.any(volume) <= 0: raise ValueError("Volume should be larger than 0") if np.any(surface_area) <= 0: raise ValueError("Surface area should be larger than 0") + + mean_absorption = np.asarray(mean_absorption) if np.any(mean_absorption < 0) or np.any(mean_absorption > 1): raise ValueError("mean_absorption should be between 0 and 1") From a75b430c4c02cc482a3d463a4cfb89eac8925157 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:00:06 +0100 Subject: [PATCH 04/16] Add return in example Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyrato/parametric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index abf4e37a..92375c6a 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -263,7 +263,7 @@ def reverberation_time_eyring( >>> reverb_time = reverberation_time_eyring( >>> volume, surface_area, mean_absorption) >>> np.round(reverb_time, 2) - + array([1.02, 0.3 , 0.21]) References ---------- .. [#] Eyring, C.F., 1930. Reverberation time in "dead" rooms. The Journal From 1a788586adcec45fab6044f8edf618d5533896ef Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:00:25 +0100 Subject: [PATCH 05/16] formatting example Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyrato/parametric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 92375c6a..75bde2ce 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -261,7 +261,7 @@ def reverberation_time_eyring( >>> surface_area = 96 >>> mean_absorption = [0.1, 0.3, 0.4] >>> reverb_time = reverberation_time_eyring( - >>> volume, surface_area, mean_absorption) + ... volume, surface_area, mean_absorption) >>> np.round(reverb_time, 2) array([1.02, 0.3 , 0.21]) References From 58699116036ee1beb4bd9c476b477c8459349729 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:11:56 +0100 Subject: [PATCH 06/16] update typing --- pyrato/parametric.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 75bde2ce..42cfaa75 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -4,6 +4,7 @@ such as Sabine's theory of sound in rooms. """ import numpy as np +from typing import Union def calculate_speed_of_sound(temperature): r"""Calculate the speed of sound in air depending on the temperature. @@ -217,7 +218,7 @@ def mean_free_path( def reverberation_time_eyring( volume: float, surface_area: float, - mean_absorption: np.typing.NDArray[float], + mean_absorption: Union[float, np.typing.NDArray[float]], speed_of_sound: float = 343.4, ): r""" From f2d1a3293de8e10bbc66920396373e71754b9626 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:12:08 +0100 Subject: [PATCH 07/16] fix obsolete use of np.any --- pyrato/parametric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 42cfaa75..274de6de 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -271,9 +271,9 @@ def reverberation_time_eyring( of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. """ - if np.any(volume) <= 0: + if volume <= 0: raise ValueError("Volume should be larger than 0") - if np.any(surface_area) <= 0: + if surface_area <= 0: raise ValueError("Surface area should be larger than 0") mean_absorption = np.asarray(mean_absorption) From 10babb206aa08473bceead6aa11033fd369dd563 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:12:37 +0100 Subject: [PATCH 08/16] update tests & explicitly include edge cases for absorption --- pyrato/parametric.py | 10 +++++++++- tests/test_parametric_eyring.py | 34 ++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 274de6de..990889f4 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -281,7 +281,15 @@ def reverberation_time_eyring( raise ValueError("mean_absorption should be between 0 and 1") factor = 24 * np.log(10) / speed_of_sound - return -factor * (volume / (surface_area * np.log(1 - mean_absorption))) + + reverberation_time = -factor * ( + volume/(surface_area * np.log(1 - mean_absorption))) + + mask = np.isclose(mean_absorption, 0, atol=1e-10, rtol=1e-10) + + reverberation_time = np.where(mask, np.inf, reverberation_time) + + return reverberation_time def calculate_sabine_reverberation_time(surfaces, alphas, volume): diff --git a/tests/test_parametric_eyring.py b/tests/test_parametric_eyring.py index 6cab4698..b562fb26 100644 --- a/tests/test_parametric_eyring.py +++ b/tests/test_parametric_eyring.py @@ -2,23 +2,31 @@ import numpy.testing as npt import pytest from pyrato.parametric import reverberation_time_eyring +import numpy as np -def test_analytic_Eyring(): +@pytest.mark.parametrize( + ("mean_absorption", "expected"), + [ + ([0.2, 0.2], [0.481, 0.481]), + (1, 0), + (0, np.inf), + ([0, 1, 0], [np.inf, 0, np.inf]), + ]) +def test_analytic_Eyring(mean_absorption, expected): volume = 64 - surface = 96 - mean_alpha = 0.2 - reverb_test = reverberation_time_eyring(volume, surface, mean_alpha) - npt.assert_allclose(reverb_test, 0.481, rtol=1e-3) + surface_area = 96 + reverb_test = reverberation_time_eyring(volume, surface_area, mean_absorption) + npt.assert_allclose(reverb_test, expected, rtol=1e-3) -@pytest.mark.parametrize(("volume", "surface"), [(0, -2), (-1, 0)]) -def test_input_geometry_Eyring(volume, surface): - mean_alpha = 0.2 +@pytest.mark.parametrize(("volume", "surface_area"), [(0, -2), (-1, 0)]) +def test_input_geometry_Eyring(volume, surface_area): + mean_absorption = 0.2 with pytest.raises(ValueError, match="should be larger than 0"): - reverberation_time_eyring(volume, surface, mean_alpha) + reverberation_time_eyring(volume, surface_area, mean_absorption) -@pytest.mark.parametrize("mean_alpha", [-1, 2]) -def test_input_alpha_Eyring(mean_alpha): +@pytest.mark.parametrize("mean_absorption", [-1, 2]) +def test_input_absorption_Eyring(mean_absorption): volume = 64 - surface = 96 + surface_area = 96 with pytest.raises(ValueError, match="should be between 0 and 1"): - reverberation_time_eyring(volume, surface, mean_alpha) + reverberation_time_eyring(volume, surface_area, mean_absorption) From e1517d1627d9d04e555a6477fb15e44a7c284448 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:39:33 +0100 Subject: [PATCH 09/16] Add check speed of sound negative --- pyrato/parametric.py | 2 ++ tests/test_parametric_eyring.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 990889f4..dd9d4f85 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -271,6 +271,8 @@ def reverberation_time_eyring( of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. """ + if speed_of_sound <= 0: + raise ValueError("Speed of sound should be larger than 0") if volume <= 0: raise ValueError("Volume should be larger than 0") if surface_area <= 0: diff --git a/tests/test_parametric_eyring.py b/tests/test_parametric_eyring.py index b562fb26..c8b42df4 100644 --- a/tests/test_parametric_eyring.py +++ b/tests/test_parametric_eyring.py @@ -30,3 +30,12 @@ def test_input_absorption_Eyring(mean_absorption): surface_area = 96 with pytest.raises(ValueError, match="should be between 0 and 1"): reverberation_time_eyring(volume, surface_area, mean_absorption) + +def test_error_speed_of_sound_Eyring(): + volume = 64 + surface_area = 96 + mean_absorption = 0.2 + with pytest.raises(ValueError, match="should be larger than 0"): + reverberation_time_eyring( + volume, surface_area, mean_absorption, + speed_of_sound=-1) From ca62a039de4402ea5e4e28fb0d5b57d80d7c8625 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:39:49 +0100 Subject: [PATCH 10/16] more compact format --- pyrato/parametric.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index dd9d4f85..3ecfc048 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -287,9 +287,10 @@ def reverberation_time_eyring( reverberation_time = -factor * ( volume/(surface_area * np.log(1 - mean_absorption))) - mask = np.isclose(mean_absorption, 0, atol=1e-10, rtol=1e-10) - - reverberation_time = np.where(mask, np.inf, reverberation_time) + reverberation_time = np.where( + np.isclose(mean_absorption, 0, atol=1e-10, rtol=1e-10), + np.inf, + reverberation_time) return reverberation_time From 9d6b8a3f29aac86a6dbebad874929c243951a7b1 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:40:21 +0100 Subject: [PATCH 11/16] docstring format --- pyrato/parametric.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 3ecfc048..f335dde4 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -264,7 +264,8 @@ def reverberation_time_eyring( >>> reverb_time = reverberation_time_eyring( ... volume, surface_area, mean_absorption) >>> np.round(reverb_time, 2) - array([1.02, 0.3 , 0.21]) + array([1.02, 0.3 , 0.21]) + References ---------- .. [#] Eyring, C.F., 1930. Reverberation time in "dead" rooms. The Journal From 7784fc6bf1d52f509fdfb0727a22a61e4b9d328f Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:44:24 +0100 Subject: [PATCH 12/16] formatting --- pyrato/parametric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index f335dde4..6f18eb9c 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -264,7 +264,7 @@ def reverberation_time_eyring( >>> reverb_time = reverberation_time_eyring( ... volume, surface_area, mean_absorption) >>> np.round(reverb_time, 2) - array([1.02, 0.3 , 0.21]) + ... array([1.02, 0.3 , 0.21]) References ---------- From d242042801045da7dda820728c692bb010a44ef6 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:44:24 +0100 Subject: [PATCH 13/16] formatting --- tests/test_parametric_eyring.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_parametric_eyring.py b/tests/test_parametric_eyring.py index c8b42df4..6a8936c9 100644 --- a/tests/test_parametric_eyring.py +++ b/tests/test_parametric_eyring.py @@ -15,7 +15,8 @@ def test_analytic_Eyring(mean_absorption, expected): volume = 64 surface_area = 96 - reverb_test = reverberation_time_eyring(volume, surface_area, mean_absorption) + reverb_test = reverberation_time_eyring( + volume, surface_area, mean_absorption) npt.assert_allclose(reverb_test, expected, rtol=1e-3) @pytest.mark.parametrize(("volume", "surface_area"), [(0, -2), (-1, 0)]) From e472cacca0239cdfd356495197d667e7edce77dc Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:50:43 +0100 Subject: [PATCH 14/16] suppress warnings for divide by zero which are explicitly handled below --- pyrato/parametric.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 6f18eb9c..f6cc7028 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -285,8 +285,9 @@ def reverberation_time_eyring( factor = 24 * np.log(10) / speed_of_sound - reverberation_time = -factor * ( - volume/(surface_area * np.log(1 - mean_absorption))) + with np.errstate(divide='ignore'): + reverberation_time = -factor * ( + volume/(surface_area * np.log(1 - mean_absorption))) reverberation_time = np.where( np.isclose(mean_absorption, 0, atol=1e-10, rtol=1e-10), From d4d603c528d0432ae7af532344316a9bff83635e Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Mon, 16 Feb 2026 17:54:24 +0100 Subject: [PATCH 15/16] docstring and type hinting update --- pyrato/parametric.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index f6cc7028..72f98888 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -220,14 +220,14 @@ def reverberation_time_eyring( surface_area: float, mean_absorption: Union[float, np.typing.NDArray[float]], speed_of_sound: float = 343.4, - ): + ) -> np.typing.NDArray[float]: r""" Calculate the reverberation time in rooms as defined by Carl Eyring. The reverberation time is calculated according to Ref. [#]_ as .. math:: - T_{60} = \frac{24 \cdot \ln(10)}{c} + T_{60} = -\frac{24 \cdot \ln(10)}{c} \cdot \frac{V}{S \ln(1 - \tilde{\alpha})} where :math:`V` is the room volume, :math:`S` is the total surface area @@ -250,7 +250,7 @@ def reverberation_time_eyring( Returns ------- - float, numpy.ndarray + numpy.ndarray Reverberation time in seconds. The shape matches the shape of the input variable `mean_absorption`. From 31b4b00084d5359fa37596773af3e60acf9f9eb0 Mon Sep 17 00:00:00 2001 From: Marco Berzborn Date: Thu, 19 Feb 2026 17:08:31 +0100 Subject: [PATCH 16/16] Update type hinting to be compatible with earlier numpy versions --- pyrato/parametric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrato/parametric.py b/pyrato/parametric.py index 72f98888..08d4ca91 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -218,9 +218,9 @@ def mean_free_path( def reverberation_time_eyring( volume: float, surface_area: float, - mean_absorption: Union[float, np.typing.NDArray[float]], + mean_absorption: Union[float, np.ndarray], speed_of_sound: float = 343.4, - ) -> np.typing.NDArray[float]: + ) -> np.ndarray: r""" Calculate the reverberation time in rooms as defined by Carl Eyring.