pyflwdir icon indicating copy to clipboard operation
pyflwdir copied to clipboard

Add conditional to set _mv variable to np.uint64 data type

Open robgpita opened this issue 1 year ago • 0 comments

Allow the processing of large rasters, shaped at (63708, 79780), for Flwdir object.

Issue addressed

Closes #46

Explanation

As described in issue #46, when large rasters are used, an IndexError was thrown from underlying numba code.

The upstream_count function was the cause of the Indexing Error, due to an incorrect value set in the _mv variable when using a np.uint64 data type.

Checklist

  • [x] Updated tests or added new tests
  • [x] Branch is up to date with main
  • [ ] Updated documentation if needed
  • [x] Updated CHANGELOG.rst if needed

Additional Notes (optional)

The setting of the np.uint64 dtype in pyflwdir.py was not accounted for, and caused non-correct values in the _mv variable, when assigned in core.py. This was causing the C pointer references to not line up with the signed integer type that was being used in python. See numpy docs for np.intp()

The downstream effects

robgpita avatar May 07 '24 21:05 robgpita