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

numpy deprecation warning with boundless read #678

Closed
grovduck opened this issue Apr 26, 2016 · 1 comment · Fixed by #680
Closed

numpy deprecation warning with boundless read #678

grovduck opened this issue Apr 26, 2016 · 1 comment · Fixed by #680
Labels
Milestone

Comments

@grovduck
Copy link
Contributor

grovduck commented Apr 26, 2016

This one I think is pretty minor, but doing the below is giving a VisibleDeprecationWarning from numpy I think:

import rasterio
with rasterio.open('tests/data/RGB.byte.tif') as src:
    window = ((-10, 100), (-10, 100))
    data = src.read(1, window=window, boundless=True)

Output:

test.py:4: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
data = src.read(1, window=window, boundless=True)

It looks like it's happening when setting row and column offsets without rounding and casting to ints (ie. https://github.com/mapbox/rasterio/blob/master/rasterio/_io.pyx#L861-871). I didn't know when in the 'future' this was going to error rather than warn ... I'm using numpy 1.11.0.

@perrygeo
Copy link
Contributor

@grovduck confirmed on numpy 1.11 and agree that that's the likely place to fix it. I'll try to work up a PR today.

@sgillies sgillies added this to the Pre-PyCon milestone May 2, 2016
@sgillies sgillies added the bug label May 2, 2016
@sgillies sgillies modified the milestones: Pre-PyCon, 0.35 May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants