Change super() usage to be Python 3 compatible only

This commit is contained in:
Sean Gillies 2021-04-26 16:06:25 -06:00
parent 0d16816389
commit c923c03e3d
6 changed files with 13 additions and 11 deletions

View File

@ -1,9 +1,10 @@
Changes
=======
1.2.3 (TBD)
-----------
1.2.3 (2021-04-26)
------------------
- Change usage of super() to be Python 3 compatible only.
- Use numpy.isclose instead of equals when merging float data (fixes #2163).
- The restriction on resampling methods available to overviews has been made
more clear with the addition of a not-yet-public _OverviewResampling enum
@ -12,7 +13,7 @@ Changes
of zero height or width.
- Search for GDAL data in installed packages is done before searching in
built-in locations when entering an Env, as is already done when importing
rasterio.env.
rasterio.env.
1.2.2 (2021-04-06)
------------------

View File

@ -27,7 +27,7 @@ import rasterio.enums
import rasterio.path
__all__ = ['band', 'open', 'pad', 'Env']
__version__ = "1.2.3dev"
__version__ = "1.2.3"
__gdal_version__ = gdal_version()
# Rasterio attaches NullHandler to the 'rasterio' logger and its

View File

@ -333,7 +333,7 @@ cdef class GDALEnv(ConfigEnv):
"""Configuration and driver management"""
def __init__(self, **options):
super(GDALEnv, self).__init__(**options)
super().__init__(**options)
self._have_registered_drivers = False
def start(self):

View File

@ -1153,14 +1153,14 @@ cdef class WarpedVRTReaderBase(DatasetReaderBase):
if kwargs.get("boundless", False):
raise ValueError("WarpedVRT does not permit boundless reads")
else:
return super(WarpedVRTReaderBase, self).read(indexes=indexes, out=out, window=window, masked=masked, out_shape=out_shape, resampling=resampling, fill_value=fill_value, out_dtype=out_dtype)
return super().read(indexes=indexes, out=out, window=window, masked=masked, out_shape=out_shape, resampling=resampling, fill_value=fill_value, out_dtype=out_dtype)
def read_masks(self, indexes=None, out=None, out_shape=None, window=None, resampling=Resampling.nearest, **kwargs):
"""Read raster band masks as a multidimensional array"""
if kwargs.get("boundless", False):
raise ValueError("WarpedVRT does not permit boundless reads")
else:
return super(WarpedVRTReaderBase, self).read_masks(indexes=indexes, out=out, window=window, out_shape=out_shape, resampling=resampling)
return super().read_masks(indexes=indexes, out=out, window=window, out_shape=out_shape, resampling=resampling)
def _suggested_proxy_vrt_doc(width, height, transform=None, crs=None, gcps=None):

View File

@ -38,7 +38,7 @@ class FileOverwriteError(FileError):
def __init__(self, message):
"""Raise FileOverwriteError with message as hint."""
super(FileOverwriteError, self).__init__('', hint=message)
super().__init__('', hint=message)
class RasterioIOError(IOError):

View File

@ -101,8 +101,9 @@ class MemoryFile(MemoryFileBase):
-------
MemoryFile
"""
super(MemoryFile, self).__init__(
file_or_bytes=file_or_bytes, dirname=dirname, filename=filename, ext=ext)
super().__init__(
file_or_bytes=file_or_bytes, dirname=dirname, filename=filename, ext=ext
)
@ensure_env
def open(self, driver=None, width=None, height=None, count=None, crs=None,
@ -153,7 +154,7 @@ class ZipMemoryFile(MemoryFile):
"""
def __init__(self, file_or_bytes=None):
super(ZipMemoryFile, self).__init__(file_or_bytes, ext='zip')
super().__init__(file_or_bytes, ext="zip")
@ensure_env
def open(self, path, driver=None, sharing=False, **kwargs):