diff --git a/pyrato/parametric.py b/pyrato/parametric.py index b2257f4e..0253a949 100644 --- a/pyrato/parametric.py +++ b/pyrato/parametric.py @@ -187,7 +187,7 @@ def air_attenuation_coefficient( return air_abs_coeff - + def critical_distance( volume, reverberation_time): @@ -252,8 +252,9 @@ def mean_free_path( def reverberation_time_eyring(volume,surface,mean_alpha): r""" - function which calculates reverberation time in rooms as - defined by Carl F. Eyring. + Calculate reverberation time using Eyring's equation. + + The Eyring reverberation time is defined as [#]_ .. math:: T_{60} = -0.161 \frac{\text{volume}}{\text{surface} \cdot @@ -276,8 +277,7 @@ def reverberation_time_eyring(volume,surface,mean_alpha): References ---------- .. [#] Eyring, C.F., 1930. Reverberation time in “dead” rooms. The Journal - of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. - + of the Acoustical Society of America, 1(2A_Supplement), pp.168-168. """ if volume <= 0: diff --git a/tests/test_parametric_eyring.py b/tests/test_parametric_eyring.py index 757a3c2e..1161ef2c 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"): @@ -21,6 +21,6 @@ def test_input_alpha_Eyring(mean_alpha): volume = 64 surface = 96 with pytest.raises( - ValueError, match="mean_alpha should be between 0 and 1" + ValueError, match="mean_alpha should be between 0 and 1", ): reverberation_time_eyring(volume,surface,mean_alpha)