From e09229861b5f3a7e5e425f1ee553de751caa5056 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 7 May 2024 15:52:01 +0200 Subject: [PATCH 1/2] fix missing import and sampling rate --- tests/renderer/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index a538df7ee8..f854574b71 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -41,10 +41,10 @@ import numpy as np import pytest from .compare_audio import compare_audio_arrays -from .constants import * - +from .constants import SCRIPTS_DIR, OUTPUT_PATH_REF, OUTPUT_PATH_CUT, FORMAT_TO_FILE_COMPARETEST, FORMAT_TO_FILE_SMOKETEST, RENDERER_CMD, BIN_SUFFIX_MERGETARGET sys.path.append(SCRIPTS_DIR) from pyaudio3dtools.audiofile import readfile +from .. import cmp_pcm # fixture returns test information, enabling per-testcase SNR @@ -117,6 +117,7 @@ def run_renderer( hrtf_file: Optional[str] = None, get_mld=False, mld_lim=0, + get_mld_lim=0, ) -> str: # prepare arguments and filepaths if trj_file is not None: @@ -238,6 +239,8 @@ def run_renderer( out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem)) if get_mld: + # see constants.py + ref_fs = cmd[10] output_differs, reason = cmp_pcm( out_file, out_file_ref, -- GitLab From 23a5e7fd1bf105a538dd946a5fbf8b53d6f0c92c Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 7 May 2024 15:52:48 +0200 Subject: [PATCH 2/2] run formatter --- tests/renderer/utils.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index f854574b71..d569fff6c7 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -41,7 +41,16 @@ import numpy as np import pytest from .compare_audio import compare_audio_arrays -from .constants import SCRIPTS_DIR, OUTPUT_PATH_REF, OUTPUT_PATH_CUT, FORMAT_TO_FILE_COMPARETEST, FORMAT_TO_FILE_SMOKETEST, RENDERER_CMD, BIN_SUFFIX_MERGETARGET +from .constants import ( + SCRIPTS_DIR, + OUTPUT_PATH_REF, + OUTPUT_PATH_CUT, + FORMAT_TO_FILE_COMPARETEST, + FORMAT_TO_FILE_SMOKETEST, + RENDERER_CMD, + BIN_SUFFIX_MERGETARGET, +) + sys.path.append(SCRIPTS_DIR) from pyaudio3dtools.audiofile import readfile from .. import cmp_pcm @@ -70,7 +79,7 @@ def check_BE( cut: np.ndarray, cut_fs: int, xfail: bool = False, - atol: int = 2 + atol: int = 2, ): if ref is None or np.array_equal(ref, np.zeros_like(ref)): pytest.fail("REF signal does not exist or is zero!") -- GitLab