diff --git a/python/lsst/afw/display/utils.py b/python/lsst/afw/display/utils.py index 622c707cad..3fb2e865c4 100644 --- a/python/lsst/afw/display/utils.py +++ b/python/lsst/afw/display/utils.py @@ -205,7 +205,7 @@ def makeMosaic(self, images=None, display="deferToFrame", mode=None, if nx > self.nImage: nx = self.nImage - assert(nx*ny >= self.nImage) + assert nx*ny >= self.nImage elif mode == "x": nx, ny = self.nImage, 1 elif mode == "y": diff --git a/python/lsst/afw/geom/_hpxUtils.py b/python/lsst/afw/geom/_hpxUtils.py index 13cae5a62e..723f455513 100644 --- a/python/lsst/afw/geom/_hpxUtils.py +++ b/python/lsst/afw/geom/_hpxUtils.py @@ -424,7 +424,7 @@ def hash2i0(self, _hash): ij : `np.int64` Single value from which 2d coordinates can be extracted. """ - assert((0xFFFFFFFF33333333 & np.int64(_hash)) == 0) + assert (0xFFFFFFFF33333333 & np.int64(_hash)) == 0 return self.hash2ij(_hash) def ij2i(self, ij): diff --git a/tests/test_chebyshevBoundedField.py b/tests/test_chebyshevBoundedField.py index eacef726b0..db72edf238 100644 --- a/tests/test_chebyshevBoundedField.py +++ b/tests/test_chebyshevBoundedField.py @@ -177,7 +177,7 @@ def testMultiplyImageRaisesUnequalBBox(self): field = lsst.afw.math.ChebyshevBoundedField(self.image.getBBox(), coefficients) subBox = lsst.geom.Box2I(lsst.geom.Point2I(0, 3), lsst.geom.Point2I(3, 4)) subImage = self.image.subset(subBox) - with(self.assertRaises(RuntimeError)): + with self.assertRaises(RuntimeError): field.multiplyImage(subImage) def testMultiplyImageOverlapSubImage(self): diff --git a/tests/test_photoCalib.py b/tests/test_photoCalib.py index 2bffdde7b7..d7fb9174f9 100644 --- a/tests/test_photoCalib.py +++ b/tests/test_photoCalib.py @@ -642,26 +642,26 @@ def testCalibrateImageNonConstantSubimage(self): def testNonPositiveMeans(self): # no negative calibrations - with(self.assertRaises(lsst.pex.exceptions.InvalidParameterError)): + with self.assertRaises(lsst.pex.exceptions.InvalidParameterError): lsst.afw.image.PhotoCalib(-1.0) # no negative errors - with(self.assertRaises(lsst.pex.exceptions.InvalidParameterError)): + with self.assertRaises(lsst.pex.exceptions.InvalidParameterError): lsst.afw.image.PhotoCalib(1.0, -1.0) # no negative calibration mean when computed from the bounded field negativeCalibration = lsst.afw.math.ChebyshevBoundedField(self.bbox, np.array([[-self.calibration]])) - with(self.assertRaises(lsst.pex.exceptions.InvalidParameterError)): + with self.assertRaises(lsst.pex.exceptions.InvalidParameterError): lsst.afw.image.PhotoCalib(negativeCalibration) # no negative calibration error - with(self.assertRaises(lsst.pex.exceptions.InvalidParameterError)): + with self.assertRaises(lsst.pex.exceptions.InvalidParameterError): lsst.afw.image.PhotoCalib(self.constantCalibration, -1.0) # no negative explicit calibration mean - with(self.assertRaises(lsst.pex.exceptions.InvalidParameterError)): + with self.assertRaises(lsst.pex.exceptions.InvalidParameterError): lsst.afw.image.PhotoCalib(-1.0, 0, self.constantCalibration, True) # no negative calibration error - with(self.assertRaises(lsst.pex.exceptions.InvalidParameterError)): + with self.assertRaises(lsst.pex.exceptions.InvalidParameterError): lsst.afw.image.PhotoCalib(1.0, -1.0, self.constantCalibration, True) def testPositiveErrors(self): diff --git a/tests/test_spatialCell.py b/tests/test_spatialCell.py index 69e2882f99..f8737a61e0 100644 --- a/tests/test_spatialCell.py +++ b/tests/test_spatialCell.py @@ -225,8 +225,8 @@ def testSpatialCell(self): dx, dy, sx, sy = 100, 100, 50, 50 for x0, y0 in [(0, 0), (100, 100)]: # only works for tests where dx,dx is some multiple of sx,sy - assert(dx//sx == float(dx)/float(sx)) - assert(dy//sy == float(dy)/float(sy)) + assert dx//sx == float(dx)/float(sx) + assert dy//sy == float(dy)/float(sy) bbox = lsst.geom.Box2I(lsst.geom.Point2I(x0, y0), lsst.geom.Extent2I(dx, dy))