Skip to content

Commit

Permalink
Cleanup test code and docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Apr 13, 2024
1 parent 6b5f9f7 commit 5e4533d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 33 deletions.
4 changes: 2 additions & 2 deletions tests/SillyCentroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class SillyCentroidControl {

/**
* @brief A class that calculates a centroid as a simple unweighted first moment
* of the 3x3 region around a pixel.
* of the 3x3 region around a pixel; this should only be used in tests.
*
* A fixed background (set via config) may optionally be subtracted.
* This algorithm does not currently report an error, but it probably should.
* This algorithm does not report an error.
*/

class SillyCentroidAlgorithm : public lsst::meas::base::SimpleAlgorithm {
Expand Down
6 changes: 0 additions & 6 deletions tests/test_ImportCentroidAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ class CentroidTestCase(lsst.utils.tests.TestCase):
"""A test case for centroiding.
"""

def setUp(self):
pass

def tearDown(self):
pass

def testApplyCentroid(self):
"""Test that we can instantiate and play with SillyMeasureCentroid.
"""
Expand Down
5 changes: 0 additions & 5 deletions tests/test_NaiveCentroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ def setUp(self):
self.dataset = lsst.meas.base.tests.TestDataset(self.bbox)
self.dataset.addSource(100000.0, self.center)

def tearDown(self):
del self.center
del self.bbox
del self.dataset

def testSingleFramePlugin(self):
# import os; print(os.getpid()); import ipdb; ipdb.set_trace();
with self.assertWarnsRegex(FutureWarning, "Plugin 'NaiveCentroid' is deprecated"):
Expand Down
20 changes: 0 additions & 20 deletions tests/test_centroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,14 @@
import lsst.utils.tests as utilsTests
import lsst.afw.detection as afwDetection

try:
type(verbose)
except NameError:
display = False
verbose = 0


class CentroidTestCase(utilsTests.TestCase):
"""A test case for centroiding.
"""

def setUp(self):
pass

def tearDown(self):
pass

def testCleanup(self):
"""Test that tearDown does"""
pass

def do_testAstrometry(self, alg, bkgd, control):
"""Test that we can instantiate and play with a centroiding algorithm.
"""

schema = afwTable.SourceTable.makeMinimalSchema()
schema.getAliasMap().set("slot_Centroid", "test")
centroider = alg(control, "test", schema)
Expand Down Expand Up @@ -154,9 +137,6 @@ def setUp(self):
im[int(self.xcen) + i, int(self.ycen) + j, afwImage.LOCAL] = \
self.I0*(1 - 0.5*math.hypot(i - 0.5, j))

def tearDown(self):
del self.exp

def testCentroider(self):
"""Measure the centroid.
"""
Expand Down

0 comments on commit 5e4533d

Please sign in to comment.