Skip to content

Commit

Permalink
Fix raster fill_type to be integer if dtype is integer
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 committed May 19, 2023
1 parent c57c776 commit 26c8f4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datashader/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,8 @@ def raster(self,
mask = array==nan_value
array = np.ma.masked_array(array, mask=mask, fill_value=nan_value)
fill_value = nan_value
elif np.issubdtype(source.dtype, np.integer):
fill_value = 0
else:
fill_value = np.NaN

Expand Down
4 changes: 4 additions & 0 deletions datashader/tests/test_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
except ImportError:
rioxarray = None

from dask.context import config

config.set(scheduler='synchronous')

open_rasterio_available = pytest.mark.skipif(rioxarray is None and rasterio is None, reason="requires rioxarray or rasterio")

from os import path
Expand Down

0 comments on commit 26c8f4a

Please sign in to comment.