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

DM-22495: validate_drp reportPerformance.py fails on new metrics #110

Merged
merged 2 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions python/lsst/validate/drp/report_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ def objects_to_table(input_objects, level='design'):
for spec_key in spec_set:
if level in spec_key.spec:
spec = job.specs[spec_key]
if np.isnan(m.quantity):
meas_quantity_value = "**" # -- is reserved in rst for headers
else:
meas_quantity_value = m.quantity.value
this_row = [metric, filter_name, meas_quantity_value, m.quantity.unit,
spec.operator_str, spec.threshold.value, job.meta['instrument']]
rows.append(this_row)
if spec is not None:
if np.isnan(m.quantity):
meas_quantity_value = "**" # -- is reserved in rst for headers
else:
meas_quantity_value = m.quantity.value
this_row = [metric, filter_name, meas_quantity_value, m.quantity.unit,
spec.operator_str, spec.threshold.value, job.meta['instrument']]
rows.append(this_row)

if len(rows) == 0:
msg_format = "No rows loaded from Job at level: '{:s}'"
Expand Down
2 changes: 1 addition & 1 deletion tests/CfhtQuick_output_r.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions tests/CfhtQuick_output_r_report_design_FY17.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
====== ====== ======= ======== ======================= ==================== ======== ========
Metric Filter Unit Operator SRD Requirement: design Release Target: FY17 Value Comments
====== ====== ======= ======== ======================= ==================== ======== ========
AM1 r marcsec <= 10.0 30.0 6.57
AD1 r marcsec <= 20.0 20.0 12.9
AF1 r % <= 10.0 10.0 2.78
AM1 r marcsec <= 10.0 30.0 12.1
AD1 r marcsec <= 20.0 20.0 14.7
AF1 r % <= 10.0 10.0 4.21
AM2 r marcsec <= 10.0 40.0 **
AD2 r marcsec <= 20.0 20.0 **
AF2 r % <= 10.0 10.0 **
AM3 r marcsec <= 15.0 40.0 **
AD3 r marcsec <= 30.0 30.0 **
AF3 r % <= 10.0 10.0 **
PA1 r mmag <= 5.0 8.0 19.3
PA2 r mmag <= 15.0 22.5 28.9
PF1 r % <= 10.0 10.0 50
TE1 r <= 2e-05 nan 6.82e-05
TE2 r <= 5e-05 nan 2.05e-05
PA1 r mmag <= 5.0 8.0 17
PA2 r mmag <= 15.0 22.5 28
PF1 r % <= 10.0 10.0 42.4
TE1 r <= 2e-05 nan 0.000365
TE2 r <= 5e-05 nan 0.000228
====== ====== ======= ======== ======================= ==================== ======== ========
48 changes: 30 additions & 18 deletions tests/CfhtQuick_output_r_report_minimum_FY18.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
====== ====== ======= ======== ======================== ==================== ======== ========
Metric Filter Unit Operator SRD Requirement: minimum Release Target: FY18 Value Comments
====== ====== ======= ======== ======================== ==================== ======== ========
AM1 r marcsec <= 20.0 30.0 6.57
AD1 r marcsec <= 40.0 20.0 8.88
AF1 r % <= 20.0 10.0 1.85
AM2 r marcsec <= 20.0 40.0 **
AD2 r marcsec <= 40.0 20.0 **
AF2 r % <= 20.0 10.0 **
AM3 r marcsec <= 30.0 40.0 **
AD3 r marcsec <= 50.0 30.0 **
AF3 r % <= 20.0 10.0 **
PA1 r mmag <= 8.0 8.0 19.3
PA2 r mmag <= 15.0 20.0 24.5
PF1 r % <= 20.0 10.0 50
TE1 r <= 3e-05 nan 6.82e-05
TE2 r <= 3e-05 nan 2.05e-05
====== ====== ======= ======== ======================== ==================== ======== ========
================= ====== ======= ======== ======================== ==================== ======== ========
Metric Filter Unit Operator SRD Requirement: minimum Release Target: FY18 Value Comments
================= ====== ======= ======== ======================== ==================== ======== ========
AM1 r marcsec <= 20.0 30.0 12.1
AD1 r marcsec <= 40.0 20.0 8.9
AF1 r % <= 20.0 10.0 0
AM2 r marcsec <= 20.0 40.0 **
AD2 r marcsec <= 40.0 20.0 **
AF2 r % <= 20.0 10.0 **
AM3 r marcsec <= 30.0 40.0 **
AD3 r marcsec <= 50.0 30.0 **
AF3 r % <= 20.0 10.0 **
PA1 r mmag <= 8.0 8.0 17
psfPhotRepStar1 r mmag <= 120.0 nan 259
psfPhotRepStar2 r mmag <= 60.0 nan 102
psfPhotRepStar3 r mmag <= 30.0 nan 34.6
psfPhotRepStar4 r mmag <= 15.0 nan 25.6
modelPhotRepGal1 r mmag <= 180.0 nan 258
modelPhotRepGal2 r mmag <= 90.0 nan 199
modelPhotRepStar1 r mmag <= 120.0 nan 256
modelPhotRepStar2 r mmag <= 60.0 nan 109
modelPhotRepGal3 r mmag <= 45.0 nan 97.2
modelPhotRepGal4 r mmag <= 22.5 nan 54
modelPhotRepStar3 r mmag <= 30.0 nan 46.6
modelPhotRepStar4 r mmag <= 15.0 nan 33.7
PA2 r mmag <= 15.0 20.0 23
PF1 r % <= 20.0 10.0 42.4
TE1 r <= 3e-05 nan 0.000365
TE2 r <= 3e-05 nan 0.000228
================= ====== ======= ======== ======================== ==================== ======== ========
2 changes: 1 addition & 1 deletion tests/test_load_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def testLoadJsonJob(self):
# without throwing an error
job = load_json_output(self.jsonFile)
# Spot-check a few attributes
self.assertEqual(len(job.measurements), 30)
self.assertEqual(len(job.measurements), 42)

def testParseJobFilterName(self):
"""Do we correctly read the filterName from a Job object?"""
Expand Down