Repository navigation
Conversation
init(directory=None, *, country, years, bbox=None, products=, client=None, retry=None) -> InitReport, and firms init: the yearly archives and the whole WorldCover tiles over a box, once, for offline use. Idempotent and resumable (.part then rename, files there skipped, failures recorded and the rest goes on); the caller's httpx client; no retry unless asked; no rasterio. worldcover_tiles(), download_worldcover_tile(). The data directory is $DATA_ROOT/firms-client (environment or .env); FIRMS_DATA_DIR still overrides it, for compatibility, and leaves .env.example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VFEUmXwmaxtB7PF8sSP1d4
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 162fff3d8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for product in products: | ||
| for year in years: |
There was a problem hiding this comment.
Materialize years before iterating over multiple products
When years is a generator or another single-pass iterable and multiple products are requested, the first product exhausts it, so subsequent products receive no archive downloads. For example, years=iter([2024, 2025]) with products=(MODIS, VIIRS_SNPP) downloads only MODIS while returning a successful report. Since the API accepts Iterable[int], materialize the years once before the product loop so every requested product processes them.
Useful? React with 👍 / 👎.
| if worldcover_path(url, folder).exists(): | ||
| report.skipped.append(name) | ||
| continue |
There was a problem hiding this comment.
Distinguish cropped WorldCover files from complete tiles
If the data directory was previously populated by firms sync --worldcover or save_worldcover, existing files at these paths contain only the requested crop, not whole tiles. This existence check skips them even when init requests a larger bounding box, reports success, and leaves offline coverage incomplete. WorldCover.synced() then reads those cropped files, and its shares() returns no data outside their bounds. Distinguish complete downloads from cropped copies and replace or expand cropped files when necessary; the same existence-only check in download_worldcover_tile() also needs to account for this.
Useful? React with 👍 / 👎.
The shared data-root rule of the agent-engineering-studio libraries, and a one-step offline init that Limen can call instead of its own code (
limen ingest-fire-historydownload,limen worldcover-sync).initdownload_archive) and the whole ESA WorldCover tiles touchingbbox(Italy: 23 tiles, 1.3 GB), saved underworldcover/with the bucket's path, soWorldCover.synced()reads them. Same behaviour as Limen'sworldcover.py: stream to.part, rename, 404 = sea tile skipped (inmissing), files already there skipped. No rasterio needed.download_archive,download_worldcover_tile; tile list:worldcover_tiles(bbox).firms init Italy [--years 2012-2025] [--bbox W,S,E,N] [--product all] [--format json], exit 1 when a file failed.Data directory (
default_directory()): explicitdirectory=→FIRMS_DATA_DIR(compatibility, out of.env.example) →$DATA_ROOT/firms-client→$XDG_CACHE_HOMEor~/.cache/firms-client. Each from the environment, else the current directory's.env.Unreleased in the CHANGELOG (minor); no tag, no publish.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VFEUmXwmaxtB7PF8sSP1d4