Deltares / pyflwdir

Fast methods to work with hydro- and topography data in pure Python.
https://deltares.github.io/pyflwdir/latest
MIT License
73 stars 27 forks source link

Numba error creating flow direction raster #6

Closed JasonDalton closed 2 years ago

JasonDalton commented 2 years ago

I think I have the error narrowed down to how the JIT compiler views either the rasterio object or the parameters sent to pyflwdir.from_dem() function. I have a simple example based on the Quickstart from the documentation. The error occurs when i try to create a flow direction raster from elevation read through rasterio.
https://colab.research.google.com/drive/1engswQ4uaKB0UMMM4zt8YzC8wEAnK1o1?usp=sharing

DirkEilander commented 2 years ago

Hi @JasonDalton Thanks for sharing the issue and notebook.

The first error you get is from the missing nodata value on the raster (nodata = None), which we should deal with in the code. If you remove the nodata argument from the from_dem method you get past the first error.

However, there is still another numba error which seems related to the numba version (0.51.0) you are using. By upgrading numba this error is also solved. I'll do some more tests to see if we need to bump the minimal required numba version.

JasonDalton commented 2 years ago

Thanks @DirkEilander I tried your recommended fixes and they worked great. I went to numba v 0.54.1