Skip to content

Commit

Permalink
Merge pull request #88 from lsst/tickets/DM-15442
Browse files Browse the repository at this point in the history
DM-15442: Add missing pyList=[] to test/SConscript files
  • Loading branch information
r-owen committed Aug 17, 2018
2 parents ca0ebdf + faa6d86 commit f51232b
Show file tree
Hide file tree
Showing 32 changed files with 92 additions and 143 deletions.
19 changes: 4 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,7 @@ sudo: false
language: python
matrix:
include:
- python: "3.5"
env: LTD_MASON_BUILD=true
install:
- pip install -r requirements.txt
- pip install "ltd-mason>=0.2,<0.3"
script:
- sphinx-build -b html -a -n -d _build/doctree . _build/html
after_success:
- ltd-mason-travis --html-dir _build/html
env:
global:
- LTD_MASON_BUILD=false # disable builds in regular text matrix
- LTD_MASON_PRODUCT="validate-drp"
- secure: "w7TUcimmZ+bn8BWwGmIhtwnOvw4LcZnQyWtKCp5qFvUkj/eU4zWa012tgTsHQ3T76kiOc5qMFTl+SXePPOgW421J/VoPrciOmu0qTBvBj5suEk+5agYHF7fz8dcU1Q2ijaFHGTAZ2BxlxsErj2YfFWfTBdKvZtghNqdB+pGOA2UdReX0XPUTKNwDeep36atkTzBwsXOD66ZDash+WQza7ByTuY1vV7hQrl5C2wEZJsaPuSGd/XjWuhcuBHsbOR7r+rzDjKQX25pPpVWzU1STJ4XCuNqpJn90O2xEsWHaDPYe83470fpifHccaFa2A0qMWQsoq3yO6+/x9992OzLSZ44oGFuskWYMqTCyBF31J6lnK/39+EMe8rawXixOBX/TGeZQmREfIM4uoc6M0uwfjo5PvhJayhOzYmuTS9p/vCvbgfqzf6cYRPh0DNX9MSDaab/htIjDOAilUWqgB+faNQeLpLxapwSrAeaaEZ7bOwiJIhML6No369fVIOv6WP+0Livv+fi1o6SE183tAkeGT5NrxQAlYeak4mj3jRH84Agts/a7bHbyeQlDbuzV8LRBpX0DoAg/5Agh2rldGdRZ8/dMF2UTemoCcpzMfVGj/spIobIeTfVtXwaTTAQg8f5C5UoLc8F7pDIatuj3RoV1h2v8y1vdudLU1OZ0YqRdmU8="
- secure: "OdXoJ7qDt1wPV6DsMcC6hlGwLzoFkH3/YPOUz1tmqPHMav+px+HzLXOEbJj0q+fWzZkaohOaJPxOaFhdGRKGXj0v8+53vNIUslPF8oBQe9390nYnrKJkUbc78qgwJaLKnSHzDcVvj6s9+lpuDGwJXnamDw+pCEeZGmaM1bwVWJJbpiV6701AO2sQDnUJWJy922Jgc0CNYIHKmL7WyJ43ZRmZ/T9SXZtKXJGC9UpHPbtYxOwzn1u7u7aH8oFJRVmyutaXi7HZzOiXbjxDcOFbGBMa1ClBEwhQMzv9zSS4AGBiM0N8lUeZrPemJ1EK8WM1rO+td5ygkZ6JzO0l2kza3EABX7LwWzJQQD1vbu0ALVXzF5oxqaW8R7RM6TnKLNA6zXSGYWs7UhprqdBnHjWYEgybML4c5ZGlM9x7Fux43XHIpW2fOzzCdpZhflGaOCwVoD1YSBVhrqCus08Pa1NOJpflL+ZvT1bFWmd99yMkPoNHqS/CopSDCLqm3UIZnKOQAmWVY+3pWvBcIz2z28U99Z2553ZTvZCl3CooywCVzO0QuGmPYxibG++ymWm4L6H2bIl9M3W06XyYjXu18bX2OI0MQDRyGNLHrPoIVuepcDShcRtiG2+Dza1NQ0EEmcYildlCvxW8rN7x1DjY8iR/yn/fNR8HBaA1/fqKkaEc4MU="
- python: '3.6'
install:
- pip install flake8
script: flake8
1 change: 0 additions & 1 deletion bin.src/makeRunList.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function

import os.path
import sys
Expand Down
2 changes: 1 addition & 1 deletion bin.src/matchedVisitMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# see <http://www.lsstcorp.org/LegalNotices/>.
#
import matplotlib
matplotlib.use('Agg')
matplotlib.use('Agg') # noqa E402

from lsst.validate.drp.matchedVisitMetricsTask import MatchedVisitMetricsTask

Expand Down
3 changes: 0 additions & 3 deletions bin.src/reportPerformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import division, print_function, absolute_import

import argparse
import os.path

from lsst.utils import getPackageDir
from lsst.validate.drp import report_performance

