Skip to content

Fix 196 test-suite warnings (#1148)#1157

Merged
brendancol merged 1 commit into
masterfrom
issue-1148
Apr 1, 2026
Merged

Fix 196 test-suite warnings (#1148)#1157
brendancol merged 1 commit into
masterfrom
issue-1148

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • Eliminates all 196 warnings from the test suite
  • Fixes two deprecations that will become errors in future NumPy/Numba (0-d array float() cast in classify.py, reflected list in zonal.py _crop)
  • Suppresses expected RuntimeWarnings at the source (all-NaN slices in preview/zonal, NaN-to-int cast in rasterize)
  • Adds pytest filterwarnings for intentional warnings (iterative Dijkstra, memory guards) and third-party noise (pyproj, matplotlib, pytest_asyncio)

Test plan

  • Full suite: 0 warnings, no new failures
  • Verify classify box_plot still works on dask arrays
  • Verify zonal trim/crop still works with list arguments
  • Check that intentional warnings still appear for users (only suppressed in test output)

Closes #1148

Source fixes:
- classify.py: use .item() instead of float() on 0-d dask arrays (NumPy deprecation)
- zonal.py: pass numpy array instead of list to _crop/_trim (Numba reflected list deprecation)
- preview.py, zonal.py: suppress RuntimeWarning in all-NaN nanmax/nanmin calls
- rasterize.py, test_zonal.py: suppress RuntimeWarning for NaN-to-int cast

Pytest filters (setup.cfg):
- pyproj CRS.to_dict() to_proj4 UserWarning
- cost_distance/surface_distance iterative Dijkstra UserWarning
- proximity memory-guard ResourceWarning
- kriging OptimizeWarning
- matplotlib/pyparsing PyparsingDeprecationWarning
- pytest_asyncio AbstractEventLoopPolicy DeprecationWarning
- Numba NumbaPendingDeprecationWarning
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Apr 1, 2026
@brendancol brendancol merged commit 9644b4b into master Apr 1, 2026
11 checks passed
@brendancol brendancol deleted the issue-1148 branch May 4, 2026 13:05
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.

Fix 196 test-suite warnings (deprecations, RuntimeWarnings, missing filters)

1 participant