Skip to content

Commit

Permalink
Ignore N807 on lines defining functions for classes
Browse files Browse the repository at this point in the history
  • Loading branch information
brianv0 committed Sep 19, 2018
1 parent 7a2ee2b commit 28c37d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/lsst/afw/image/slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ def clone(self):
return cls(self, True)
cls.clone = clone

def __getitem__(self, imageSlice):
def __getitem__(self, imageSlice): # noqa: N807
box, index, origin = translateSliceArgs(imageSlice, self.getBBox)
if box is not None:
return self.subset(box, origin=origin)
return self._get(index, origin=origin)
cls.__getitem__ = __getitem__

def __setitem__(self, imageSlice, rhs):
def __setitem__(self, imageSlice, rhs): # noqa: N807
box, index, origin = translateSliceArgs(imageSlice, self.getBBox)
if box is not None:
if self.assign(rhs, box, origin) is NotImplemented:
Expand Down
10 changes: 5 additions & 5 deletions python/lsst/afw/table/match/matchContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
from .match import SimpleMatch, ReferenceMatch, SourceMatch


def __repr__(self):
def __repr__(self): # noqa: N807
return "Match(%s,\n %s,\n %g)" % \
(repr(self.first), repr(self.second), self.distance)


def __str__(self):
def __str__(self): # noqa: N807
def sourceRaDec(s):
if hasattr(s, "getRa") and hasattr(s, "getDec"):
return " RA,Dec=(%g,%g) deg" % (s.getRa().asDegrees(), s.getDec().asDegrees())
Expand All @@ -49,7 +49,7 @@ def sourceStr(s):
return "Match(%s, %s, dist %g)" % (sourceStr(self.first), sourceStr(self.second), self.distance,)


def __getitem__(self, i):
def __getitem__(self, i): # noqa: N807
"""Treat a Match as a tuple of length 3: (first, second, distance)"""
if i > 2 or i < -3:
raise IndexError(i)
Expand All @@ -63,7 +63,7 @@ def __getitem__(self, i):
return self.distance


def __setitem__(self, i, val):
def __setitem__(self, i, val): # noqa: N807
"""Treat a Match as a tuple of length 3: (first, second, distance)"""
if i > 2 or i < -3:
raise IndexError(i)
Expand All @@ -77,7 +77,7 @@ def __setitem__(self, i, val):
self.distance = val


def __len__(self):
def __len__(self): # noqa: N807
return 3


Expand Down

0 comments on commit 28c37d0

Please sign in to comment.