community-forcing-service 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- community_forcing_service-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- community_forcing_service-0.1.0/.github/ISSUE_TEMPLATE/connector_request.md +39 -0
- community_forcing_service-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +28 -0
- community_forcing_service-0.1.0/.github/workflows/ci.yml +38 -0
- community_forcing_service-0.1.0/.github/workflows/docs.yml +47 -0
- community_forcing_service-0.1.0/.gitignore +29 -0
- community_forcing_service-0.1.0/CHANGELOG.md +47 -0
- community_forcing_service-0.1.0/CITATION.cff +24 -0
- community_forcing_service-0.1.0/CODE_OF_CONDUCT.md +85 -0
- community_forcing_service-0.1.0/CONTRIBUTING.md +88 -0
- community_forcing_service-0.1.0/LICENSE +21 -0
- community_forcing_service-0.1.0/PKG-INFO +241 -0
- community_forcing_service-0.1.0/README.md +177 -0
- community_forcing_service-0.1.0/docs/canonical-v1.md +170 -0
- community_forcing_service-0.1.0/docs/catalog.md +212 -0
- community_forcing_service-0.1.0/docs/cli.md +94 -0
- community_forcing_service-0.1.0/docs/index.md +96 -0
- community_forcing_service-0.1.0/docs/python-api.md +126 -0
- community_forcing_service-0.1.0/docs/quickstart.md +95 -0
- community_forcing_service-0.1.0/docs/reference.md +49 -0
- community_forcing_service-0.1.0/inventory/providers.yaml +796 -0
- community_forcing_service-0.1.0/mkdocs.yml +66 -0
- community_forcing_service-0.1.0/pyproject.toml +137 -0
- community_forcing_service-0.1.0/src/cfs/__init__.py +13 -0
- community_forcing_service-0.1.0/src/cfs/cli/__init__.py +0 -0
- community_forcing_service-0.1.0/src/cfs/cli/main.py +98 -0
- community_forcing_service-0.1.0/src/cfs/connectors/__init__.py +0 -0
- community_forcing_service-0.1.0/src/cfs/connectors/aorc.py +140 -0
- community_forcing_service-0.1.0/src/cfs/connectors/aorc_nwm.py +186 -0
- community_forcing_service-0.1.0/src/cfs/connectors/barra2.py +267 -0
- community_forcing_service-0.1.0/src/cfs/connectors/base.py +193 -0
- community_forcing_service-0.1.0/src/cfs/connectors/carra.py +57 -0
- community_forcing_service-0.1.0/src/cfs/connectors/cds_reanalysis.py +318 -0
- community_forcing_service-0.1.0/src/cfs/connectors/cerra.py +52 -0
- community_forcing_service-0.1.0/src/cfs/connectors/chirps.py +141 -0
- community_forcing_service-0.1.0/src/cfs/connectors/chirts.py +165 -0
- community_forcing_service-0.1.0/src/cfs/connectors/cmorph.py +207 -0
- community_forcing_service-0.1.0/src/cfs/connectors/conus404.py +158 -0
- community_forcing_service-0.1.0/src/cfs/connectors/daymet.py +214 -0
- community_forcing_service-0.1.0/src/cfs/connectors/em_earth.py +213 -0
- community_forcing_service-0.1.0/src/cfs/connectors/eobs.py +262 -0
- community_forcing_service-0.1.0/src/cfs/connectors/era5_arco.py +153 -0
- community_forcing_service-0.1.0/src/cfs/connectors/era5_cds.py +189 -0
- community_forcing_service-0.1.0/src/cfs/connectors/era5_land.py +215 -0
- community_forcing_service-0.1.0/src/cfs/connectors/fldas.py +199 -0
- community_forcing_service-0.1.0/src/cfs/connectors/gefs.py +358 -0
- community_forcing_service-0.1.0/src/cfs/connectors/gfs.py +282 -0
- community_forcing_service-0.1.0/src/cfs/connectors/gldas.py +200 -0
- community_forcing_service-0.1.0/src/cfs/connectors/gpm.py +224 -0
- community_forcing_service-0.1.0/src/cfs/connectors/gridmet.py +183 -0
- community_forcing_service-0.1.0/src/cfs/connectors/hrrr.py +235 -0
- community_forcing_service-0.1.0/src/cfs/connectors/merra2.py +178 -0
- community_forcing_service-0.1.0/src/cfs/connectors/mswep.py +205 -0
- community_forcing_service-0.1.0/src/cfs/connectors/na_cordex.py +152 -0
- community_forcing_service-0.1.0/src/cfs/connectors/narr.py +157 -0
- community_forcing_service-0.1.0/src/cfs/connectors/nclimgrid_daily.py +148 -0
- community_forcing_service-0.1.0/src/cfs/connectors/nex_gddp.py +223 -0
- community_forcing_service-0.1.0/src/cfs/connectors/nldas.py +155 -0
- community_forcing_service-0.1.0/src/cfs/connectors/nwm_operational.py +230 -0
- community_forcing_service-0.1.0/src/cfs/connectors/persiann_cdr.py +195 -0
- community_forcing_service-0.1.0/src/cfs/connectors/protocols/__init__.py +0 -0
- community_forcing_service-0.1.0/src/cfs/connectors/protocols/cds_api.py +154 -0
- community_forcing_service-0.1.0/src/cfs/connectors/protocols/earthdata.py +135 -0
- community_forcing_service-0.1.0/src/cfs/connectors/protocols/http_files.py +84 -0
- community_forcing_service-0.1.0/src/cfs/connectors/protocols/rclone.py +91 -0
- community_forcing_service-0.1.0/src/cfs/connectors/protocols/zarr_store.py +110 -0
- community_forcing_service-0.1.0/src/cfs/connectors/rdrs.py +139 -0
- community_forcing_service-0.1.0/src/cfs/connectors/wfde5.py +229 -0
- community_forcing_service-0.1.0/src/cfs/core/__init__.py +0 -0
- community_forcing_service-0.1.0/src/cfs/core/config.py +81 -0
- community_forcing_service-0.1.0/src/cfs/core/exceptions.py +57 -0
- community_forcing_service-0.1.0/src/cfs/core/models.py +177 -0
- community_forcing_service-0.1.0/src/cfs/core/registry.py +49 -0
- community_forcing_service-0.1.0/src/cfs/core/vocabulary.py +115 -0
- community_forcing_service-0.1.0/src/cfs/derive/__init__.py +10 -0
- community_forcing_service-0.1.0/src/cfs/derive/humidity.py +60 -0
- community_forcing_service-0.1.0/src/cfs/py.typed +0 -0
- community_forcing_service-0.1.0/src/cfs/qc.py +66 -0
- community_forcing_service-0.1.0/src/cfs/subset/__init__.py +0 -0
- community_forcing_service-0.1.0/src/cfs/subset/bbox.py +141 -0
- community_forcing_service-0.1.0/src/cfs/subset/canonical.py +108 -0
- community_forcing_service-0.1.0/src/cfs/subset/deaccumulate.py +42 -0
- community_forcing_service-0.1.0/src/cfs/subset/grid2d.py +110 -0
- community_forcing_service-0.1.0/tests/test_aorc_network.py +38 -0
- community_forcing_service-0.1.0/tests/test_auth_network.py +115 -0
- community_forcing_service-0.1.0/tests/test_barra2_offline.py +81 -0
- community_forcing_service-0.1.0/tests/test_batch_providers_offline.py +126 -0
- community_forcing_service-0.1.0/tests/test_bbox.py +76 -0
- community_forcing_service-0.1.0/tests/test_canonical.py +84 -0
- community_forcing_service-0.1.0/tests/test_carra_cerra_offline.py +140 -0
- community_forcing_service-0.1.0/tests/test_chirps_network.py +42 -0
- community_forcing_service-0.1.0/tests/test_chirts_offline.py +75 -0
- community_forcing_service-0.1.0/tests/test_connectors_offline.py +66 -0
- community_forcing_service-0.1.0/tests/test_daymet_offline.py +78 -0
- community_forcing_service-0.1.0/tests/test_deaccumulate.py +51 -0
- community_forcing_service-0.1.0/tests/test_earthdata.py +74 -0
- community_forcing_service-0.1.0/tests/test_em_earth_offline.py +92 -0
- community_forcing_service-0.1.0/tests/test_eobs_offline.py +92 -0
- community_forcing_service-0.1.0/tests/test_era5_arco_network.py +39 -0
- community_forcing_service-0.1.0/tests/test_era5_land_offline.py +83 -0
- community_forcing_service-0.1.0/tests/test_fldas_offline.py +81 -0
- community_forcing_service-0.1.0/tests/test_gather_pieces.py +96 -0
- community_forcing_service-0.1.0/tests/test_gefs_offline.py +148 -0
- community_forcing_service-0.1.0/tests/test_gemini_batch_offline.py +66 -0
- community_forcing_service-0.1.0/tests/test_gfs_offline.py +76 -0
- community_forcing_service-0.1.0/tests/test_gldas_offline.py +81 -0
- community_forcing_service-0.1.0/tests/test_gpm_offline.py +91 -0
- community_forcing_service-0.1.0/tests/test_grid2d.py +88 -0
- community_forcing_service-0.1.0/tests/test_grid2d_network.py +68 -0
- community_forcing_service-0.1.0/tests/test_hrrr_network.py +42 -0
- community_forcing_service-0.1.0/tests/test_hrrr_offline.py +60 -0
- community_forcing_service-0.1.0/tests/test_humidity.py +39 -0
- community_forcing_service-0.1.0/tests/test_merra2_nldas_offline.py +76 -0
- community_forcing_service-0.1.0/tests/test_mswep_offline.py +92 -0
- community_forcing_service-0.1.0/tests/test_na_cordex_offline.py +61 -0
- community_forcing_service-0.1.0/tests/test_nex_gddp_network.py +44 -0
- community_forcing_service-0.1.0/tests/test_nex_gddp_offline.py +76 -0
- community_forcing_service-0.1.0/tests/test_nwm_operational_offline.py +59 -0
- community_forcing_service-0.1.0/tests/test_persiann_cdr_offline.py +58 -0
- community_forcing_service-0.1.0/tests/test_qc.py +54 -0
- community_forcing_service-0.1.0/tests/test_rdrs_conus404_offline.py +84 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: A fetch failed, returned wrong values, or something else broke
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What happened
|
|
8
|
+
|
|
9
|
+
A clear description of the problem.
|
|
10
|
+
|
|
11
|
+
## How to reproduce
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
# Minimal example — product ID, bbox, time range, variables
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- **Product ID** (e.g. `era5_arco:single_levels`):
|
|
18
|
+
- **Bounding box** (`min_lon,min_lat,max_lon,max_lat`):
|
|
19
|
+
- **Time range**:
|
|
20
|
+
- **Credentials involved?** (CDS / Earthdata / AWS — never paste them):
|
|
21
|
+
|
|
22
|
+
## What you expected
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
|
|
26
|
+
Full traceback, or the `FetchResult` (especially `warnings`) if the fetch
|
|
27
|
+
succeeded but the values look wrong.
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
paste here
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Environment
|
|
34
|
+
|
|
35
|
+
- CFS version (`cfs --version`):
|
|
36
|
+
- Python version / OS:
|
|
37
|
+
- Install extras used (`climate`, `cds`, `earthdata`, `forecast`):
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Connector request
|
|
3
|
+
about: Propose a new forcing product for CFS
|
|
4
|
+
labels: connector
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Product
|
|
8
|
+
|
|
9
|
+
- **Name** (e.g. "NOAA CFSR"):
|
|
10
|
+
- **Provider / archive** (who hosts it):
|
|
11
|
+
- **Access** (cloud Zarr, OPeNDAP, S3 NetCDF/GRIB2, HTTP, CDS API, ...):
|
|
12
|
+
- **URL of the store or landing page**:
|
|
13
|
+
|
|
14
|
+
## Coverage
|
|
15
|
+
|
|
16
|
+
- **Spatial domain + resolution**:
|
|
17
|
+
- **Temporal extent + resolution**:
|
|
18
|
+
- **Grid** (regular lat/lon, or projected/rotated — which projection?):
|
|
19
|
+
|
|
20
|
+
## Variables
|
|
21
|
+
|
|
22
|
+
Which canonical variables can it supply (air_temperature,
|
|
23
|
+
precipitation_flux, winds, humidity, pressure, SW/LW radiation)?
|
|
24
|
+
Note anything tricky: accumulated precip/radiation, RH instead of
|
|
25
|
+
specific humidity, scalar wind speed only, unusual units.
|
|
26
|
+
|
|
27
|
+
## Auth and license
|
|
28
|
+
|
|
29
|
+
- **Authentication** (anonymous, Earthdata, CDS, API key, ...):
|
|
30
|
+
- **Data license**:
|
|
31
|
+
|
|
32
|
+
## Why
|
|
33
|
+
|
|
34
|
+
One or two sentences on the modeling use case this unlocks
|
|
35
|
+
(region, period, resolution that existing connectors don't cover).
|
|
36
|
+
|
|
37
|
+
Willing to implement it yourself? See
|
|
38
|
+
[CONTRIBUTING.md](https://github.com/DarriEy/CFS/blob/main/CONTRIBUTING.md)
|
|
39
|
+
for the connector pattern — PRs welcome.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## What
|
|
2
|
+
|
|
3
|
+
One or two sentences: what does this PR change and why?
|
|
4
|
+
|
|
5
|
+
## Type
|
|
6
|
+
|
|
7
|
+
- [ ] New connector
|
|
8
|
+
- [ ] Bug fix
|
|
9
|
+
- [ ] Docs / infrastructure
|
|
10
|
+
- [ ] Other
|
|
11
|
+
|
|
12
|
+
## Verification
|
|
13
|
+
|
|
14
|
+
- [ ] `ruff check src/ tests/` passes
|
|
15
|
+
- [ ] `mypy src/cfs` passes
|
|
16
|
+
- [ ] `pytest -m "not network"` passes
|
|
17
|
+
- [ ] New code has offline tests (synthetic data; no network)
|
|
18
|
+
|
|
19
|
+
For connectors: describe what you verified against the live store —
|
|
20
|
+
bbox/period fetched, and whether the returned values look physical
|
|
21
|
+
(temperatures in K, precip flux ~1e-4 not ~10, radiation W m-2).
|
|
22
|
+
|
|
23
|
+
## Checklist (connectors only)
|
|
24
|
+
|
|
25
|
+
- [ ] Stops at the canonical dataset (no HRU remapping, no model schemas)
|
|
26
|
+
- [ ] Precip/radiation returned as rates, never accumulations
|
|
27
|
+
- [ ] `VariableMapping` table with unit conversions; ends with `self._finalize(...)`
|
|
28
|
+
- [ ] Added to `inventory/providers.yaml` and `docs/catalog.md`
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
# The 'climate' extra (xarray/zarr/s3fs/h5py/...) plus 'cds'/'earthdata'
|
|
27
|
+
# (cdsapi/pydap/pyproj) ensures the offline tests run for real rather than
|
|
28
|
+
# being skipped via pytest.importorskip.
|
|
29
|
+
run: pip install -e ".[climate,cds,earthdata,dev]"
|
|
30
|
+
|
|
31
|
+
- name: Lint
|
|
32
|
+
run: ruff check src/ tests/
|
|
33
|
+
|
|
34
|
+
- name: Type check
|
|
35
|
+
run: mypy src/cfs
|
|
36
|
+
|
|
37
|
+
- name: Test (offline only — network tests need credentials/access)
|
|
38
|
+
run: pytest tests/ -v --tb=short -m "not network" --cov=cfs --cov-report=term
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- "docs/**"
|
|
8
|
+
- "mkdocs.yml"
|
|
9
|
+
- "src/cfs/**"
|
|
10
|
+
- ".github/workflows/docs.yml"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pages: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
# Allow one concurrent deployment; don't cancel an in-progress run.
|
|
19
|
+
concurrency:
|
|
20
|
+
group: pages
|
|
21
|
+
cancel-in-progress: false
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
build:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.12"
|
|
31
|
+
- name: Install docs dependencies
|
|
32
|
+
run: pip install -e ".[docs]"
|
|
33
|
+
- name: Build site
|
|
34
|
+
run: mkdocs build --strict
|
|
35
|
+
- uses: actions/upload-pages-artifact@v3
|
|
36
|
+
with:
|
|
37
|
+
path: site
|
|
38
|
+
|
|
39
|
+
deploy:
|
|
40
|
+
needs: build
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
environment:
|
|
43
|
+
name: github-pages
|
|
44
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
45
|
+
steps:
|
|
46
|
+
- id: deployment
|
|
47
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.eggs/
|
|
8
|
+
*.egg
|
|
9
|
+
.mypy_cache/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.ruff_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
htmlcov/
|
|
14
|
+
*.tif
|
|
15
|
+
*.tiff
|
|
16
|
+
*.nc
|
|
17
|
+
.env
|
|
18
|
+
.venv/
|
|
19
|
+
venv/
|
|
20
|
+
|
|
21
|
+
# Claude Code harness (session-local)
|
|
22
|
+
.claude/
|
|
23
|
+
|
|
24
|
+
# mkdocs build output
|
|
25
|
+
site/
|
|
26
|
+
|
|
27
|
+
# probe / scratch
|
|
28
|
+
probe_*.py
|
|
29
|
+
.probe_results.txt
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] — 2026-06-11
|
|
9
|
+
|
|
10
|
+
Initial release.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **33 forcing connectors** (31 live-verified against their upstream stores;
|
|
15
|
+
`mswep` and `em_earth` offline-verified pending access/credentials), spanning
|
|
16
|
+
global and regional reanalyses (ERA5/ERA5-Land, MERRA-2, CARRA, CERRA, RDRS,
|
|
17
|
+
BARRA2, CONUS404, NARR, WFDE5), analysis products (AORC, NLDAS, HRRR, NWM
|
|
18
|
+
operational, Daymet, gridMET, nClimGrid-Daily, GLDAS, FLDAS), satellite and
|
|
19
|
+
station precipitation/temperature (CHIRPS, CHIRTS, GPM IMERG, PERSIANN-CDR,
|
|
20
|
+
CMORPH, MSWEP, EM-Earth, E-OBS), forecasts (GFS deterministic, GEFS ensemble
|
|
21
|
+
with a `member` dimension), and climate projections (NEX-GDDP-CMIP6,
|
|
22
|
+
NA-CORDEX).
|
|
23
|
+
- **Canonical harmonization (`canonical-v1`)**: every connector renames native
|
|
24
|
+
variables to CF-aligned canonical names and converts to canonical SI units
|
|
25
|
+
(`cfs.core.vocabulary`); precipitation and radiation are always returned as
|
|
26
|
+
rates (fluxes), never accumulations.
|
|
27
|
+
- **Subsetting**: bounding-box + time-range subsetting for regular lat/lon
|
|
28
|
+
grids (`cfs.subset.bbox`, antimeridian-safe) and 2-D/projected grids
|
|
29
|
+
(`cfs.subset.grid2d` — rotated-pole, Lambert conformal).
|
|
30
|
+
- **Reset-aware de-accumulation** (`cfs.subset.deaccumulate`) for running-total
|
|
31
|
+
fields (e.g. ERA5-Land `tp`/`ssrd`/`strd`), plus bucket-aware de-accumulation
|
|
32
|
+
for GEFS 6-hour precipitation/radiation buckets.
|
|
33
|
+
- **Derived variables** (`cfs.derive`): specific humidity from 2 m relative
|
|
34
|
+
humidity, temperature, and pressure (Bolton 1980) — used by CARRA, CERRA,
|
|
35
|
+
and GEFS.
|
|
36
|
+
- **Range QC** (`cfs.qc`): advisory physical-range checks on every fetch,
|
|
37
|
+
reported in `FetchResult.warnings`, catching unit-conversion errors before
|
|
38
|
+
they reach a model.
|
|
39
|
+
- **Fetch guardrails**: bbox-area (`CFS_MAX_AREA_DEG2`) and cell-count
|
|
40
|
+
(`CFS_MAX_CELLS_PER_FETCH`) limits enforced uniformly on the connector base
|
|
41
|
+
class.
|
|
42
|
+
- **CLI** (`cfs providers`, `cfs products`, `cfs fetch`) and an in-process
|
|
43
|
+
Python API (`discover()` / `get_connector()` / `fetch()`).
|
|
44
|
+
- Protocol mixins for cloud Zarr, OPeNDAP (Earthdata URS), CDS API, HTTP
|
|
45
|
+
byte-range NetCDF/GRIB2, and rclone.
|
|
46
|
+
|
|
47
|
+
[0.1.0]: https://github.com/DarriEy/CFS/releases/tag/v0.1.0
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it using the metadata below."
|
|
3
|
+
type: software
|
|
4
|
+
title: "CFS: Community Forcing Service"
|
|
5
|
+
abstract: >-
|
|
6
|
+
CFS provides a single asynchronous interface to 33 meteorological forcing
|
|
7
|
+
products for hydrological and land-surface modelling, acquiring, subsetting,
|
|
8
|
+
and harmonizing each to a canonical CF-aligned xarray dataset.
|
|
9
|
+
authors:
|
|
10
|
+
- family-names: Eythorsson
|
|
11
|
+
given-names: Darri
|
|
12
|
+
email: dae5@hi.is
|
|
13
|
+
orcid: "https://orcid.org/0000-0003-3653-3936"
|
|
14
|
+
affiliation: "University of Calgary"
|
|
15
|
+
repository-code: "https://github.com/DarriEy/CFS"
|
|
16
|
+
license: MIT
|
|
17
|
+
version: 0.1.0
|
|
18
|
+
date-released: "2026-06-11"
|
|
19
|
+
keywords:
|
|
20
|
+
- hydrology
|
|
21
|
+
- meteorological forcing
|
|
22
|
+
- reanalysis
|
|
23
|
+
- xarray
|
|
24
|
+
- climate data
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
# Contributor Covenant Code of Conduct
|
|
3
|
+
|
|
4
|
+
## Our Pledge
|
|
5
|
+
|
|
6
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
7
|
+
|
|
8
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
9
|
+
|
|
10
|
+
## Our Standards
|
|
11
|
+
|
|
12
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
13
|
+
|
|
14
|
+
* Demonstrating empathy and kindness toward other people
|
|
15
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
16
|
+
* Giving and gracefully accepting constructive feedback
|
|
17
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
18
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
19
|
+
|
|
20
|
+
Examples of unacceptable behavior include:
|
|
21
|
+
|
|
22
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
24
|
+
* Public or private harassment
|
|
25
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
26
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
27
|
+
|
|
28
|
+
## Enforcement Responsibilities
|
|
29
|
+
|
|
30
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
31
|
+
|
|
32
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
33
|
+
|
|
34
|
+
## Scope
|
|
35
|
+
|
|
36
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
37
|
+
|
|
38
|
+
## Enforcement
|
|
39
|
+
|
|
40
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dae5@hi.is. All complaints will be reviewed and investigated promptly and fairly.
|
|
41
|
+
|
|
42
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
43
|
+
|
|
44
|
+
## Enforcement Guidelines
|
|
45
|
+
|
|
46
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
47
|
+
|
|
48
|
+
### 1. Correction
|
|
49
|
+
|
|
50
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
51
|
+
|
|
52
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
53
|
+
|
|
54
|
+
### 2. Warning
|
|
55
|
+
|
|
56
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
57
|
+
|
|
58
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
59
|
+
|
|
60
|
+
### 3. Temporary Ban
|
|
61
|
+
|
|
62
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
63
|
+
|
|
64
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
65
|
+
|
|
66
|
+
### 4. Permanent Ban
|
|
67
|
+
|
|
68
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
69
|
+
|
|
70
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
71
|
+
|
|
72
|
+
## Attribution
|
|
73
|
+
|
|
74
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
75
|
+
|
|
76
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
77
|
+
|
|
78
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
79
|
+
|
|
80
|
+
[homepage]: https://www.contributor-covenant.org
|
|
81
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
82
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
83
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
84
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
85
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Contributing to CFS
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in improving the Community Forcing Service. Bug
|
|
4
|
+
reports, new connectors, and documentation fixes are all welcome.
|
|
5
|
+
|
|
6
|
+
## Development setup
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/DarriEy/CFS.git
|
|
10
|
+
cd CFS
|
|
11
|
+
python -m venv .venv && source .venv/bin/activate
|
|
12
|
+
pip install -e ".[climate,cds,earthdata,forecast,dev]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The `climate` extra (xarray/zarr/s3fs/dask/netcdf4) is required for almost all
|
|
16
|
+
of the test suite; `cds`, `earthdata`, and `forecast` let the provider-specific
|
|
17
|
+
offline tests run for real instead of being skipped.
|
|
18
|
+
|
|
19
|
+
## Running the tests
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pytest -m "not network" # offline tests — no credentials or network needed
|
|
23
|
+
pytest -m network # integration tests against live stores (optional)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
All offline tests must pass before a PR is merged. Network tests hit real
|
|
27
|
+
upstream stores and may need credentials (CDS, Earthdata) — they are not run
|
|
28
|
+
in CI.
|
|
29
|
+
|
|
30
|
+
## Linting
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
ruff check src/ tests/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
CI enforces `ruff` (and `mypy src/cfs`); please run both locally before
|
|
37
|
+
pushing.
|
|
38
|
+
|
|
39
|
+
## Adding a connector
|
|
40
|
+
|
|
41
|
+
Connectors are the most valuable contribution. The pattern:
|
|
42
|
+
|
|
43
|
+
1. **Subclass `BaseForcingConnector`** in a new module under
|
|
44
|
+
`src/cfs/connectors/` (optionally mix in a protocol helper such as
|
|
45
|
+
`ZarrStoreMixin`, the Earthdata OPeNDAP mixin, or the CDS API mixin from
|
|
46
|
+
`cfs.connectors.protocols`).
|
|
47
|
+
2. **Implement `list_products()`** — the catalog metadata: product IDs
|
|
48
|
+
(`{slug}:{product}`), variables, resolution, bbox, temporal extent,
|
|
49
|
+
license, and citation.
|
|
50
|
+
3. **Implement `fetch()`** — acquire the upstream data, subset to the
|
|
51
|
+
requested bbox + time range, then harmonize.
|
|
52
|
+
4. **Declare a `VariableMapping` table** mapping native variable names to
|
|
53
|
+
canonical variables (`cfs.core.vocabulary.CanonicalVar`) with linear unit
|
|
54
|
+
conversions (`canonical = source * scale + offset`), setting
|
|
55
|
+
`deaccumulate=True` for running-total fields.
|
|
56
|
+
5. **Decorate the class with `@register("slug")`** from `cfs.core.registry`;
|
|
57
|
+
`discover()` finds it automatically — no central list to edit.
|
|
58
|
+
6. **Finish with `self._finalize(...)`** so the shared guardrails and range QC
|
|
59
|
+
apply uniformly, and return `(dataset, FetchResult)`.
|
|
60
|
+
|
|
61
|
+
Ground rules:
|
|
62
|
+
|
|
63
|
+
- The connector **stops at the canonical dataset**: no HRU remapping, no
|
|
64
|
+
model-specific schemas, no serialization. That is the consumer's job.
|
|
65
|
+
- Precipitation and radiation must be returned as **rates** (`kg m-2 s-1`,
|
|
66
|
+
`W m-2`), never accumulations.
|
|
67
|
+
- Return **lazy** (dask-backed) datasets where the protocol allows, so the
|
|
68
|
+
caller decides when to materialize.
|
|
69
|
+
- Add an **offline test** (`tests/test_<slug>_offline.py`) that exercises the
|
|
70
|
+
mapping/subsetting logic with synthetic data, and a `network`-marked test if
|
|
71
|
+
a live fetch is feasible.
|
|
72
|
+
- Add the provider to `inventory/providers.yaml` and the docs
|
|
73
|
+
[provider catalog](docs/catalog.md).
|
|
74
|
+
- If the new product's name collides with an existing acronym (looking at you,
|
|
75
|
+
NOAA CFS), pick a disambiguated slug.
|
|
76
|
+
|
|
77
|
+
## Pull requests
|
|
78
|
+
|
|
79
|
+
- Keep PRs focused — one connector or one fix per PR.
|
|
80
|
+
- Describe what was verified: offline tests only, or a live fetch (where, what
|
|
81
|
+
values, do they look physical?).
|
|
82
|
+
- CI must be green (ruff, mypy, offline tests on Python 3.11–3.13).
|
|
83
|
+
|
|
84
|
+
## Questions / bugs
|
|
85
|
+
|
|
86
|
+
Open an issue at <https://github.com/DarriEy/CFS/issues>. For bugs, include
|
|
87
|
+
the product ID, bbox, time range, and the full traceback or `FetchResult`
|
|
88
|
+
warnings.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Darri Eythorsson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|