mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Refs #27656 -- Updated django.contrib docstring verb style according to PEP 257.
This commit is contained in:
parent
3f62d20a9b
commit
5411821e3b
118 changed files with 819 additions and 889 deletions
|
@ -51,7 +51,7 @@ class TransformPoint(list):
|
|||
|
||||
class GDALRaster(GDALBase):
|
||||
"""
|
||||
Wraps a raster GDAL Data Source object.
|
||||
Wrap a raster GDAL Data Source object.
|
||||
"""
|
||||
destructor = capi.close_ds
|
||||
|
||||
|
@ -165,7 +165,7 @@ class GDALRaster(GDALBase):
|
|||
@property
|
||||
def name(self):
|
||||
"""
|
||||
Returns the name of this raster. Corresponds to filename
|
||||
Return the name of this raster. Corresponds to filename
|
||||
for file-based rasters.
|
||||
"""
|
||||
return force_text(capi.get_ds_description(self._ptr))
|
||||
|
@ -173,7 +173,7 @@ class GDALRaster(GDALBase):
|
|||
@cached_property
|
||||
def driver(self):
|
||||
"""
|
||||
Returns the GDAL Driver used for this raster.
|
||||
Return the GDAL Driver used for this raster.
|
||||
"""
|
||||
ds_driver = capi.get_ds_driver(self._ptr)
|
||||
return Driver(ds_driver)
|
||||
|
@ -195,7 +195,7 @@ class GDALRaster(GDALBase):
|
|||
@property
|
||||
def srs(self):
|
||||
"""
|
||||
Returns the SpatialReference used in this GDALRaster.
|
||||
Return the SpatialReference used in this GDALRaster.
|
||||
"""
|
||||
try:
|
||||
wkt = capi.get_ds_projection_ref(self._ptr)
|
||||
|
@ -208,7 +208,7 @@ class GDALRaster(GDALBase):
|
|||
@srs.setter
|
||||
def srs(self, value):
|
||||
"""
|
||||
Sets the spatial reference used in this GDALRaster. The input can be
|
||||
Set the spatial reference used in this GDALRaster. The input can be
|
||||
a SpatialReference or any parameter accepted by the SpatialReference
|
||||
constructor.
|
||||
"""
|
||||
|
@ -238,8 +238,8 @@ class GDALRaster(GDALBase):
|
|||
@property
|
||||
def geotransform(self):
|
||||
"""
|
||||
Returns the geotransform of the data source.
|
||||
Returns the default geotransform if it does not exist or has not been
|
||||
Return the geotransform of the data source.
|
||||
Return the default geotransform if it does not exist or has not been
|
||||
set previously. The default is [0.0, 1.0, 0.0, 0.0, 0.0, -1.0].
|
||||
"""
|
||||
# Create empty ctypes double array for data
|
||||
|
@ -249,7 +249,7 @@ class GDALRaster(GDALBase):
|
|||
|
||||
@geotransform.setter
|
||||
def geotransform(self, values):
|
||||
"Sets the geotransform for the data source."
|
||||
"Set the geotransform for the data source."
|
||||
if sum([isinstance(x, (int, float)) for x in values]) != 6:
|
||||
raise ValueError('Geotransform must consist of 6 numeric values.')
|
||||
# Create ctypes double array with input and write data
|
||||
|
@ -281,7 +281,7 @@ class GDALRaster(GDALBase):
|
|||
@property
|
||||
def extent(self):
|
||||
"""
|
||||
Returns the extent as a 4-tuple (xmin, ymin, xmax, ymax).
|
||||
Return the extent as a 4-tuple (xmin, ymin, xmax, ymax).
|
||||
"""
|
||||
# Calculate boundary values based on scale and size
|
||||
xval = self.origin.x + self.scale.x * self.width
|
||||
|
@ -300,7 +300,7 @@ class GDALRaster(GDALBase):
|
|||
|
||||
def warp(self, ds_input, resampling='NearestNeighbour', max_error=0.0):
|
||||
"""
|
||||
Returns a warped GDALRaster with the given input characteristics.
|
||||
Return a warped GDALRaster with the given input characteristics.
|
||||
|
||||
The input is expected to be a dictionary containing the parameters
|
||||
of the target raster. Allowed values are width, height, SRID, origin,
|
||||
|
@ -369,7 +369,7 @@ class GDALRaster(GDALBase):
|
|||
def transform(self, srid, driver=None, name=None, resampling='NearestNeighbour',
|
||||
max_error=0.0):
|
||||
"""
|
||||
Returns a copy of this raster reprojected into the given SRID.
|
||||
Return a copy of this raster reprojected into the given SRID.
|
||||
"""
|
||||
# Convert the resampling algorithm name into an algorithm id
|
||||
algorithm = GDAL_RESAMPLE_ALGORITHMS[resampling]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue