Skip to content

Commit

Permalink
Merge pull request #702 from lsst/tickets/DM-38499
Browse files Browse the repository at this point in the history
DM-38499: Fix some whitespace issues found by flake8 6.0
  • Loading branch information
timj committed Jul 13, 2023
2 parents 4d318ec + 0644175 commit b87b27f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python/lsst/afw/display/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/afw/geom/_hpxUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_chebyshevBoundedField.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 6 additions & 6 deletions tests/test_photoCalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_spatialCell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b87b27f

Please sign in to comment.