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

Update F811 annotations for py 3.7+3.8 #540

Merged
merged 1 commit into from
Oct 8, 2020
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
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
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
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