Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-38499: Fix some whitespace issues found by flake8 6.0 #702

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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