Skip to content

Commit

Permalink
Simplified some test code based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Toennis committed Jul 19, 2024
1 parent be31e88 commit 37962ac
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/ctapipe/image/tests/test_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

(
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 37962ac

Please sign in to comment.