From ef7f9e90e8599b314dac0a71a023f24ac1f54316 Mon Sep 17 00:00:00 2001 From: Marshall Perrin Date: Thu, 7 Mar 2024 11:46:26 -0500 Subject: [PATCH] add tests for progressbar --- poppy/tests/test_core.py | 3 +++ poppy/tests/test_instrument.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/poppy/tests/test_core.py b/poppy/tests/test_core.py index b9218598..be0c0a01 100644 --- a/poppy/tests/test_core.py +++ b/poppy/tests/test_core.py @@ -178,6 +178,9 @@ def test_multiwavelength_opticalsystem(): assert np.allclose(psf[0].data, output), \ "Multi-wavelength PSF does not match weighted sum of individual wavelength PSFs" + # test that it's also possible to display a progress bar for multi wave calculations + psf = osys.calc_psf(wavelength=wavelengths, weight=weights, progressbar=True) + return psf diff --git a/poppy/tests/test_instrument.py b/poppy/tests/test_instrument.py index 1086087e..931f0c12 100644 --- a/poppy/tests/test_instrument.py +++ b/poppy/tests/test_instrument.py @@ -166,7 +166,7 @@ def test_instrument_calc_datacube(): inst = instrument.Instrument() psf = inst.calc_datacube(WAVELENGTHS_ARRAY, fov_pixels=FOV_PIXELS, - detector_oversample=2, fft_oversample=2) + detector_oversample=2, fft_oversample=2, progressbar=True) assert psf[0].header['NWAVES'] == len(WAVELENGTHS_ARRAY), \ "Number of wavelengths in PSF header does not match number requested" assert len(psf[0].data.shape) == 3, "Incorrect dimensions for output cube"