Skip to content

feat: GEE image fetch reporting for export_batch#84

Merged
Dinghye merged 2 commits into
cybergis:mainfrom
amrit110:gee-fetch-reporting
May 23, 2026
Merged

feat: GEE image fetch reporting for export_batch#84
Dinghye merged 2 commits into
cybergis:mainfrom
amrit110:gee-fetch-reporting

Conversation

@amrit110
Copy link
Copy Markdown
Contributor

Summary

Closes #76

  • Adds FetchStats, a thread-safe class in tools/progress.py that accumulates GEE fetch statistics: total planned fetches, completed, failed, and cache hits
  • Wires FetchStats into PrefetchManager.fetch_chunk() — updated on every task success, failure, and cache skip
  • BatchExporter creates a FetchStats instance when show_progress=True and a GEE provider is active; logs a summary line to stderr after each chunk completes (per-item layout) or after all prefetching finishes (combined layout)
  • No output when show_progress=False or when no GEE provider is involved (e.g. precomputed models)

Example output with chunk_size=2 and 6 points:

[gee_fetch] total=2 | done=2 (100%) | failed=0 | cached=0
[gee_fetch] total=4 | done=4 (100%) | failed=0 | cached=0
[gee_fetch] total=6 | done=6 (100%) | failed=0 | cached=0

Test plan

  • tests/test_fetch_stats.py — 28 new tests covering:
    • FetchStats unit tests (counters, format, thread safety with 200-thread race)
    • PrefetchManager integration (planned counts, cache hits, partial cache hits, failure recording)
    • export_batch end-to-end (log emitted when enabled, suppressed when disabled, correct counts, multi-chunk cumulative accumulation, no log for precomputed models)
  • All 654 tests pass

amrit110 added 2 commits May 19, 2026 12:42
Adds a FetchStats class that tracks planned, completed, failed, and
cached GEE fetch operations across export chunks. Stats are logged to
stderr after each chunk completes when show_progress=True, giving
users visibility into quota usage, cache reuse, and whether runtime
is dominated by GEE fetching.

Closes cybergis#76
- FetchStats now tracks the most recently completed point index and
  sensor collection, shown as last=point:N,sensor:X in the log line
- CHANGELOG.md updated (required by CI)
@Dinghye Dinghye merged commit 4f19c39 into cybergis:main May 23, 2026
3 checks passed
@Dinghye
Copy link
Copy Markdown
Collaborator

Dinghye commented May 23, 2026

Goood job! Thank you @amrit110 🍻

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.

[Feature]: Report GEE image fetch counts during export_batch

2 participants