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

Miscellaneous deprecation warnings in rasterio, scikit-learn #16

Open
grovduck opened this issue Mar 7, 2018 · 0 comments
Open

Miscellaneous deprecation warnings in rasterio, scikit-learn #16

grovduck opened this issue Mar 7, 2018 · 0 comments

Comments

@grovduck
Copy link

grovduck commented Mar 7, 2018

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'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant