Skip to content

nodata bug fix#277

Merged
ppinchuk merged 14 commits into
mainfrom
pp/nodata_bug_fix
May 21, 2026
Merged

nodata bug fix#277
ppinchuk merged 14 commits into
mainfrom
pp/nodata_bug_fix

Conversation

@ppinchuk
Copy link
Copy Markdown
Collaborator

Code was assuming user has pre-processed nodata values out of rasters. Now, we no longer make that assumption but instead read the tiff file with the nodata as NaNs and allow the user to fill the NaNs.

@ppinchuk ppinchuk self-assigned this May 20, 2026
@ppinchuk ppinchuk requested a review from castelao as a code owner May 20, 2026 23:31
@ppinchuk ppinchuk added the bugfix Fixed a known bug label May 20, 2026
Copilot AI review requested due to automatic review settings May 20, 2026 23:31
@ppinchuk ppinchuk added the p-critical Priority: critical label May 20, 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

This PR updates reVRt’s GeoTIFF ingestion/processing pipeline to treat GeoTIFF nodata as missing values (NaNs via masked reads) instead of assuming users pre-clean rasters, and introduces configurable NA filling during layer construction.

Changes:

  • Update load_data_using_layer_file_profile() to open GeoTIFFs with masked=True, optionally reproject to the LayeredFile profile, and optionally fill NA cells.
  • Introduce LayerBuildConfig.na_fill and apply NA filling in raster pass-through processing and vector rasterization background fill.
  • Expand unit/integration coverage for nodata-as-NaN behavior and NA filling; bump package version to 0.7.1.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/python/unit/utilities/test_utilities_handlers.py Adds a unit test verifying nodata becomes NaN and optional fillna behavior.
tests/python/unit/costs/test_costs_layer_creator.py Adds tests for NA fill behavior in raster processing (including large negative nodata) and vector rasterization background fill.
tests/python/integration/test_utilties_handlers.py Updates integration assertions to use masked reads and equal_nan=True comparisons.
revrt/utilities/handlers.py Routes GeoTIFF ingestion through load_data_using_layer_file_profile() to preserve nodata as NaN.
revrt/utilities/base.py Implements masked GeoTIFF loading + optional reprojection and NA fill behavior.
revrt/models/cost_layers.py Adds na_fill to LayerBuildConfig and removes Rasterize.fill.
revrt/costs/layer_creator.py Applies na_fill after raster processing and uses it as the vector rasterization background fill.
revrt/costs/cli.py Returns the created routing layer file path from build_routing_layer_file().
pyproject.toml Bumps version to 0.7.1.
pixi.lock Updates lock metadata for the version bump.

Comment thread revrt/utilities/handlers.py Outdated
Comment thread revrt/utilities/base.py
Comment thread revrt/costs/layer_creator.py
Comment thread revrt/models/cost_layers.py
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.63%. Comparing base (31a743c) to head (c7d4bd2).

Files with missing lines Patch % Lines
revrt/costs/layer_creator.py 75.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (91.66%) 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     #277      +/-   ##
==========================================
- Coverage   96.66%   96.63%   -0.03%     
==========================================
  Files          27       27              
  Lines        3234     3237       +3     
  Branches      391      391              
==========================================
+ Hits         3126     3128       +2     
  Misses         61       61              
- Partials       47       48       +1     
Flag Coverage Δ
unittests 96.63% <91.66%> (-0.03%) ⬇️

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 f9ec058 into main May 21, 2026
26 checks passed
@ppinchuk ppinchuk deleted the pp/nodata_bug_fix branch May 21, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixed a known bug p-critical Priority: critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants