From 2aea32d3f91552c56bb2325e3363862c4231370f Mon Sep 17 00:00:00 2001 From: Tyler Cox Date: Mon, 7 Oct 2024 15:22:56 -0700 Subject: [PATCH] test increasing number of processes --- fftvis/simulate.py | 2 ++ fftvis/tests/test_compare_matvis.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fftvis/simulate.py b/fftvis/simulate.py index f131467..560a323 100644 --- a/fftvis/simulate.py +++ b/fftvis/simulate.py @@ -49,6 +49,7 @@ def simulate_vis( flat_array_tol: float = 0.0, live_progress: bool = True, interpolation_function: str = "az_za_map_coordinates", + nprocesses: int | None = 1, ): """ Parameters: @@ -137,6 +138,7 @@ def simulate_vis( flat_array_tol=flat_array_tol, live_progress=live_progress, interpolation_function=interpolation_function, + nprocesses=nprocesses, ) diff --git a/fftvis/tests/test_compare_matvis.py b/fftvis/tests/test_compare_matvis.py index 5c906e5..e9a8249 100644 --- a/fftvis/tests/test_compare_matvis.py +++ b/fftvis/tests/test_compare_matvis.py @@ -9,7 +9,8 @@ @pytest.mark.parametrize('precision', [2,1]) @pytest.mark.parametrize('use_analytic_beam', [True, False]) @pytest.mark.parametrize('tilt_array', [True, False]) -def test_simulate(polarized: bool, precision: int, use_analytic_beam: bool, tilt_array: bool): +@pytest.mark.parametrize('nprocesses', [1, 2]) +def test_simulate(polarized: bool, precision: int, use_analytic_beam: bool, tilt_array: bool, nprocesses: int): ( ants, @@ -49,7 +50,7 @@ def test_simulate(polarized: bool, precision: int, use_analytic_beam: bool, tilt fvis = simulate.simulate_vis( ants, flux, ra, dec, freqs, times.jd, cpu_beams[0], eps=1e-10 if precision==2 else 6e-8, baselines=sim_baselines, polarized=polarized, precision=precision, - telescope_loc=location, + telescope_loc=location, nprocesses=nprocesses ) # Should have shape (nfreqs, ntimes, nants, nants)