Coverage for tests/test_reserveSourcesTask.py : 96%

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 2008-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/>. #
"""TestCase for the ReserveSourcesTask"""
"""Construct the test environment
This isn't called 'setUp' because we want to vary the `fraction`.
Parameters ---------- name : `str` Name of column for flagging reserved sources (without "_reserved"). fraction : `float` Fraction of sources to reserve.
Return struct elements ---------------------- catalog : `lsst.afw.table.SourceCatalog` Catalog of sources. task : `lsst.meas.algorithms.ReserveSourcesTask` Task to do the reservations. key : `lsst.afw.table.Key` Key to the flag column. """ doc="Documentation is good", config=config)
"""Check that source reservation is working
We test that the source reservation works, that it depends on the RNG seed and that things behave as we expect when there's a prior selection.
Parameters ---------- catalog : `lsst.afw.table.Catalog` or `list` of `lsst.afw.table.Record` List of sources. task : `lsst.meas.algorithms.ReserveSourcesTask` Task to do the reservations. key : `lsst.afw.table.Key` Key to the flag column. fraction : `float` Fraction of sources to reserve. """
# No prior
# Second run with different seed; clear the flag first "Pretty unlikely since different seeds\n" + message)
# Run with prior selection; clear the flag first "Flags should change, despite same see\n" + message) "No sources should be both reserved and used\n" + message) # "Actual definition of 'use'\n" + message)
"""Test source reservation with a Catalog
We test multiple reservation fractions. """
"""Test source reservation with a list of sources"""
import sys setup_module(sys.modules[__name__]) unittest.main() |