diff --git a/pyproject.toml b/pyproject.toml index 418aebe..47d25e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ "psutil>=5.8.0", "resampy>=0.2.2", "scipy>=1.7.0", - "sympy", + "sympy>=1.13.2", "tqdm>=4.58.0", "vtk>=9.0.1", ] diff --git a/src/python/test/test_sim3d.py b/src/python/test/test_sim3d.py index dcb1b89..5136165 100644 --- a/src/python/test/test_sim3d.py +++ b/src/python/test/test_sim3d.py @@ -3,8 +3,9 @@ import pathlib import subprocess -import pytest import numpy as np +import psutil +import pytest import scipy.io.wavfile as wavfile from pffdtd.analysis.room_modes import find_nearest @@ -45,9 +46,16 @@ def _skip_if_native_engine_unavailable(engine): pytest.skip("Native engine not available") +def _skip_if_not_enough_memory(engine): + if engine == "python": + if psutil.virtual_memory().available <= 6e9: + pytest.skip("Not enough memory") + + @pytest.mark.parametrize("engine", ["python", "native"]) def test_sim3d_locate_sound_source(tmp_path, engine): _skip_if_native_engine_unavailable(engine) + _skip_if_not_enough_memory(engine) fmin = 20 fmax = 1000 @@ -146,6 +154,7 @@ def test_sim3d_locate_sound_source(tmp_path, engine): @pytest.mark.parametrize("engine", ["python", "native"]) def test_sim3d_infinite_baffle(tmp_path, engine): _skip_if_native_engine_unavailable(engine) + _skip_if_not_enough_memory(engine) fmin = 20 fmax = 1000 @@ -251,11 +260,12 @@ def test_sim3d_infinite_baffle(tmp_path, engine): "size,fmax,ppw,fcc,dx_scale,tolerance", [ ((2.8, 2.076, 1.48), 400, 10.5, False, 2, 3.0), - ((3.0, 1.0, 2.0), 800, 7.7, True, 3, 6), + ((3.0, 1.0, 2.0), 600, 7.7, True, 3, 6), ] ) def test_sim3d_detect_room_modes(tmp_path, engine, size, fmax, ppw, fcc, dx_scale, tolerance): _skip_if_native_engine_unavailable(engine) + _skip_if_not_enough_memory(engine) L = size[0] W = size[1]