Skip to content

Remove esri.py and datashader from core dependencies#953

Merged
brendancol merged 4 commits into
masterfrom
issue-947
Mar 4, 2026
Merged

Remove esri.py and datashader from core dependencies#953
brendancol merged 4 commits into
masterfrom
issue-947

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #947

Summary

  • Delete esri.py (dead code: no imports, no tests, undeclared requests dependency)
  • Move datashader from install_requires to extras_require[examples] in setup.cfg
  • Replace ds.Canvas coordinate hacks in terrain.py and datasets/__init__.py with np.linspace
  • Swap datashader.transfer_functions.Image for PIL.Image in bands_to_img() and color_values()
  • Add _hex_to_rgb() to replace datashader.colors.rgb
  • canvas_like() now lazy-imports datashader and raises ImportError if missing
  • test_viewshed.py fixture builds coordinates with np.linspace instead of ds.Canvas
  • Note datashader as optional in zonal.py docstring example

Test plan

  • pytest xrspatial/tests/test_viewshed.py -- 22 passed
  • pytest xrspatial/tests/test_terrain.py -- 27 passed
  • pytest xrspatial/tests/test_utils.py -- 4 passed
  • All core imports work without datashader installed

Delete esri.py (unused REST client for ArcGIS feature services).

Move datashader from install_requires to extras_require[examples].
Replace ds.Canvas coordinate hacks in terrain.py and datasets/__init__.py
with np.linspace. Replace tf.Image with PIL.Image in bands_to_img and
color_values. Add local hex-to-RGB helper to replace datashader.colors.rgb.
Make canvas_like lazy-import datashader with a clear ImportError.
Update test_viewshed.py fixture to build coords without datashader.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Mar 4, 2026
Pillow is not a declared dependency, so importing it at module level
breaks environments that don't have it installed (like CI).
Move the import inside the two functions that need it.
@brendancol brendancol merged commit 1c79e4b into master Mar 4, 2026
11 checks passed
@brendancol brendancol deleted the issue-947 branch May 4, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove esri.py and datashader from core dependencies

1 participant