Skip to content

Miscellaneous deprecation warnings in rasterio, scikit-learn #16

@grovduck

Description

@grovduck

I'm finding a few warnings in some required packages using these versions:

pyimpute==0.1.2
scikit-learn==0.19.1
rasterio==1.0a12

from sklearn import cross_validation

DeprecationWarning: This module was deprecated in version 0.18 in favor of the
model_selection module into which all the refactored classes and functions are
moved. Also note that the interface of the new CV iterators are different from that of
this module. This module will be removed in 0.20.

# Save or check the geotransform
if not aff:
aff = src.affine
else:
assert aff == src.affine

RasterioDeprecationWarning: 'src.affine' is deprecated.  Please switch to
'src.transform'. See https://github.com/mapbox/rasterio/issues/86 for details

profile = {
'affine': raster_info['affine'],
'blockxsize': shape[1],
'height': shape[0],
'blockysize': 1,
'count': 1,
'crs': raster_info['crs'],
'driver': u'GTiff',
'dtype': 'int16',
'nodata': -32768,
'tiled': False,
'transform': raster_info['affine'].to_gdal(),
'width': shape[1]}
try:
response_path = os.path.join(outdir, "responses.tif")
response_ds = rasterio.open(response_path, 'w', **profile)

UserWarning: Found both 'affine' and 'transform' in rasterio.open() - choosing 'transform'

This last one also causes an UnboundLocalError in the finally block at line 232 because response_ds didn't get opened properly?

The first two didn't cause any issues. For the last one, I commented out the affine key in the profile dictionary and made transform equal to raster_info['affine'].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions