Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR focuses on reducing noisy warnings and improving geospatial/parallel-processing hygiene by tightening tests, centralizing coordinate transforms, and ensuring resources (notably Dask clients) are cleaned up.
Changes:
- Updated unit tests to explicitly assert and/or capture expected warnings and to make CRS handling more explicit in test fixtures.
- Introduced/expanded shared CRS/coordinate transformation helpers (
transform_xy,_safe_to_crs,_geometry_centroids) and applied them across utilities/routing. - Ensured Dask
Clientlifecycles are closed viatry/finally, and updated dependency pins inpyproject.toml.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/python/unit/utilities/test_utilities_handlers.py | Uses sizes instead of dims for more robust dataset shape comparison. |
| tests/python/unit/test_warn.py | Ensures warnings are asserted with pytest.warns. |
| tests/python/unit/routing/test_routing_base.py | Wraps routing calls with pytest.warns to make warning expectations explicit. |
| tests/python/unit/routing/cli/test_routing_cli_point_to_point.py | Adds explicit CRS to GeoDataFrame fixture. |
| tests/python/unit/routing/cli/test_routing_cli_build_route_table.py | Captures expected out-of-domain warnings. |
| tests/python/unit/costs/test_costs_layer_creator.py | Captures expected binning “gap detected” warnings; adjusts test raster origin. |
| tests/python/unit/costs/test_costs_cli.py | Captures expected dry-mask warning during CLI layer building. |
| revrt/utilities/handlers.py | Replaces direct pyproj.Transformer usage with shared transform_xy. |
| revrt/utilities/cli.py | Adds CRS-safe helpers and uses shared transforms to reduce GeoPandas warnings. |
| revrt/utilities/base.py | Adds transform_xy and improves region_mapper distance handling in geographic CRS. |
| revrt/spatial_characterization/stats.py | Avoids recomputing the raster mask expression by reusing a valid_mask. |
| revrt/spatial_characterization/cli.py | Closes Dask client reliably via try/finally; disables dashboard. |
| revrt/routing/utilities.py | Uses shared CRS transforms and avoids centroid-related warnings/overhead. |
| revrt/routing/cli/finalize.py | Refactors CSV chunk reading loop (introduces a potential issue). |
| revrt/costs/cli.py | Refactors layered-file creation and ensures Dask client cleanup. |
| pyproject.toml | Updates dependency minimum versions and pixi feature pins. |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (89.36%) is below the target coverage (93.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #262 +/- ##
==========================================
- Coverage 98.64% 97.26% -1.38%
==========================================
Files 26 26
Lines 2878 2927 +49
Branches 333 340 +7
==========================================
+ Hits 2839 2847 +8
- Misses 25 59 +34
- Partials 14 21 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add some cleanup, mainly around tests and warnings. Due to dep upgrades, support for python 3.11 has been dropped.