description = """
Expand Down
7 changes: 1 addition & 6 deletions bin.src/validateDrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,18 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function

# Ensure that this script will run on a mis-configured node
# that may default to a backend that requires X
# e.g., 'Qt5Agg', even though there is is no display available
# Putting this here in the command-line script is fine because no one
# should import this script.
import matplotlib
matplotlib.use('Agg')
matplotlib.use('Agg') # noqa E402

import argparse
import os.path
import sys

from lsst.utils import getPackageDir
from lsst.validate.drp import validate, util
from lsst.verify import MetricSet


description = """
Expand Down
1 change: 0 additions & 1 deletion python/lsst/validate/drp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from __future__ import absolute_import

from .version import *
16 changes: 7 additions & 9 deletions python/lsst/validate/drp/astromerrmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""Analytic astrometric accuracy model.
"""

from __future__ import print_function, absolute_import
__all__ = ['astromErrModel', 'fitAstromErrModel', 'build_astrometric_error_model']

import astropy.units as u
import numpy as np
Expand All @@ -29,9 +29,6 @@
from lsst.verify import Blob, Datum


__all__ = ['astromErrModel', 'fitAstromErrModel', 'build_astrometric_error_model']


def astromErrModel(snr, theta=1000, sigmaSys=10, C=1, **kwargs):
"""Calculate expected astrometric uncertainty based on SNR.
Expand Down Expand Up @@ -103,7 +100,7 @@ def fitAstromErrModel(snr, dist):


def build_astrometric_error_model(matchedMultiVisitDataset, brightSnr=100,
medianRef=100, matchRef=500):
medianRef=100, matchRef=500):
"""Serializable model of astrometry errors across multiple visits.
.. math::
Expand Down Expand Up @@ -153,12 +150,13 @@ def build_astrometric_error_model(matchedMultiVisitDataset, brightSnr=100,
medianRef = medianRef * u.marcsec

_compute(blob,
matchedMultiVisitDataset['snr'].quantity,
matchedMultiVisitDataset['dist'].quantity,
len(matchedMultiVisitDataset.goodMatches),
brightSnr, medianRef, matchRef)
matchedMultiVisitDataset['snr'].quantity,
matchedMultiVisitDataset['dist'].quantity,
len(matchedMultiVisitDataset.goodMatches),
brightSnr, medianRef, matchRef)
return blob


def _compute(blob, snr, dist, nMatch, brightSnr, medianRef, matchRef):
median_dist = np.median(dist)
msg = 'Median value of the astrometric scatter - all magnitudes: ' \
Expand Down
1 change: 0 additions & 1 deletion python/lsst/validate/drp/calcsrd/adx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function, absolute_import

import numpy as np
import astropy.units as u
Expand Down
1 change: 0 additions & 1 deletion python/lsst/validate/drp/calcsrd/afx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function, absolute_import

import numpy as np
import astropy.units as u
Expand Down
3 changes: 0 additions & 3 deletions python/lsst/validate/drp/calcsrd/amx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function, absolute_import
from builtins import zip

import numpy as np
import astropy.units as u

Expand Down
3 changes: 0 additions & 3 deletions python/lsst/validate/drp/calcsrd/pa1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function, absolute_import
from builtins import range

import math

import numpy as np
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/validate/drp/calcsrd/pa2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function, absolute_import

import numpy as np
import astropy.units as u

from lsst.verify import Measurement, Datum


def measurePA2(metric, pa1, pf1_thresh):
def measurePA2(metric, pa1, pf1_thresh):
"""Measurement of PA2: millimag from median RMS (see PA1) of which
PF1 of the samples can be found.
Expand Down
1 change: 0 additions & 1 deletion python/lsst/validate/drp/calcsrd/pf1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function, absolute_import

import numpy as np
import astropy.units as u
Expand Down
4 changes: 1 addition & 3 deletions python/lsst/validate/drp/matchedVisitMetricsTask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import division, print_function, absolute_import
__all__ = ["MatchedVisitMetricsRunner", "MatchedVisitMetricsConfig", "MatchedVisitMetricsTask"]

import os

Expand All @@ -7,8 +7,6 @@
from lsst.meas.base.forcedPhotCcd import PerTractCcdDataIdContainer
from .validate import runOneFilter, plot_metrics

__all__ = ["MatchedVisitMetricsRunner", "MatchedVisitMetricsConfig", "MatchedVisitMetricsTask"]


class MatchedVisitMetricsRunner(TaskRunner):
"""Subclass of TaskRunner for MatchedVisitMetrics
Expand Down
5 changes: 1 addition & 4 deletions python/lsst/validate/drp/matchreduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
for measurement classes, plotting functions, and JSON persistence.
"""

from __future__ import print_function, absolute_import
__all__ = ['build_matched_dataset']

import numpy as np
import astropy.units as u
Expand All @@ -41,9 +41,6 @@
ellipticity_from_cat)


__all__ = ['build_matched_dataset']


def build_matched_dataset(repo, dataIds, matchRadius=None, safeSnr=50.,
useJointCal=False, skipTEx=False):
"""Construct a container for matched star catalogs from multple visits, with filtering,
Expand Down
25 changes: 11 additions & 14 deletions python/lsst/validate/drp/photerrmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""Analytic single-visit photometric error model.
"""

