Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up regtests by reorganizing test_nirspec_ifu_spec3 #8811

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
split test_nirspec_ifu_spec3_regtest
  • Loading branch information
braingram committed Sep 24, 2024
commit 54d84c6985006a7cb3c446e49c1a9e07bd7922a5
54 changes: 1 addition & 53 deletions jwst/regtest/test_nirspec_ifu_spec3.py
Original file line number Diff line number Diff line change
@@ -3,11 +3,6 @@

from jwst.regtest import regtestdata as rt

# Define artifactory source and truth
INPUT_PATH = 'nirspec/ifu'
TRUTH_PATH = 'truth/test_nirspec_ifu'
TRUTH_PATH_PIXEL_REPLACE = 'truth/test_nirspec_ifu_pixel_replace'


@pytest.fixture(scope='module')
def run_spec3_multi(rtdata_module):
@@ -31,27 +26,6 @@ def run_spec3_multi(rtdata_module):
return rtdata


@pytest.fixture(scope='module')
def run_spec3_multi_pixel_replace(rtdata_module):
"""Run Spec3Pipeline with pixel replacement"""
rtdata = rtdata_module

step_params = {
'input_path': 'nirspec/ifu/jw01249-o005_20230622t074431_rp_spec3_00001_asn.json',
'step': 'calwebb_spec3',
'args': {
'--steps.pixel_replace.skip=false',
'--steps.pixel_replace.save_results=true',
'--steps.pixel_replace.algorithm=mingrad',
'--steps.cube_build.save_results=true',
'--steps.extract_1d.save_results=true',
}
}

rtdata = rt.run_step_from_dict(rtdata, **step_params)
return rtdata


@pytest.mark.slow
@pytest.mark.bigdata
@pytest.mark.parametrize(
@@ -73,32 +47,6 @@ def test_spec3_multi(run_spec3_multi, fitsdiff_default_kwargs, output):
"""Regression test matching output files"""
rt.is_like_truth(
run_spec3_multi, fitsdiff_default_kwargs, output,
truth_path=TRUTH_PATH,
is_suffix=False
)


@pytest.mark.slow
@pytest.mark.bigdata
@pytest.mark.parametrize(
'output',
[
'jw01249005001_03101_00001_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00001_nrs2_o005_pixel_replace.fits',
'jw01249005001_03101_00002_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00002_nrs2_o005_pixel_replace.fits',
'jw01249005001_03101_00003_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00003_nrs2_o005_pixel_replace.fits',
'jw01249005001_03101_00004_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00004_nrs2_o005_pixel_replace.fits',
'jw01249-o005_t001_nirspec_rp_test_g395h-f290lp_s3d.fits',
'jw01249-o005_t001_nirspec_rp_test_g395h-f290lp_x1d.fits',
]
)
def test_spec3_multi_pixel_replace(run_spec3_multi_pixel_replace, fitsdiff_default_kwargs, output):
"""Regression test matching output files"""
rt.is_like_truth(
run_spec3_multi_pixel_replace, fitsdiff_default_kwargs, output,
truth_path=TRUTH_PATH_PIXEL_REPLACE,
truth_path='truth/test_nirspec_ifu',
is_suffix=False
)
53 changes: 53 additions & 0 deletions jwst/regtest/test_nirspec_ifu_spec3_pixelreplace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""Regression tests for NIRSpec IFU"""
import pytest

from jwst.regtest import regtestdata as rt

TRUTH_PATH_PIXEL_REPLACE = 'truth/test_nirspec_ifu_pixel_replace'


@pytest.fixture(scope='module')
def run_spec3_multi_pixel_replace(rtdata_module):
"""Run Spec3Pipeline with pixel replacement"""
rtdata = rtdata_module

step_params = {
'input_path': 'nirspec/ifu/jw01249-o005_20230622t074431_rp_spec3_00001_asn.json',
'step': 'calwebb_spec3',
'args': {
'--steps.pixel_replace.skip=false',
'--steps.pixel_replace.save_results=true',
'--steps.pixel_replace.algorithm=mingrad',
'--steps.cube_build.save_results=true',
'--steps.extract_1d.save_results=true',
}
}

rtdata = rt.run_step_from_dict(rtdata, **step_params)
return rtdata


@pytest.mark.slow
@pytest.mark.bigdata
@pytest.mark.parametrize(
'output',
[
'jw01249005001_03101_00001_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00001_nrs2_o005_pixel_replace.fits',
'jw01249005001_03101_00002_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00002_nrs2_o005_pixel_replace.fits',
'jw01249005001_03101_00003_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00003_nrs2_o005_pixel_replace.fits',
'jw01249005001_03101_00004_nrs1_o005_pixel_replace.fits',
'jw01249005001_03101_00004_nrs2_o005_pixel_replace.fits',
'jw01249-o005_t001_nirspec_rp_test_g395h-f290lp_s3d.fits',
'jw01249-o005_t001_nirspec_rp_test_g395h-f290lp_x1d.fits',
]
)
def test_spec3_multi_pixel_replace(run_spec3_multi_pixel_replace, fitsdiff_default_kwargs, output):
"""Regression test matching output files"""
rt.is_like_truth(
run_spec3_multi_pixel_replace, fitsdiff_default_kwargs, output,
truth_path='truth/test_nirspec_ifu_pixel_replace',
is_suffix=False
)