Remove canvas_like and datashader references from source code

オープン
#3,451 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
data

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

area:utilities enhancement

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() from xrspatial/utils.py, including its lazy import datashader as ds and the try/except that raises ImportError. Remove any imports the deletion leaves unused.
  • Rewrite the suggest_zonal_canvas() docstring example in xrspatial/zonal.py to use arr.xrs.rasterize(...) instead of ds.Canvas().polygons(...). The function body has no datashader dependency, so this is a docstring-only change.
  • Reword the comment at xrspatial/terrain.py:698 so 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.

主要言語
Python
スター
972
フォーク
92
平均マージ
2日 12時間
マージ済み PR(30日)
7

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xarray-contrib/xarray-spatial のほかの issue

xarray-contrib/xarray-spatial の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。