Skip to content

Commit

Permalink
Update F811 annotations for py 3.7+3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
brianv0 committed Sep 24, 2020
1 parent 61a2a9a commit 6a08ee9
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions python/lsst/afw/cameraGeom/camera/cameraContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from .camera import Camera


@continueClass # noqa: F811
class Camera:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Camera: # noqa: F811

def getPupilFactory(self, visitInfo, pupilSize, npix, **kwargs):
"""Construct a PupilFactory.
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/cameraGeom/detector/detectorContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
DetectorTypeValNameDict.items()}


@continueClass # noqa: F811
class DetectorBase:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class DetectorBase: # noqa: F811
def __iter__(self):
return (self[i] for i in range(len(self)))

Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/detection/_footprintMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from ._detection import FootprintMergeList


@continueClass # noqa: F811
class FootprintMergeList:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class FootprintMergeList: # noqa: F811
def getMergedSourceCatalog(self, catalogs, filters,
peakDist, schema, idFactory, samePeakDist):
"""Add multiple catalogs and get the SourceCatalog with merged Footprints"""
Expand Down
16 changes: 8 additions & 8 deletions python/lsst/afw/fits/fitsContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
compressionAlgorithmToString, scalingAlgorithmToString)


@continueClass # noqa: F811
class Fits:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Fits: # noqa: F811
def __enter__(self):
return self

def __exit__(self, cls, exc, traceback):
self.closeFile()


@continueClass # noqa: F811
class ImageWriteOptions:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class ImageWriteOptions: # noqa: F811
def __repr__(self):
return f"{self.__class__.__name__}(compression={self.compression!r}, scaling={self.scaling!r})"


@continueClass # noqa: F811
class ImageCompressionOptions:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class ImageCompressionOptions: # noqa: F811
def __repr__(self):
return (f"{self.__class__.__name__}(algorithm={compressionAlgorithmToString(self.algorithm)!r}, "
f"tiles={self.tiles.tolist()!r}, quantizeLevel={self.quantizeLevel:f})")


@continueClass # noqa: F811
class ImageScalingOptions:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class ImageScalingOptions: # noqa: F811
def __repr__(self):
return (f"{self.__class__.__name__}(algorithm={scalingAlgorithmToString(self.algorithm)!r}, "
f"bitpix={self.bitpix}, maskPlanes={self.maskPlanes}, seed={self.seed} "
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/geom/ellipses/axes/axesContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from .axes import Axes


@continueClass # noqa: F811
class Axes:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Axes: # noqa: F811
def __repr__(self):
return f"Axes(a={self.getA()!r}, b={self.getB()!r}, theta={self.getTheta!r})"

Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/geom/ellipses/ellipse/ellipseContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from .ellipse import Ellipse


@continueClass # noqa: F811
class Ellipse:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Ellipse: # noqa: F811
def __repr__(self):
return f"Ellipse({self.getCore()!r}, {self.getCenter()!r})"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from .quadrupole import Quadrupole


@continueClass # noqa: F811
class Quadrupole:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Quadrupole: # noqa: F811
def __repr__(self):
return f"Quadrupole(ixx={self.getIxx()!r}, iyy={self.getIyy()!r}, ixy={self.getIxy()!r})"

Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/geom/polygon/polygonContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from .polygon import Polygon


@continueClass # noqa: F811
class Polygon:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Polygon: # noqa: F811
def __repr__(self):
return f"{self.__class__.__name__}({[p for p in self.getVertices()]})"

Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/geom/skyWcs/skyWcsContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
__all__ = []


@continueClass # noqa: F811
class SkyWcs:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class SkyWcs: # noqa: F811
def pixelToSkyArray(self, x, y, degrees=False):
"""
Convert numpy array pixels (x, y) to numpy array sky (ra, dec)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/afw/geom/wcsUtils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .wcsUtils import *
from .wcsUtilsContinued import *
from .wcsUtilsContinued import *
4 changes: 2 additions & 2 deletions python/lsst/afw/image/apCorrMap/apCorrMapContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
from .apCorrMap import ApCorrMap


@continueClass # noqa: F811
class ApCorrMap:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class ApCorrMap: # noqa: F811

def keys(self):
for item in self.items():
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/afw/image/exposure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

from .exposure import *
from .exposureContinued import *
from .multiband import *
from .multiband import *
2 changes: 1 addition & 1 deletion python/lsst/afw/image/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
from .image import *
from .imageContinued import *
from .maskContinued import *
from .multiband import *
from .multiband import *
4 changes: 2 additions & 2 deletions python/lsst/afw/math/background/backgroundContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
__all__ = [] # import this module only for its side effects


@continueClass # noqa: F811
class Background:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Background: # noqa: F811
def __reduce__(self):
"""Pickling"""
return self.__class__, (self.getImageBBox(), self.getStatsImage())
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/math/chebyshevBoundedFieldContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
__all__ = [] # import this module only for its side effects


@continueClass # noqa: F811
class ChebyshevBoundedField:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class ChebyshevBoundedField: # noqa: F811
@classmethod
def approximate(cls, boundedField,
orderX=3, orderY=3,
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/table/_aliasMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from ._table import AliasMap


@continueClass # noqa: F811
class AliasMap:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class AliasMap: # noqa: F811

def keys(self):
"""Return an iterator over AliasMap keys"""
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/table/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
__all__ = ["Catalog"]


@continueClass # noqa: F811
class BaseRecord:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class BaseRecord: # noqa: F811

def extract(self, *patterns, **kwargs):
"""Extract a dictionary of {<name>: <field-value>} in which the field names
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/table/_baseColumnView.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
# base class, so we use the same naming convention we use for those.


@continueClass # noqa: F811
class _BaseColumnViewBase:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class _BaseColumnViewBase: # noqa: F811

def getBits(self, keys=None):
"""Get the bits associated with the specified keys.
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/table/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def _registerInstantiations(abc, types):
SchemaItem.alias(float, _SchemaItem["D"])


@continueClass # noqa: F811
class Schema:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class Schema: # noqa: F811

def getOrderedNames(self):
"""Return a list of field names in the order the fields were added to the Schema.
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/table/_schemaMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from ._table import SchemaMapper


@continueClass # noqa: F811
class SchemaMapper:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class SchemaMapper: # noqa: F811

def addOutputField(self, field, type=None, doc=None, units="", size=None,
doReplace=False, parse_strict="raise"):
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/table/_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
Catalog.register("Source", SourceCatalog)


@continueClass # noqa: F811
class SourceCatalog:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class SourceCatalog: # noqa: F811

def getChildren(self, parent, *args):
"""Return the subset of self for which the parent field equals the
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/typehandling/_SimpleGenericMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def fromkeys(cls, iterable, value=None):
_oldInit = SimpleGenericMapS.__init__


@continueClass # noqa F811
class SimpleGenericMapS:
@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
class SimpleGenericMapS: # noqa: F811
def __init__(self, source=None, **kwargs):
_oldInit(self)
if source:
Expand Down

0 comments on commit 6a08ee9

Please sign in to comment.