Skip to content

feat(preprocess): add --lola-source flag for arbitrary LOLA sources (… - #6

Merged
Alex0420W merged 2 commits into
mainfrom
feature/v18.3-lola-source-flag
May 2, 2026
Merged

Alex0420W merged 2 commits into
mainfrom
feature/v18.3-lola-source-flag

Conversation

@Alex0420W

Copy link
Copy Markdown
Owner

…v1.8.3)

Adds explicit source-path override to selene preprocess and to pipeline.preprocess_tiled.run_tiled_per_region. Bypasses the PDS-naming priority list in resolve_lola_source, which previously hardcoded ldem_80s_m.lbl and would not pick up non-PDS-named LOLA files like PGDA's ldem_83s_10mpp_adj.tif.

Override path is validated up front (must exist, be a file, and have a recognised .tif/.lbl/.img suffix); when omitted, the existing auto-detect priority list runs unchanged.

Closes one of the v1.6 deferral blockers (the file-resolver gap surfaced when the 10m PGDA mosaic was tried against the existing pipeline). The polygon-coverage blocker — only 3 of 9 USGS polygons fit cleanly inside the 10m mosaic with the 100km horizon-march buffer — remains.

Backward compatible: omitting --lola-source preserves the existing auto-detect behaviour. No methodology, data, or validation changes; v1.8 headline numbers (56/69 = 81.2%, median 1.69 km) are unchanged.

Test count: 391 collected, 382 passed (+10 new, all synthetic).

Summary

What this PR does, in 1–3 sentences.

Motivation

Why this change is worth making (link the issue if there is one).

Checklist

  • ruff check . passes
  • ruff format --check . passes
  • pytest passes locally
  • New behaviour has a test (or an explicit # noqa reason if not)
  • Public-facing changes (CLI flags, criterion math, file layout) are
    reflected in the README or the relevant module docstring
  • No real-data fixtures were committed; new tests run in CI without
    downloaded data (or are guarded with pytest.mark.skipif)

Scope notes

  • Things this PR explicitly does not address (so reviewers know what
    to expect in follow-ups).

Alex0420W added 2 commits May 1, 2026 20:26
…v1.8.3)

Adds explicit source-path override to selene preprocess and to
pipeline.preprocess_tiled.run_tiled_per_region. Bypasses the
PDS-naming priority list in resolve_lola_source, which previously
hardcoded ldem_80s_<resolution>m.lbl and would not pick up
non-PDS-named LOLA files like PGDA's ldem_83s_10mpp_adj.tif.

Override path is validated up front (must exist, be a file, and
have a recognised .tif/.lbl/.img suffix); when omitted, the
existing auto-detect priority list runs unchanged.

Closes one of the v1.6 deferral blockers (the file-resolver gap
surfaced when the 10m PGDA mosaic was tried against the existing
pipeline). The polygon-coverage blocker — only 3 of 9 USGS
polygons fit cleanly inside the 10m mosaic with the 100km
horizon-march buffer — remains.

Backward compatible: omitting --lola-source preserves the
existing auto-detect behaviour. No methodology, data, or
validation changes; v1.8 headline numbers (56/69 = 81.2%, median
1.69 km) are unchanged.

Test count: 391 collected, 382 passed (+10 new, all synthetic).
CI runners preserve ANSI colour codes and Rich panel/line-wrapping
that local terminals strip. The previous substring assertions
('Invalid value for --lola-source', '--lola-source') could fail
when wrapped across multiple lines or split by injected escape
sequences.

Add a small _normalise_cli_output helper that strips ANSI escapes
and collapses whitespace, then match on tokens short enough to
never straddle a wrap point ('Invalid value', 'lola-source',
'tiled-per-region'). Verified locally with FORCE_COLOR=1.

No implementation change; flag itself is unaffected.
@Alex0420W
Alex0420W merged commit 9bef3a4 into main May 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant