-
Notifications
You must be signed in to change notification settings - Fork 0
Installable package foundation, Python client, and User-facing docs #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
5e95250
docs: update README for current API state
turban 3160cf6
fix: use python -m uvicorn to avoid conda PATH shadowing
turban 3c2f40d
docs: add user guide and usage examples
turban a8411cb
fix: correct coordinate names and consolidated flag in examples
turban 0b0bb22
docs: add setup guide with Rwanda example
turban f32eb82
fix: add missing docstrings and fix formatting in examples
turban fb208ea
docs: fix Python version requirement in setup guide
turban f97ec86
docs: use python -m uvicorn in pip and conda setup instructions
turban c0eb232
docs: open first catalog child instead of hardcoded SLE collection in…
turban 57b6196
fix: detect valid_time vs time dimension in examples
turban 0805636
fix: handle lon/lat coordinate names alongside longitude/latitude and…
turban 8e1eb1f
docs: document coordinate name variants and use dynamic selection in …
turban 755214d
docs: fix WorldPop variable name from pop to pop_total
turban 19f5812
docs: correct ERA5-Land lag to 120 hours per lag_hours config
turban 48952f5
docs: add make as a prerequisite in setup guide
turban 6427e90
fix: correct Freetown coordinate label from E to W
turban c8952e6
docs: replace hardcoded SLE collection URLs with catalog-discovered h…
turban 0cb9c42
fix: discover dataset from catalog instead of hardcoding SLE id in za…
turban 5da532a
chore: update .env.example to remove DHIS2 and CDS API vars, add Dest…
turban a7543c8
chore: document all env vars in .env.example, grouped by purpose
turban f72f86e
docs: use hourly period strings for ERA5-Land ingestion example
turban 4bb2318
docs: use dynamic variable name instead of hardcoded precip in user g…
turban 733fe97
docs: fix zarr_direct_access.py module docstring to match current beh…
turban 0d34932
fix: replace nonexistent DOWNLOAD_DIR with CACHE_OVERRIDE in .env.exa…
turban 607f1ca
fix: correct OGCAPI_BASE_URL comment in .env.example
turban 3eb2657
docs: clarify extent_id placeholder in setup guide ingestion example
turban ec61517
docs: use STAC catalog discovery in setup guide Step 7 xarray example
turban aa9420c
docs: replace prescriptive coord table with runtime detection guidance
turban 4331d22
docs: remove misleading coord name comment in zarr_direct_access example
turban cbde36f
docs: separate / and /health in README endpoint table
turban 16037a8
fix: comment out PYGEOAPI_CONFIG/OPENAPI in .env.example to preserve …
turban ed72ad5
docs: guard empty catalog in README STAC example and add precondition…
turban 180c0ba
docs: add jq as optional prerequisite in setup guide
turban ce5eb4b
docs: clarify extent_id substitution in sync section of setup guide
turban d28b151
fix: raise_for_status on HTTP responses in stac_discover_and_open exa…
turban 19b6d5c
fix: raise_for_status on HTTP responses in zarr_direct_access example
turban 0a7435a
fix: replace requests with httpx in examples and docs snippets
turban df73bcb
fix: clarify CLIMATE_API_BASE_URL scope — does not affect pygeoapi OG…
turban a2cb758
docs: use isel(0) instead of hardcoded date in user guide time select…
turban f2a07ff
docs: replace hardcoded Sierra Leone coordinates with domain-centre p…
turban 80de78e
feat: normalise Zarr coordinate names to longitude/latitude/time at w…
turban 19f766e
docs: update ERA5-Land auth reference in ogcapi.md from CDS API to De…
turban 3a09a54
docs: remove link to stale project_description.md from README intro
turban 2d60f6d
test: add regression test for coordinate normalisation on pyramid path
turban ae32f2f
docs: clarify CLIMATE_API_ZARR_BROWSER_ORIGINS is not a CORS access-c…
turban f9de317
test: add regression test for coordinate normalisation on x/y source …
turban f5edb0e
fix: wrap long test function signature to satisfy ruff E501
turban 05f8d1f
fix: update ERA5-Land source_url to DestinE Earth Data Hub
turban 5489a6a
Code cleaning
turban 1c41525
docs: correct /zarr description — serves any managed dataset, not onl…
turban 9d93a4b
fix: use catalog href directly in open_dataset to avoid rebasing URL …
turban 772384f
test: add STAC integration test for normalised zarr coordinate names
turban 1a07f3f
fix: limit spatial mean time series to first 10 steps in zarr_direct_…
turban de3e28a
docs: slice to 10 time steps before spatial mean to avoid full-datase…
turban 8bc8315
Revert change
turban f3b5eed
fix: restore DHIS2 connection vars to .env.example so it remains the …
turban d4521ac
feat: add climate_api.client with open_dataset and list_datasets (clo…
turban b9c71f0
feat: add Client class and env var fallback to climate_api.client
turban 3ae9903
refactor: rename Client.open_dataset to Client.open
turban ed229a5
refactor: rename Client.list_datasets to Client.catalog
turban 1982d5f
refactor: remove unused xr import and type annotation from stac example
turban 3ad39eb
feat: expose dataset id in STAC catalog child links
turban 502bb4b
refactor: simplify dataset listing in stac example
turban 5211b79
refactor: pretty-print catalog output with json.dumps
turban f4d0364
refactor: replace float() casts with .item() in examples
turban c19b4a1
refactor: use .mean() for domain centre coordinate
turban 4c5787f
fix: use human-readable DestinE landing page as ERA5-Land source_url
turban dccbab3
feat: installable package with CLIMATE_API_CONFIG and create_app()
turban 8754f13
docs: update setup guide for CLIMATE_API_CONFIG and pip install
turban cfe9825
docs: add custom dataset guide covering YAML templates and datasets_dir
turban bcb8d1f
docs: rename custom_datasets_guide to adding_custom_datasets
turban 1992e7a
feat: merge custom datasets_dir with bundled templates instead of rep…
turban 0ab648a
refactor: revert dataset YAMLs to data/datasets/, drop importlib.reso…
turban a5d45c1
docs: remove premature pip install step from setup guide
turban f7696d4
feat: require CLIMATE_API_CONFIG for extent — remove data/extents.yam…
turban 27c6df6
feat: add default climate-api.yaml with Sierra Leone extent
turban 12e51fa
fix: address post-review issues before merging
turban 6618cac
uv.lock
turban 948bb48
fix: move non-standard id field from STAC response to client only
turban e596174
docs: correct download function interface in custom datasets guide
turban b277cfa
refactor: rename cache_info to ingestion in dataset templates
turban 592daf2
refactor: rename extents to extent throughout — single extent per ins…
turban 741e8b3
refactor: remove GET /extent/{extent_id} endpoint
turban a88568a
docs: fix unresolved Copilot review comments
turban 3eaae09
fix: address second round of Copilot review comments
turban c6a386e
fix: address third round of Copilot review comments
turban ebd7d8b
fix: address fourth round of Copilot review comments
turban 34f5f9d
fix: validate zarr asset href and open_kwargs before calling xr.open_…
turban 17f20c7
fix: add httpx timeouts, fix CORS credentials flag, use tuple in isin…
turban 1f08f26
fix: validate href in child links and assets dict in open_dataset; fi…
turban 1e4c735
fix: load built-in dataset templates via importlib.resources
turban ab22df5
fix: consistent ValueError in open_dataset, don't mutate response dic…
turban 8a5000e
fix: default DOWNLOAD_DIR to XDG user data dir instead of package-rel…
turban c3dd230
fix: make all runtime paths XDG-compliant and package data importlib-…
turban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,54 @@ | ||
| PYGEOAPI_CONFIG=data/pygeoapi/pygeoapi-config.yml | ||
| PYGEOAPI_OPENAPI=data/pygeoapi/pygeoapi-openapi.yml | ||
|
|
||
| # DHIS2 Connection | ||
| DHIS2_BASE_URL=https://play.im.dhis2.org/stable-2-42-4/api | ||
| DHIS2_USERNAME=admin | ||
| DHIS2_PASSWORD=district | ||
|
|
||
| # CDS API (required for ERA5-Land downloads) | ||
| # Get your API key from: https://cds.climate.copernicus.eu/how-to-api | ||
| CDSAPI_URL=https://cds.climate.copernicus.eu/api | ||
| CDSAPI_KEY=your-cds-api-key | ||
|
|
||
| # Download cache directory for climate data | ||
| # DOWNLOAD_DIR=./target/data | ||
|
|
||
| # Default EO download extent when a dataset requires bbox and the request does not provide one | ||
| # ── Instance configuration ──────────────────────────────────────────────────── | ||
| # Path to the instance config file (extent, optional datasets_dir). | ||
| # Copy the example before editing: cp climate-api.yaml.example climate-api.yaml | ||
| # climate-api.yaml is gitignored so your local extent stays out of version control. | ||
| # When running via `make run` from the repo root, the relative path below works. | ||
| # When running the installed `climate-api` CLI from another directory, use an | ||
| # absolute path instead: CLIMATE_API_CONFIG=/path/to/your/climate-api.yaml | ||
| CLIMATE_API_CONFIG=./climate-api.yaml | ||
|
|
||
| # ── pygeoapi ────────────────────────────────────────────────────────────────── | ||
| # Absolute paths are set automatically at startup; override only if you move the files. | ||
| # PYGEOAPI_CONFIG=/absolute/path/to/pygeoapi-config.yml | ||
| # PYGEOAPI_OPENAPI=/absolute/path/to/pygeoapi-openapi.yml | ||
|
|
||
| # ── ERA5-Land (DestinE Earth Data Hub) ──────────────────────────────────────── | ||
| # Authentication uses ~/.netrc — no API key is required here. | ||
| # See docs/setup_guide.md for registration and .netrc setup instructions. | ||
|
|
||
| # ── Download and ingestion ──────────────────────────────────────────────────── | ||
| # Override the download cache directory (default: data/downloads). | ||
| # CACHE_OVERRIDE=/path/to/cache | ||
|
|
||
| # Fallback bounding box used when a request does not include an explicit bbox. | ||
| # Format: xmin,ymin,xmax,ymax | ||
| # DOWNLOAD_BBOX=-13.5,6.9,-10.1,10.0 | ||
|
|
||
| # Default country code for datasets that require one (for example WorldPop) | ||
| # Country code for datasets that require one (e.g. WorldPop). | ||
| # COUNTRY_CODE=SLE | ||
|
|
||
| # OGC API base URL (used by Prefect tasks to call back into the API) | ||
| # OGCAPI_BASE_URL=http://localhost:8000/ogcapi | ||
|
|
||
| # Public Climate API base URL used for absolute STAC links behind a reverse proxy | ||
| # ── API deployment ──────────────────────────────────────────────────────────── | ||
| # Set when running behind a reverse proxy so that STAC hrefs and native dataset | ||
| # links use the public address instead of the internal request URL. | ||
| # Note: pygeoapi's OGC self/root links are controlled separately via server.url | ||
| # in config/pygeoapi/base.yml and are not affected by this variable. | ||
| # CLIMATE_API_BASE_URL=http://localhost:8000 | ||
|
|
||
| # TiTiler tile server base URL | ||
| # TITILER_BASE_URL=http://127.0.0.1:8000 | ||
| # Fallback used to derive the native API base URL when CLIMATE_API_BASE_URL is not set. | ||
| # Only needed if CLIMATE_API_BASE_URL is unset and the OGC API path is known. | ||
| # Note: pygeoapi's server.url is controlled separately in config/pygeoapi/base.yml. | ||
| # OGCAPI_BASE_URL=http://localhost:8000/ogcapi | ||
|
|
||
| # Prefect (embedded server) | ||
| PREFECT_API_URL=http://localhost:8000/prefect/api | ||
| PREFECT_SERVER_ANALYTICS_ENABLED=false | ||
| PREFECT_SERVER_UI_SHOW_PROMOTIONAL_CONTENT=false | ||
| # Comma-separated list of origins used for extra browser/private-network headers | ||
| # on Zarr responses (default: https://inspect.geozarr.org). | ||
| # This does not restrict general CORS access; the API allows all origins globally. | ||
| # CLIMATE_API_ZARR_BROWSER_ORIGINS=http://localhost:3000 | ||
|
|
||
| # ── DHIS2 connection ────────────────────────────────────────────────────────── | ||
| # Required for DHIS2 org unit lookups (Step 2 — spatial aggregation). | ||
| # Not needed for Step 1 (data ingestion, sync, and serving). | ||
|
turban marked this conversation as resolved.
|
||
| # DHIS2_BASE_URL=https://play.im.dhis2.org/stable-2-42-4/api | ||
| # DHIS2_USERNAME=admin | ||
| # DHIS2_PASSWORD=district | ||
| # DHIS2_HTTP_TIMEOUT_SECONDS=30 | ||
| # DHIS2_HTTP_RETRIES=3 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| __pycache__/ | ||
| .venv/ | ||
| .env | ||
| climate-api.yaml | ||
| eo_api.egg-info/ | ||
| data/downloads | ||
| data/artifacts | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Climate API instance configuration. | ||
| # Replace the extent below with your country before deploying. | ||
| # See docs/setup_guide.md for field descriptions. | ||
|
|
||
| extent: | ||
| id: sle | ||
| name: Sierra Leone | ||
| bbox: [-13.5, 6.9, -10.1, 10.0] | ||
| country_code: SLE | ||
|
|
||
| # datasets_dir: ./datasets/ # optional — custom templates merged with built-ins |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.