Skip to content

Commit

Permalink
fixes based on @jdavies-st comments, incl remove all passes of tmp_cw…
Browse files Browse the repository at this point in the history
…d and rtdata together
  • Loading branch information
emolter committed Mar 13, 2024
1 parent 80d0f6c commit 0dcedf4
Show file tree
Hide file tree
Showing 45 changed files with 73 additions and 68 deletions.
2 changes: 1 addition & 1 deletion jwst/background/tests/test_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@pytest.fixture(scope="module")
def data_path():
return pathlib.Path(__file__).parents[0] / "data"
return pathlib.Path(__file__).parent / "data"


@pytest.fixture(scope='module')
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_fgs_guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.fixture(scope='module', params=file_roots, ids=file_roots)
def run_guider_pipelines(tmp_cwd_module, rtdata_module, request):
def run_guider_pipelines(rtdata_module, request):
"""Run pipeline for guider data"""
rtdata = rtdata_module
rtdata.get_data('fgs/level1b/' + request.param + '_uncal.fits')
Expand Down
4 changes: 2 additions & 2 deletions jwst/regtest/test_infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@


@pytest.mark.bigdata
def test_regtestdata_get_data(tmp_cwd, rtdata):
def test_regtestdata_get_data(rtdata):
rtdata.get_data("infrastructure/test_regtestdata/file1_rate.fits")
rtdata.output = "file1_cal.fits"

assert rtdata.input == str(tmp_cwd / "file1_rate.fits")


@pytest.mark.bigdata
def test_regtestdata_get_truth(tmp_cwd, rtdata):
def test_regtestdata_get_truth(rtdata):
rtdata.get_truth("infrastructure/test_regtestdata/file1_rate.fits")
rtdata.output = "file1_rate.fits"

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_coron3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):
"""Run calwebb_coron3 on MIRI 4QPM coronographic data."""
rtdata = rtdata_module
rtdata.get_asn("miri/coron/jw01386-c1002_20230109t015044_coron3_00001_asn.json")
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_coron_image2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from jwst.stpipe import Step

@pytest.fixture(scope='module')
def run_image2(tmp_cwd_module, rtdata_module):
def run_image2(rtdata_module):
"""Run the calwebb_image2 pipeline"""

rtdata = rtdata_module
Expand Down
4 changes: 2 additions & 2 deletions jwst/regtest/test_miri_dark.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'exposure',
['jw00001001001_01101_00001_mirimage', 'jw02201001001_01101_00001_MIRIMAGE']
)
def test_miri_dark_pipeline(exposure, tmp_cwd, rtdata, fitsdiff_default_kwargs):
def test_miri_dark_pipeline(exposure, rtdata, fitsdiff_default_kwargs):
"""Test the DarkPipeline on MIRI dark exposures"""
rtdata.get_data(f"miri/image/{exposure}_uncal.fits")

Expand All @@ -28,7 +28,7 @@ def test_miri_dark_pipeline(exposure, tmp_cwd, rtdata, fitsdiff_default_kwargs):
'exposure',
['jw01033005001_04103_00001-seg003_mirimage']
)
def test_miri_segmented_dark(exposure, tmp_cwd, rtdata, fitsdiff_default_kwargs):
def test_miri_segmented_dark(exposure, rtdata, fitsdiff_default_kwargs):
"""Test the dark_current step on MIRI segmented exposures"""
rtdata.get_data(f"miri/image/{exposure}_linearity.fits")

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_lrs_dedicated_mbkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):

rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_lrs_masterbg_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):

rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_lrs_nod_masterbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):

rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_lrs_slit_spec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):
"""Run the calwebb_spec2 pipeline on an ASN of nodded MIRI LRS
fixedslit exposures."""
rtdata = rtdata_module
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_lrs_slit_spec3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
scope="module",
params=["default_wcs", "user_wcs", "user_wcs+shape", "user_wcs+shape1"]
)
def run_pipeline(tmp_cwd_module, rtdata_module, request):
def run_pipeline(rtdata_module, request):
"""
Run the calwebb_spec3 pipeline on an ASN of nodded MIRI LRS
fixed-slit exposures using different options for the WCS and output
Expand Down
4 changes: 2 additions & 2 deletions jwst/regtest/test_miri_lrs_slitless.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


@pytest.fixture(scope="module")
def run_tso1_pipeline(tmp_cwd_module, rtdata_module):
def run_tso1_pipeline(rtdata_module):
"""Run the calwebb_tso1 pipeline on a MIRI LRS slitless exposure."""
rtdata = rtdata_module
rtdata.get_data(f"miri/lrs/{DATASET1_ID}_uncal.fits")
Expand All @@ -34,7 +34,7 @@ def run_tso1_pipeline(tmp_cwd_module, rtdata_module):


@pytest.fixture(scope="module")
def run_tso_spec2_pipeline(run_tso1_pipeline, tmp_cwd_module, rtdata_module):
def run_tso_spec2_pipeline(run_tso1_pipeline, rtdata_module):
"""Run the calwebb_tso-spec2 pipeline on a MIRI LRS slitless exposure."""
rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_mrs_dedicated_mbkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):

rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_mrs_nod_masterbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):

rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_mrs_spec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@pytest.fixture(scope='module')
def run_spec2(tmp_cwd_module, rtdata_module):
def run_spec2(rtdata_module):
"""Run the Spec2Pipeline on a single exposure"""
rtdata = rtdata_module

Expand Down
8 changes: 4 additions & 4 deletions jwst/regtest/test_miri_mrs_spec3.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


@pytest.fixture(scope='module')
def run_spec3_ifushort(tmp_cwd_module, rtdata_module):
def run_spec3_ifushort(rtdata_module):
"""Run the Spec3Pipeline on association with 2 bands on IFUSHORT"""

# Test has bands medium and long for IFUSHORT
Expand All @@ -30,7 +30,7 @@ def run_spec3_ifushort(tmp_cwd_module, rtdata_module):


@pytest.fixture(scope='module')
def run_spec3_ifulong(tmp_cwd_module, rtdata_module):
def run_spec3_ifulong(rtdata_module):
"""Run the Spec3Pipeline dithered flight data """

# Test has bands medium and long for IFULONG
Expand All @@ -50,7 +50,7 @@ def run_spec3_ifulong(tmp_cwd_module, rtdata_module):


@pytest.fixture(scope='module')
def run_spec3_ifushort_emsm(tmp_cwd_module, rtdata_module):
def run_spec3_ifushort_emsm(rtdata_module):
"""Run the Spec3Pipeline (cube_build using weighting emsm) on association with 2 bands on IFUSHORT"""

# Test has bands medium and long for IFUSHORT
Expand All @@ -72,7 +72,7 @@ def run_spec3_ifushort_emsm(tmp_cwd_module, rtdata_module):


@pytest.fixture(scope='module')
def run_spec3_ifushort_extract1d(tmp_cwd_module, rtdata_module):
def run_spec3_ifushort_extract1d(rtdata_module):
"""Run the Spec3Pipeline on association with 2 bands on IFUSHORT"""

# Test has bands medium and long for IFUSHORT
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_mrs_spec3_moving_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.fixture(scope='module')
def run_spec3_moving_target(tmp_cwd_module, rtdata_module):
def run_spec3_moving_target(rtdata_module):
"""Run the Spec3Pipeline dithered flight data """

# Association has 2 exposures from IFUSHORT
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_mrs_tso.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.fixture(scope='module')
def run_spec2(tmp_cwd_module, rtdata_module):
def run_spec2(rtdata_module):
"""Run the Spec2Pipeline on a single exposure"""
rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_setpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@pytest.mark.bigdata
def test_miri_setpointing(tmp_cwd, rtdata, engdb, fitsdiff_default_kwargs):
def test_miri_setpointing(rtdata, engdb, fitsdiff_default_kwargs):
"""
Regression test of the set_telescope_pointing script on a level-1b MIRI image.
"""
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_miri_spectral_leak.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'output',
['test_spectral_leak_asn_0_spectralleakstep.fits', 'test_spectral_leak_asn_1_spectralleakstep.fits']
)
def test_miri_spectral_leak(output, tmp_cwd, rtdata, fitsdiff_default_kwargs):
def test_miri_spectral_leak(output, rtdata, fitsdiff_default_kwargs):
"""Run cube_build on single file using coord system = ifu_align"""

rtdata.get_asn("miri/mrs/test_spectral_leak_asn.json")
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_nircam_align_to_gaia.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


@pytest.fixture(scope="module")
def run_image3pipeline(rtdata_module, tmp_cwd_module):
def run_image3pipeline(rtdata_module):
''' Run calwebb_image3 on NIRCam imaging and align to gaia '''

rtdata = rtdata_module
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_nircam_coron3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):
"""Run calwebb_coron3 on coronographic data."""
rtdata = rtdata_module
rtdata.get_asn("nircam/coron/jw01386-c1020_20220909t073458_coron3_002a_asn.json")
Expand Down
9 changes: 5 additions & 4 deletions jwst/regtest/test_nircam_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.fixture(scope="module")
def run_detector1pipeline(tmp_cwd_module, rtdata_module):
def run_detector1pipeline(rtdata_module):
"""Run calwebb_detector1 on NIRCam imaging long data"""
rtdata = rtdata_module
rtdata.get_data("nircam/image/jw01538046001_03105_00001_nrcalong_uncal.fits")
Expand All @@ -31,7 +31,7 @@ def run_detector1pipeline(tmp_cwd_module, rtdata_module):


@pytest.fixture(scope="module")
def run_image2pipeline(run_detector1pipeline, tmp_cwd_module, rtdata_module):
def run_image2pipeline(run_detector1pipeline, rtdata_module):
"""Run calwebb_image2 on NIRCam imaging long data"""
rtdata = rtdata_module
rtdata.input = "jw01538046001_03105_00001_nrcalong_rate.fits"
Expand All @@ -43,7 +43,7 @@ def run_image2pipeline(run_detector1pipeline, tmp_cwd_module, rtdata_module):


@pytest.fixture(scope="module")
def run_image3pipeline(run_image2pipeline, rtdata_module, tmp_cwd_module):
def run_image3pipeline(run_image2pipeline, rtdata_module):
"""Run calwebb_image3 on NIRCam imaging long data"""
rtdata = rtdata_module
# Grab rest of _rate files for the asn and run image2 pipeline on each to
Expand Down Expand Up @@ -170,8 +170,9 @@ def test_nircam_image_stage3_segm(run_image3pipeline, rtdata_module, fitsdiff_de


@pytest.fixture()
def run_image3_closedfile(rtdata, tmp_cwd_module):
def run_image3_closedfile(rtdata_module):
"""Run calwebb_image3 on NIRCam imaging with data that had a closed file issue."""
rtdata = rtdata_module
rtdata.get_asn("nircam/image/fail_short_image3_asn.json")

args = ["calwebb_image3", rtdata.input]
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_nircam_subarray_4amp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):
"""Run calwebb_detector1 pipeline on NIRCAM subarray data."""
rtdata = rtdata_module
rtdata.get_data("nircam/subarray/jw00617196001_02102_00001_nrca4_uncal.fits")
Expand Down
4 changes: 2 additions & 2 deletions jwst/regtest/test_nircam_tsgrism.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


@pytest.fixture(scope="module")
def run_pipelines(tmp_cwd_module, rtdata_module):
def run_pipelines(rtdata_module):
"""Run stage 2-3 tso pipelines on NIRCAM TSO grism data."""
rtdata = rtdata_module

Expand Down Expand Up @@ -71,7 +71,7 @@ def test_nircam_tsgrism_stage3_whtlt(run_pipelines):


@pytest.mark.bigdata
def test_nircam_setpointing_tsgrism(tmp_cwd, rtdata, fitsdiff_default_kwargs):
def test_nircam_setpointing_tsgrism(rtdata, fitsdiff_default_kwargs):
"""
Regression test of the set_telescope_pointing script on a level-1b NIRCam file.
"""
Expand Down
4 changes: 2 additions & 2 deletions jwst/regtest/test_nircam_tsimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.fixture(scope="module")
def run_pipelines(tmp_cwd_module, rtdata_module):
def run_pipelines(rtdata_module):
"""Run stage 2 and 3 pipelines on NIRCam TSO image data."""

rtdata = rtdata_module
Expand Down Expand Up @@ -65,7 +65,7 @@ def test_nircam_tsimage_stage3_phot(run_pipelines):


@pytest.mark.bigdata
def test_nircam_setpointing_tsimg(tmp_cwd, rtdata, engdb, fitsdiff_default_kwargs):
def test_nircam_setpointing_tsimg(rtdata, engdb, fitsdiff_default_kwargs):
"""
Regression test of the set_telescope_pointing script on a level-1b
NIRCam TSO imaging file.
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_nircam_wfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


@pytest.fixture(scope="module")
def run_pipelines(tmp_cwd_module, rtdata_module):
def run_pipelines(rtdata_module):
"""Run the calwebb_wfs-image2 and calwebb_wfs-image3 pipelines
on NIRCam WFS&C images. The calwebb_wfs-image3 pipeline is
run twice: once with default params and a second time with
Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_nircam_wfss_contam.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


@pytest.fixture(scope='module')
def run_wfss_contam(tmp_cwd_module, rtdata_module):
def run_wfss_contam(rtdata_module):
"""Run the wfss_contam step"""
rtdata = rtdata_module

Expand Down
2 changes: 1 addition & 1 deletion jwst/regtest/test_niriss_ami3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


@pytest.fixture(scope="module")
def run_pipeline(tmp_cwd_module, rtdata_module):
def run_pipeline(rtdata_module):
"""Run calwebb_ami3 on NIRISS AMI data."""
rtdata = rtdata_module
rtdata.get_asn("niriss/ami/jw01093-c1000_20221110t003218_ami3_002_asn.json")
Expand Down
Loading

0 comments on commit 0dcedf4

Please sign in to comment.