Skip to content

Add various cleanup#262

Merged
ppinchuk merged 28 commits intomainfrom
pp/cleanup
Apr 21, 2026
Merged

Add various cleanup#262
ppinchuk merged 28 commits intomainfrom
pp/cleanup

Conversation

@ppinchuk
Copy link
Copy Markdown
Collaborator

@ppinchuk ppinchuk commented Apr 21, 2026

Add some cleanup, mainly around tests and warnings. Due to dep upgrades, support for python 3.11 has been dropped.

@ppinchuk ppinchuk self-assigned this Apr 21, 2026
Copilot AI review requested due to automatic review settings April 21, 2026 17:56
@ppinchuk ppinchuk requested a review from castelao as a code owner April 21, 2026 17:56
@ppinchuk ppinchuk added enhancement Update to logic or general code improvements chore Maintenance work that does not impact the end user p-medium Priority: medium dependencies Issues/pull requests related to a dependency labels Apr 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Client lifecycles are closed via try/finally, and updated dependency pins in pyproject.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.

Comment thread revrt/routing/cli/finalize.py
Comment thread revrt/utilities/base.py
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 89.36170% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.26%. Comparing base (1e2bcf1) to head (ffabfb1).

Files with missing lines Patch % Lines
revrt/spatial_characterization/cli.py 0.00% 6 Missing ⚠️
revrt/routing/cli/finalize.py 83.33% 1 Missing and 1 partial ⚠️
revrt/utilities/cli.py 92.85% 1 Missing and 1 partial ⚠️

❌ 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     
Flag Coverage Δ
unittests 97.26% <89.36%> (-1.38%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ppinchuk ppinchuk merged commit fcee3dc into main Apr 21, 2026
26 checks passed
@ppinchuk ppinchuk deleted the pp/cleanup branch April 21, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance work that does not impact the end user dependencies Issues/pull requests related to a dependency enhancement Update to logic or general code improvements p-medium Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants