silo
Cached SILO daily climate for Australia — fetch once per grid point, never twice. Every daily observation this machine ever fetches lands in one SQLite store keyed by SILO's native 0.05° (~5 km) grid, so repeat requests, nearby farms in the same cell, and extended date ranges all reuse the same rows. Part of the Borevitz Lab ecosystem.
How it works
{data_root}/silo_store/
└── silo.db
├── observations(point, date, variable, value) # every value ever fetched
└── coverage(point, start, end) # which date spans are populated
- Any coordinate snaps deterministically to its nearest SILO grid point (~5 km cells — the resolution SILO interpolates at anyway).
Store.get_df(lat, lon, start, end)diffs the requested range against the coverage ledger and fetches only the missing spans from the DataDrill endpoint, then reads the range.- Coverage records only what SILO actually returned — if the record lags behind a requested recent date, the tail stays uncovered and is re-requested next time.
- Writes are transactional (SQLite/WAL): a crash mid-fetch leaves the span unrecorded, and the next run re-fetches it.
Usage
The core API is troi-agnostic — a coordinate and dates:
from datetime import date
from pysilo.store import Store
store = Store() # email from ~/.config/Troi.json, or pass email=...
df = store.get_df(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31))
# one row per day: date, daily_rain, max_temp, min_temp, radiation,
# vp, et_short_crop, ... (18 variables)
store.fill(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31)) # → 0: already local
Pipelines that speak the shared troi.troi.Troi use the
adapters (evaluated at the bbox centre):
df = store.get_df_troi(troi)
download_silo(troi) remains as a thin wrapper returning the classic
YYYY-MM-DD-columned frame.
SILO requires a registration email (sent as the API username) — set
email in ~/.config/Troi.json, TROI_EMAIL, or pass
email= per call.
Performance
Live measurements against SILO — one grid point, all 18 variables:
| Scenario | Fetched | Time |
|---|---|---|
| Cold fill — one year (365 days) | 365 days | 0.9 s |
| Same request again | nothing | 0.0 s |
| Nearby farm, same ~5 km cell | nothing | 0.0 s |
| Date range extended +6 months | 182 days — the extension only | 2.8 s |
| Read cached year (365 × 18) | — | 0.02 s |
Store footprint: ~0.5 MB per point-year across all variables. Absolute times vary with network and SILO load; the zeros are the point — they are ledger lookups, no network involved.
Install
pip
pip install git+https://github.com/thestochasticman/pysilo.git
Dependencies (the troi core included, pulled from GitHub) are
declared in pyproject.toml and installed automatically.
From source
git clone https://github.com/thestochasticman/pysilo.git
cd pysilo
pip install -e .
Package design (shared across the lab's packages — no inheritance, composition only):
Troi(fromtroi) — identity: what region, what dates.SILO(pysilo.silo) — config: endpoint, comment codes, variables.Paths(pysilo.paths) — derived location of the store for a givenConfig.grid— the fixed 0.05° grid (pure, offline-testable math).Store(pysilo.store) — ties them together.
Test
# offline (pure math + synthetic store):
python pysilo/grid.py # True
python pysilo/paths.py # True
python pysilo/store.py # True
# live (small real fetches from SILO, incl. dedup assertions):
python pysilo/download_silo.py # True
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysilo_store-0.1.0.tar.gz.
File metadata
- Download URL: pysilo_store-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a15ef55cfdabb8f71bd22bbd6d2e403ff15e483d8eb742e4959f3f2525f219a7
|
|
| MD5 |
eec89cb157d6cbeb7b70c746dba5ed36
|
|
| BLAKE2b-256 |
46313b0c63631db1f8554317f045ea79262665f7099be035db3e9dffe992db64
|
File details
Details for the file pysilo_store-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pysilo_store-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1519c860e32b184af082e2a7837127470d907fa383f0b1f23b2756b3019bcf56
|
|
| MD5 |
f9e2160be7ccb20bde2f36e191f81324
|
|
| BLAKE2b-256 |
30d53cf9a8a893c5c365b7f5d3bf9073f5b0a4fa593583a098f6793042c0db79
|