Reason or Problem
xarray-spatial pulls datashader into its [examples] extra, and a handful of
source and documentation references still reach for datashader APIs
(canvas_like, ds.Canvas().points/line/polygons, shade/stack/dynspread,
Elevation/Set1/Set3 colormaps). The library no longer needs datashader:
vector rasterization is available through the arr.xrs.rasterize(...)
accessor, and rendering can be done with matplotlib.
This is a consolidated implementation of the 14 issues tracked under #3450.
Proposal
Remove every datashader dependency from library source, notebooks, examples,
packaging, and install docs, without changing any public xrspatial.*
behavior.
Deliberate datashader references that stay: the A/B benchmark in
benchmarks/rasterizer_benchmarks.py (already import-guarded, #3452 closed)
and the historical-credit prose in why_xarray_spatial.rst / index.rst.
Design: substitution-only. No new public API, no behavior changes.
Value: the [examples] extra stops pulling the heavy
datashader/numba/spatialpandas graph; the library source has zero datashader
imports; docs and examples run on matplotlib alone.
Stakeholders and Impacts
Anyone installing xarray-spatial[examples] benefits from the smaller
dependency footprint. No public API changes, so existing user code is
unaffected unless it called canvas_like (never exported, no callers).
Drawbacks
None significant. Notebook output images will differ visually (matplotlib vs
datashader rendering); acceptance is "runs top-to-bottom with no datashader
import", not pixel-identical output.
Alternatives
Keep datashader as an optional dep. Rejected: it adds weight for no current
library use.
Unresolved Questions
None. The multispectral resampling strategy (.interp/.coarsen) and the
pharmacy-deserts multi-reducer merge= semantics are confirmed against
xrspatial/rasterize.py.
Additional Notes or Context
Implements, in order: #3451, #3453, #3454, #3455, #3456, #3457, #3458, #3459,
#3460, #3461, #3462, #3463, #3464, then #3450 last. #3452 is already closed.
Reason or Problem
xarray-spatial pulls datashader into its
[examples]extra, and a handful ofsource and documentation references still reach for datashader APIs
(
canvas_like,ds.Canvas().points/line/polygons,shade/stack/dynspread,Elevation/Set1/Set3colormaps). The library no longer needs datashader:vector rasterization is available through the
arr.xrs.rasterize(...)accessor, and rendering can be done with matplotlib.
This is a consolidated implementation of the 14 issues tracked under #3450.
Proposal
Remove every datashader dependency from library source, notebooks, examples,
packaging, and install docs, without changing any public
xrspatial.*behavior.
canvas_like()fromxrspatial/utils.py; rewrite thesuggest_zonal_canvasdocstring inxrspatial/zonal.py; reword the datashader comment inxrspatial/terrain.py.3 example notebooks/script off datashader. Vector rasterization moves to
arr.xrs.rasterize(...); rendering moves tomatplotlib.pyplot.imshow.The multispectral notebook (
Canvas().raster()resampling) uses xarray.interp/.coarseninstead of the rasterize accessor.datashader >= 0.15.0from theexamplesextra insetup.cfgand remove the datashader row frominstallation.rst. Lands only after Phases 1 and 2.Deliberate datashader references that stay: the A/B benchmark in
benchmarks/rasterizer_benchmarks.py(already import-guarded, #3452 closed)and the historical-credit prose in
why_xarray_spatial.rst/index.rst.Design: substitution-only. No new public API, no behavior changes.
Value: the
[examples]extra stops pulling the heavydatashader/numba/spatialpandas graph; the library source has zero datashader
imports; docs and examples run on matplotlib alone.
Stakeholders and Impacts
Anyone installing
xarray-spatial[examples]benefits from the smallerdependency footprint. No public API changes, so existing user code is
unaffected unless it called
canvas_like(never exported, no callers).Drawbacks
None significant. Notebook output images will differ visually (matplotlib vs
datashader rendering); acceptance is "runs top-to-bottom with no datashader
import", not pixel-identical output.
Alternatives
Keep datashader as an optional dep. Rejected: it adds weight for no current
library use.
Unresolved Questions
None. The multispectral resampling strategy (
.interp/.coarsen) and thepharmacy-deserts multi-reducer
merge=semantics are confirmed againstxrspatial/rasterize.py.Additional Notes or Context
Implements, in order: #3451, #3453, #3454, #3455, #3456, #3457, #3458, #3459,
#3460, #3461, #3462, #3463, #3464, then #3450 last. #3452 is already closed.