import unittest
import lsst.afw.geom as afwGeom
import lsst.utils.tests
from helper import skyMapTestCase
try:
import healpy
except Exception:
healpy = None
from lsst.skymap.healpixSkyMap import HealpixSkyMap
class HealpixTestCase(skyMapTestCase.SkyMapTestCase):
def setUp(self):
17 ↛ 18line 17 didn't jump to line 18, because the condition on line 17 was never true if not healpy:
self.skipTest("Missing healpy dependency.")
config = HealpixSkyMap.ConfigClass()
nside = 2**config.log2NSide
self.setAttributes(
SkyMapClass=HealpixSkyMap,
name="healpix",
config=config,
numTracts=healpy.nside2npix(nside),
numNeighbors=1,
neighborAngularSeparation=healpy.max_pixrad(nside) * afwGeom.radians,
)
def testSha1Compare(self):
"""Test that HealpixSkyMap's extra state is included in its hash."""
defaultSkyMap = self.getSkyMap()
for log2NSide in (3, 4):
config = self.getConfig()
config.log2NSide = log2NSide
skyMap = self.getSkyMap(config=config)
self.assertNotEqual(skyMap, defaultSkyMap)
for nest in (True,):
config = self.getConfig()
config.nest = nest
skyMap = self.getSkyMap(config=config)
self.assertNotEqual(skyMap, defaultSkyMap)
def tearDown(self):
46 ↛ exitline 46 didn't return from function 'tearDown', because the condition on line 46 was never false if hasattr(self, "config"):
del self.config
class MemoryTester(lsst.utils.tests.MemoryTestCase):
pass
def setup_module(module):
lsst.utils.tests.init()
58 ↛ 59line 58 didn't jump to line 59, because the condition on line 58 was never trueif __name__ == "__main__":
lsst.utils.tests.init()
unittest.main()
|