Coverage for python/lsst/validate/drp/report_performance.py : 89%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# LSST Data Management System # Copyright 2017 AURA/LSST. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <https://www.lsstcorp.org/LegalNotices/>.
srd_level=None, release_specs_package=None, release_level=None, metrics_package='verify_metrics'): """ Parameters --- validation_drp_report_filenames : list or str filepaths for JSON files. output_file : str filepath of output RST file. srd_level : str SRD level to quote. One of ['design', 'minimum', 'stretch'] release_specs_package : str, optional Name of package to use in constructing the release level specs. release_level : str, A specification level in the 'release_specs_file' E.g., 'FY17' or 'ORR'
Products --- Writes table of performance metrics to an RST file. """ msg = "Table from Job is None. Returning without writing table" print(msg) return
"""Load JSON files into a list of lsst.validate.base measurement Jobs.
Parameters ---------- filenames : list of str Filenames of JSON files to load.
Returns ------- job_list : list of lsst.validate.base.Job Each element is the Job representation of the JSON file. """ # Read in JSON output from metrics run
# Identify key data from JSON """Take lsst.validate.base.Job objects and convert to astropy.table.Table
Parameters ---------- input_objects : list of Job objects level : str The requirement level to compare to for each metric. This is required because there are metrics with dependencies E.g., AD1 depends on AF1. Thus you have to specify a level to even get a single AD1 metric.
Returns ------- report : astropy.table.Table Table with columns needed for final report. """ else: spec.operator_str, spec.threshold.value, job.meta['instrument']]
msg_format = "No rows loaded from Job at level: '{:s}'" print(msg_format.format(level)) return None
'Operator', srd_requirement_col_name, 'Instrument')
# Calculate numbers in table """Add columns of additional metric thresholds.
Intended use is for specifying a set of release metrics that converge over time to the SRD metrics.
If release_specs_level is not present in release_specs, then the original data is unchanged. """
'instrument':row['Instrument']}, spec_tags=['chromatic']) spec_tags=['achromatic']))
release_targets, dtype=float, name='Release Target: %s' % release_specs_level)
"""Return string of formatted float, or -- if None.
Intended use is to provide formatting output for columns where where None or non-float value indicates a missing measurement. """ # This try/except handles both None and non-numeric strings. # dashes are reserved
"""Return a blank for None or 'None', else return string of input.
Intended use is to provide formatting output for columns where an empty or None value is totally reasonable and expected and should be display as a blank ''. """ return '' return ''
"""Return the first entry in 'colnames' that starts with 'prefix'."""
# Output table """Write performance report to RST file.
Parameters ---------- data : astropy.table.Table filename : str, optional Filepath of output RST file. format : str, optional astropy.table format for output table.
Creates ------- test.rst Output file with RST version of data Table. """ # Find the 'Release Target XYZ' column name # Find the 'SRD Requirement XYZ' column name
srd_requirement_col_name, release_target_col_name, 'Value', 'Comments'] # Provide default formats data[spec_col].info.format = '.2f' # Astropy 1.2.1 (the current miniconda stack install) doesn't support # overwrite=True for Tables # But in Astropy 2.0 (the modern version) reliance on automatically overwriting # ASCII files is deprecated and you get a warning if you don't specify it. # But it does still write. So for now we'll leave overwrite=True out of # the argument list below, but someday it will likely be required to include it. include_names=use_col_names) |