from __future__ import print_function, absolute_import
__all__ = ['photErrModel', 'fitPhotErrModel', 'build_photometric_error_model']

import astropy.units as u
import numpy as np
Expand All @@ -29,9 +29,6 @@
from lsst.verify import Blob, Datum


__all__ = ['photErrModel', 'fitPhotErrModel', 'build_photometric_error_model']


def photErrModel(mag, sigmaSys, gamma, m5, **kwargs):
"""Model of photometric error for a single visit.
Expand Down Expand Up @@ -190,7 +187,6 @@ def build_photometric_error_model(matchedMultiVisitDataset, brightSnr=100, media
"""
blob = Blob('PhotometricErrorModel')


# FIXME add a description field to blobs?
# _doc['doc'] \
# = "Photometric uncertainty model from " \
Expand All @@ -204,17 +200,18 @@ def build_photometric_error_model(matchedMultiVisitDataset, brightSnr=100, media
if not isinstance(brightSnr, u.Quantity):
brightSnr = brightSnr * u.Unit('')
_compute(blob,
matchedMultiVisitDataset['snr'].quantity,
matchedMultiVisitDataset['mag'].quantity,
matchedMultiVisitDataset['magerr'].quantity,
matchedMultiVisitDataset['magrms'].quantity,
matchedMultiVisitDataset['dist'].quantity,
len(matchedMultiVisitDataset.goodMatches),
brightSnr,
medianRef,
matchRef)
matchedMultiVisitDataset['snr'].quantity,
matchedMultiVisitDataset['mag'].quantity,
matchedMultiVisitDataset['magerr'].quantity,
matchedMultiVisitDataset['magrms'].quantity,
matchedMultiVisitDataset['dist'].quantity,
len(matchedMultiVisitDataset.goodMatches),
brightSnr,
medianRef,
matchRef)
return blob


def _compute(blob, snr, mag, magErr, magRms, dist, nMatch,
brightSnr, medianRef, matchRef):
blob['brightSnr'] = Datum(quantity=brightSnr,
Expand Down
14 changes: 6 additions & 8 deletions python/lsst/validate/drp/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
as analytic models of photometric and astrometric repeatability.
"""

from __future__ import print_function, division
__all__ = ['plotOutlinedAxline',
'plotAstrometryErrorModel',
'plotAstromErrModelFit', 'plotPhotErrModelFit',
'plotPhotometryErrorModel', 'plotPA1', 'plotAMx']


import matplotlib.pylab as plt
import numpy as np
Expand All @@ -32,12 +36,6 @@
from lsst.verify import Name


__all__ = ['plotOutlinedAxline',
'plotAstrometryErrorModel',
'plotAstromErrModelFit', 'plotPhotErrModelFit',
'plotPhotometryErrorModel', 'plotPA1', 'plotAMx']


# Plotting defaults
plt.rcParams['axes.linewidth'] = 2
plt.rcParams['mathtext.default'] = 'regular'
Expand Down Expand Up @@ -622,7 +620,7 @@ def plotTEx(job, tex, filterName, texSpecName='design', outputPrefix=''):
D = tex.extras['D'].quantity
bin_range_operator = tex.extras['bin_range_operator'].quantity

ax1.errorbar(radius.value, xip.value, yerr=xip_err.value)
ax1.errorbar(radius.value, xip.value, yerr=xip_err.value)
ax1.set_xscale('log')
ax1.set_xlabel('Separation (arcmin)', size=19)
ax1.set_ylabel('Median Residual Ellipticity Correlation', size=19)
Expand Down
12 changes: 6 additions & 6 deletions python/lsst/validate/drp/report_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ def objects_to_table(input_objects, level='design'):
spec = job.specs[spec_key]
if spec is None:
for spec_key in spec_set:
if level in spec_key.metric: # For dependent metrics
if level in spec_key.metric: # For dependent metrics
spec = job.specs[spec_key]
if np.isnan(m.quantity):
meas_quantity_value = "**" # -- is reserved in rst for headers
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,
Expand Down Expand Up @@ -160,10 +160,10 @@ def add_release_spec(data, release_specs, release_specs_level):
release_targets = []
for row in data:

specs = release_specs.subset(required_meta={'filter_name':row['Filter'],
'instrument':row['Instrument']},
specs = release_specs.subset(required_meta={'filter_name': row['Filter'],
'instrument': row['Instrument']},
spec_tags=['chromatic'])
specs.update(release_specs.subset(required_meta={'instrument':row['Instrument']},
specs.update(release_specs.subset(required_meta={'instrument': row['Instrument']},
spec_tags=['achromatic']))
value = None
for spec in specs:
Expand All @@ -188,7 +188,7 @@ def float_or_dash(f, format_string='{:.3g}'):
try:
f = float(f)
return format_string.format(f)
except:
except Exception:
# dashes are reserved
return '**'

Expand Down

0 comments on commit f51232b

Please sign in to comment.