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-16296: flake8 fixes #142

Merged
merged 2 commits into from
Oct 24, 2018
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/meas/algorithms/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def setDefaults(self):


class SourceDetectionTask(pipeBase.Task):
"""!
r"""!
@anchor SourceDetectionTask_

@brief Detect positive and negative sources on an exposure and return a new @link table.SourceCatalog@endlink.
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/algorithms/installGaussianPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def validate(self):
## @}

class InstallGaussianPsfTask(pipeBase.Task):
"""!Install a Gaussian PSF model in an exposure
r"""!Install a Gaussian PSF model in an exposure

@anchor InstallGaussianPsfTask_

Expand Down
6 changes: 3 additions & 3 deletions python/lsst/meas/algorithms/loadReferenceObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ class LoadReferenceObjectsConfig(pexConfig.Config):
min=0,
)
defaultFilter = pexConfig.Field(
doc="Default reference catalog filter to use if filter not specified in exposure; " +
doc="Default reference catalog filter to use if filter not specified in exposure; "
"if blank then filter must be specified in exposure",
dtype=str,
default="",
)
filterMap = pexConfig.DictField(
doc="Mapping of camera filter name: reference catalog filter name; " +
doc="Mapping of camera filter name: reference catalog filter name; "
"each reference filter must exist",
keytype=str,
itemtype=str,
Expand All @@ -148,7 +148,7 @@ class LoadReferenceObjectsConfig(pexConfig.Config):


class LoadReferenceObjectsTask(pipeBase.Task, metaclass=abc.ABCMeta):
"""!Abstract base class to load objects from reference catalogs
r"""!Abstract base class to load objects from reference catalogs

@anchor LoadReferenceObjectsTask_

Expand Down
6 changes: 3 additions & 3 deletions python/lsst/meas/algorithms/measureApCorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class MeasureApCorrConfig(lsst.pex.config.Config):
default="flagged",
)
minDegreesOfFreedom = lsst.pex.config.RangeField(
doc="Minimum number of degrees of freedom (# of valid data points - # of parameters);" +
" if this is exceeded, the order of the fit is decreased (in both dimensions), and" +
doc="Minimum number of degrees of freedom (# of valid data points - # of parameters);"
" if this is exceeded, the order of the fit is decreased (in both dimensions), and"
" if we can't decrease it enough, we'll raise ValueError.",
dtype=int,
default=1,
Expand Down Expand Up @@ -111,7 +111,7 @@ def validate(self):


class MeasureApCorrTask(Task):
"""!Task to measure aperture correction
r"""!Task to measure aperture correction

@section measAlg_MeasureApCorrTask_Contents Contents

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/algorithms/objectSizeStarSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def plot(mag, width, centers, clusterId, marker="o", markersize=2, markeredgewid

@pexConfig.registerConfigurable("objectSize", sourceSelectorRegistry)
class ObjectSizeStarSelectorTask(BaseSourceSelectorTask):
"""!A star selector that looks for a cluster of small objects in a size-magnitude plot
r"""!A star selector that looks for a cluster of small objects in a size-magnitude plot

@anchor ObjectSizeStarSelectorTask_

Expand Down
8 changes: 4 additions & 4 deletions python/lsst/meas/algorithms/pcaPsfDeterminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
nEigenComponents = self.config.nEigenComponents # initial version

if self.config.kernelSize >= 15:
self.log.warn("WARNING: NOT scaling kernelSize by stellar quadrupole moment " +
"because config.kernelSize=%s >= 15; " +
self.log.warn("WARNING: NOT scaling kernelSize by stellar quadrupole moment "
"because config.kernelSize=%s >= 15; "
"using config.kernelSize as as the width, instead",
self.config.kernelSize)
actualKernelSize = int(self.config.kernelSize)
Expand Down Expand Up @@ -332,7 +332,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
stamps.append((im, "%d%s" %
(utils.splitId(cand.getSource().getId(), True)["objId"], chi2),
cand.getStatus()))
except Exception as e:
except Exception:
continue

if len(stamps) == 0:
Expand Down Expand Up @@ -423,7 +423,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
candCenter = lsst.geom.PointD(cand.getXCenter(), cand.getYCenter())
try:
im = cand.getMaskedImage(kernel.getWidth(), kernel.getHeight())
except Exception as e:
except Exception:
continue

fit = fitKernelParamsToImage(noSpatialKernel, im, candCenter)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/algorithms/readFitsCatalogTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ReadFitsCatalogConfig(pexConfig.Config):


class ReadFitsCatalogTask(pipeBase.Task):
"""!Read an object catalog from a FITS table
r"""!Read an object catalog from a FITS table

@anchor ReadFitsCatalogTask_

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/algorithms/readTextCatalogTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ReadTextCatalogConfig(pexConfig.Config):


class ReadTextCatalogTask(pipeBase.Task):
"""!Read an object catalog from a text file
r"""!Read an object catalog from a text file

@anchor ReadTextCatalogTask_

Expand Down
4 changes: 2 additions & 2 deletions python/lsst/meas/algorithms/subtractBackground.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class SubtractBackgroundConfig(pexConfig.Config):
## @}

class SubtractBackgroundTask(pipeBase.Task):
"""!Subtract the background from an exposure
r"""!Subtract the background from an exposure

@anchor SubtractBackgroundTask_

Expand Down Expand Up @@ -349,7 +349,7 @@ def fitBackground(self, maskedImage, nx=0, ny=0, algorithm=None):
(nx, ny, order, binSizeX, binSizeY))
elif self.config.undersampleStyle == "REDUCE_INTERP_ORDER":
if order < 1:
raise ValueError("Cannot reduce approxOrder below 0. " +
raise ValueError("Cannot reduce approxOrder below 0. "
"Try using undersampleStyle = \"INCREASE_NXNYSAMPLE\" instead?")
order = min(nx, ny) - 1
self.log.warn("Reducing approxOrder to %d" % order)
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[flake8]
max-line-length = 110
ignore = E133, E226, E228, N802, N803, N806, E266
ignore = E133, E226, E228, N802, N803, N806, E266, W504
# TODO: remove E266 when Task documentation is converted to rst in DM-14207.
exclude = __init__.py

[tool:pytest]
addopts = --flake8
flake8-ignore = E133 E226 E228 N802 N803 N806
flake8-ignore = E133 E226 E228 N802 N803 N806 W504
# TODO: remove E266 lines when Task documentation is converted to rst in DM-14207.
detection.py E266
installGaussianPsf.py E266
Expand Down
1 change: 0 additions & 1 deletion tests/test_coaddPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ def testSimpleGaussian(self):
m1coadd, m2coadd = getCoaddSecondMoments(mypsf, lsst.geom.Point2D(1000, 1001))
self.assertAlmostEqual(m1, m1coadd, delta=0.01)


# This test checks to be sure that the weights are being applied correctly in doComputeImage
# Since the 2nd moments are linear in the function value, we can simply weight the moments
# and be sure that the resulting moments are correct
Expand Down