Skip to content

Commit

Permalink
Debug unittest.
Browse files Browse the repository at this point in the history
  • Loading branch information
morriscb committed Sep 24, 2020
1 parent 8ad582c commit 8f00a89
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions tests/test_diaForcedSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,6 @@ def create_test_dia_objects(n_points, wcs, startPos=100):
src.setCoord(wcs.pixelToSky(startPos + src_idx,
startPos + src_idx))

# Add points outside of the CCD.
# Fully outside.
src = objects.addNew()
src['id'] = 10000000
src.setCoord(wcs.pixelToSky(-100000,
-100000))
# y outside
src = objects.addNew()
src['id'] = 10000001
src.setCoord(wcs.pixelToSky(100,
-100000))
# x outside
src = objects.addNew()
src['id'] = 10000002
src.setCoord(wcs.pixelToSky(-100000,
100))

return objects


Expand Down Expand Up @@ -181,21 +164,21 @@ def setUp(self):
# xy outside
src = self.testDiaObjects.addNew()
src['id'] = 10000000
src.setCoord(wcs.pixelToSky(-100000,
-100000))
src.setCoord(self.wcs.pixelToSky(-100000,
-100000))
# y outside
src = self.testDiaObjects.addNew()
src['id'] = 10000001
src.setCoord(wcs.pixelToSky(100,
-100000))
src.setCoord(self.wcs.pixelToSky(100,
-100000))
# x outside
src = self.testDiaObjects.addNew()
src['id'] = 10000002
src.setCoord(wcs.pixelToSky(-100000,
100))
src.setCoord(self.wcs.pixelToSky(-100000,
100))
# Ids of objects that were "updated" during "ap_association"
# processing.
self.updatedTestIds = [1, 2, 3, 4, 10000000]
self.updatedTestIds = np.array([1, 2, 3, 4, 10000001], dtype=np.uint64)
# Expecdted number of sources is the number of updated ids plus
# plus any that are within the CCD footprint but are not in the
# above list of ids.
Expand All @@ -210,6 +193,7 @@ def testRun(self):
test_objects = self._convert_to_pandas(self.testDiaObjects)
test_objects.rename(columns={"id": "diaObjectId"},
inplace=True)
test_objects.set_index("diaObjectId", inplace=True, drop=False)
dfs = DiaForcedSourceTask()
dia_forced_sources = dfs.run(
test_objects, self.updatedTestIds, self.expIdBits, self.exposure, self.diffim)
Expand Down

0 comments on commit 8f00a89

Please sign in to comment.