From 37962ace2c30fa1900d4d14148d8848b6c16f81d Mon Sep 17 00:00:00 2001 From: Christoph Toennis Date: Thu, 18 Jul 2024 09:37:45 +0200 Subject: [PATCH] Simplified some test code based on comments --- src/ctapipe/image/tests/test_extractor.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ctapipe/image/tests/test_extractor.py b/src/ctapipe/image/tests/test_extractor.py index 610dc12f7e2..d6156466e17 100644 --- a/src/ctapipe/image/tests/test_extractor.py +++ b/src/ctapipe/image/tests/test_extractor.py @@ -427,7 +427,7 @@ def test_extractors(Extractor, toymodels, request): @pytest.mark.parametrize("Extractor", extractors) def test_integration_correction_off(Extractor, toymodels, request): # full waveform extractor does not have an integration correction - if Extractor is FullWaveformSum or Extractor is VarianceExtractor: + if Extractor in (FullWaveformSum, VarianceExtractor): return ( @@ -717,15 +717,12 @@ def test_dtype(Extractor, subarray): extractor = Extractor(subarray=subarray) n_channels, n_pixels, _ = waveforms.shape broken_pixels = np.zeros((n_channels, n_pixels), dtype=bool) - if Extractor is VarianceExtractor: - var = extractor(waveforms, tel_id, None, None) - assert var.image.dtype == np.float32 - return - dl1 = extractor(waveforms, tel_id, selected_gain_channel, broken_pixels) + if Extractor is not VarianceExtractor: + assert dl1.peak_time.dtype == np.float32 + assert dl1.image.dtype == np.float32 - assert dl1.peak_time.dtype == np.float32 def test_global_peak_window_sum_with_pixel_fraction(subarray):