Remove canvas_like and datashader references from source code
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start in xrspatial/utils.py by locating canvas_like() and its datashader import, then inspect the docstring example in xrspatial/zonal.py and the comment at xrspatial/terrain.py:698. Remove the stale references and unused imports, then run pytest xrspatial/tests/; done means the tests pass and no test or module imports canvas_like.
Written by the indexing model from the issue text.
Description
Reason or Problem
xrspatial/utils.py defines canvas_like(), which wraps datashader.Canvas.raster() to resample a raster. It is the only place in the library source that imports datashader, it is not exported from __init__.py, and a repo-wide search finds no callers. A couple of docstrings and a comment also mention datashader.
Proposal
- Delete
canvas_like()fromxrspatial/utils.py, including its lazyimport datashader as dsand the try/except that raises ImportError. Remove any imports the deletion leaves unused. - Rewrite the
suggest_zonal_canvas()docstring example inxrspatial/zonal.pyto usearr.xrs.rasterize(...)instead ofds.Canvas().polygons(...). The function body has no datashader dependency, so this is a docstring-only change. - Reword the comment at
xrspatial/terrain.py:698so it describes the pixel-center coordinate convention without naming datashader.
Value
Removes the library's only datashader import and trims stale references, a prerequisite for dropping datashader from packaging.
Done when
pytest xrspatial/tests/passes.- No test or module imports
canvas_like.
Part of removing datashader as a dependency; final packaging removal is tracked in #3450.
- Dominant language
- Python
- Stars
- 972
- Forks
- 92
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/xarray-spatial
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
xarray-contrib/xarray-spatial#3726 ·
-
api area:surface bug severity:medium sweep-api-consistency
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
xarray-contrib/xarray-spatial#3712 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3710 ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3707 ·
-
area:surface documentation user-guide-example
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
xarray-contrib/xarray-spatial#3464 ·
All issues in xarray-contrib/xarray-spatial
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·