From 3a607d291f297c7c1d323d0dba7f96b6346385f0 Mon Sep 17 00:00:00 2001 From: AlienAtSystem <67456084+AlienAtSystem@users.noreply.github.com> Date: Fri, 26 Jun 2020 09:26:31 +0200 Subject: [PATCH] Fix for bincount type touchyness np.bincount wants 'int32' as type, and accepts no other any more. Since fdir is getting typecast anyway, I just fixed it to constantly cast to the one working one. --- pysheds/grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysheds/grid.py b/pysheds/grid.py index 390c86f..cf98a0f 100644 --- a/pysheds/grid.py +++ b/pysheds/grid.py @@ -1255,7 +1255,7 @@ def _d8_accumulation(self, fdir=None, weights=None, dirmap=None, nodata_in=None, invalid_entries = fdir.flat[invalid_cells] fdir.flat[invalid_cells] = 0 # Ensure consistent types - fdir = fdir.astype(mintype) + fdir = fdir.astype('int32') # Set nodata cells to zero fdir[nodata_cells] = 0 # Get matching of start and end nodes