Skip to content

Commit b97d735

Browse files
rcal-627 Add metrics logger to regtests (#831)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 05aad62 commit b97d735

9 files changed

Lines changed: 19 additions & 2 deletions

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ refpix
4646
general
4747
-------
4848

49+
- Add metrics_logger to the regression tests [#831]
50+
4951
- Update pipeline logic for saturation checks [#824]
5052

5153
- Update the pipeline code to process all the uncal files in an association [#802]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ test = [
4949
'ci-watson >=0.5.0',
5050
'pytest >=4.6.0',
5151
'pytest-astropy',
52+
'metrics_logger >= 0.1.0',
5253
]
5354

5455
[project.urls]

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ scipy>=0.0.dev0
1212
git+https://github.com/spacetelescope/stpipe
1313
git+https://github.com/spacetelescope/stcal
1414
git+https://github.com/spacetelescope/tweakwcs
15+
#git+https://github.com/spacetelescope/metrics_logger

romancal/regtest/test_tweakreg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from io import StringIO
22

33
import pytest
4+
from metrics_logger.decorators import metrics_logger
45
from roman_datamodels import datamodels as rdm
56

67
from romancal.stpipe import RomanStep
@@ -44,6 +45,7 @@ def create_asn_file():
4445
return asn_file_path
4546

4647

48+
@metrics_logger("DMS280")
4749
@pytest.mark.bigdata
4850
def test_tweakreg(rtdata, ignore_asdf_paths, tmp_path):
4951
# N.B.: the data were created using WFIsim and processed through

romancal/regtest/test_wfi_dq_init.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33

44
import pytest
55
import roman_datamodels as rdm
6+
from metrics_logger.decorators import metrics_logger
67

78
from romancal.step import DQInitStep
89
from romancal.stpipe import RomanStep
910

1011
from .regtestdata import compare_asdf
1112

1213

14+
@metrics_logger("DMS25")
1315
@pytest.mark.bigdata
1416
def test_dq_init_image_step(rtdata, ignore_asdf_paths):
1517
"""DMS25 Test: Testing retrieval of best ref file for image data,
@@ -64,6 +66,7 @@ def test_dq_init_image_step(rtdata, ignore_asdf_paths):
6466
assert compare_asdf(rtdata.output, rtdata.truth, **ignore_asdf_paths) is None
6567

6668

69+
@metrics_logger("DMS26")
6770
@pytest.mark.bigdata
6871
def test_dq_init_grism_step(rtdata, ignore_asdf_paths):
6972
"""DMS26 Test: Testing retrieval of best ref file for grism data,

romancal/regtest/test_wfi_flat_field.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44
import roman_datamodels as rdm
55
from crds.core.exceptions import CrdsLookupError
6+
from metrics_logger.decorators import metrics_logger
67

78
from romancal.step import FlatFieldStep
89
from romancal.stpipe import RomanStep
@@ -66,6 +67,7 @@ def test_flat_field_grism_step(rtdata, ignore_asdf_paths):
6667
assert compare_asdf(rtdata.output, rtdata.truth, **ignore_asdf_paths) is None
6768

6869

70+
@metrics_logger("DMS79")
6971
@pytest.mark.bigdata
7072
@pytest.mark.soctests
7173
def test_flat_field_crds_match_image_step(rtdata, ignore_asdf_paths):

romancal/regtest/test_wfi_photom.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
import pytest
55
import roman_datamodels as rdm
66
from astropy import units as u
7+
from metrics_logger.decorators import metrics_logger
78

89
from romancal.step import PhotomStep
910
from romancal.stpipe import RomanStep
1011

1112
from .regtestdata import compare_asdf
1213

1314

15+
@metrics_logger("DMS140")
1416
@pytest.mark.bigdata
1517
def test_absolute_photometric_calibration(rtdata, ignore_asdf_paths):
1618
"""DMS140 Test: Testing application of photometric correction using

romancal/regtest/test_wfi_pipeline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pytest
66
import roman_datamodels as rdm
77
from gwcs.wcstools import grid_from_bounding_box
8+
from metrics_logger.decorators import metrics_logger
89
from numpy.testing import assert_allclose
910

1011
from romancal.assign_wcs.assign_wcs_step import AssignWcsStep
@@ -22,6 +23,7 @@ def passfail(bool_expr):
2223

2324
@pytest.mark.bigdata
2425
@pytest.mark.soctests
26+
@metrics_logger("DMS86", "DMS87", "DMS88")
2527
def test_level2_image_processing_pipeline(rtdata, ignore_asdf_paths):
2628
"""Tests for flat field imaging processing requirements DMS86 & DMS 87"""
2729
input_data = "r0000101001001001001_01101_0001_WFI01_uncal.asdf"
@@ -254,6 +256,7 @@ def test_level2_image_processing_pipeline(rtdata, ignore_asdf_paths):
254256

255257
@pytest.mark.bigdata
256258
@pytest.mark.soctests
259+
@metrics_logger("DMS90", "DMS91", "DMS9")
257260
def test_level2_grism_processing_pipeline(rtdata, ignore_asdf_paths):
258261
"""Tests for flat field grism processing requirements DMS90 & DMS 91"""
259262
input_data = "r0000201001001001002_01101_0001_WFI01_uncal.asdf"

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ pass_env =
5454
CODECOV_*
5555
DD_*
5656
set_env =
57-
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
57+
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simpl
58+
5859
extras =
5960
test
6061
alldeps: all
@@ -73,7 +74,7 @@ commands =
7374
cov: --cov --cov-config pyproject.toml --cov-report term-missing --cov-report xml \
7475
warnings: -W error \
7576
regtests: --bigdata --slow --basetemp={homedir}/test_outputs \
76-
xdist: -n auto \
77+
xdist: -n 0 \
7778
pyargs: {toxinidir}/docs --pyargs {posargs:romancal} \
7879
ddtrace: --ddtrace \
7980
{posargs}

0 commit comments

Comments
 (0)