All posts

Climate Risk Commons 1.0: numbers that can explain themselves

crc-framework and crc-sdk 1.0 are out. The bet: a climate-risk number is only as useful as what it can tell you about itself. Dataset 2.0, CRC Open on it, one contract in Python and the browser, and much faster reads.

TL;DR: crc-framework and crc-sdk 1.0 are out: pip install crc-sdk, or npm install @climateriskcommons/crc-framework for the browser. The release is built around one bet: a climate-risk number is only useful if it can explain itself, meaning the exact curve behind it, what it measures, where it applies and where it came from. Dataset 2.0 is the format that carries all of that; CRC Open is now published in it, and reading it for a single site takes about 5 seconds (down from 50) from scratch.

A number on its own is a liability

Score the same building with two vendors and you can get two very different answers, and nobody can say why. Some of that is the models. A surprising amount is lost before any modelling happens: a curve flattened into a few columns, units described in free text, a weather station snapped to a hexagon, a location that couldn't be fitted quietly dropped. By the time the number reaches a report, there is nothing left to audit.

We felt this ourselves in 0.x. The format was good enough to draw a map; it was not good enough to defend one.

Old way: a number and a footnote

New way: a number and its evidence

Dataset 2.0 keeps what 0.x threw away:

None of these is glamorous on its own. Together they mean a result can be traced back, argued with precisely, and reused by someone who wasn't in the room.

Evidence first, laws by choice

The idea I'm happiest about in 1.0 is a small one: evidence and laws are different things.

A flood map that publishes 10-, 100- and 500-year depths gives you evidence: a QuantileCurve with three points. It does not give you a complete probability law. 0.x would quietly fill in the rest; ask for a 1,000-year depth and you got a confident number from an extrapolation nobody chose. In 1.0, turning evidence into a Distribution is an explicit step: you pass a fitting specification, and the FitRecord lists every candidate that was tried and why the winner won. Ask outside what the source supports, and you get a missing value with a reason.

I'd rather hand someone a gap than a number nobody can stand behind.

One contract, Python and the browser

The numerics live in Rust, and Python and JavaScript load the same numerical documents and validate them against the same JSON Schemas. A map in the browser evaluates the same curve as the notebook that produced it, to the same number. Damage functions push hazard distributions through exactly, including decreasing and step functions, with typed input and output units, so "metres in, fraction of value out" is checked rather than assumed.

CRC Open on Dataset 2.0

CRC Open is our free global hazard dataset: 63 variables under SSP5-8.5, now published as Dataset 2.0 behind a public release pointer.

That last part is where most of the speed comes from. Reading one variable over a 2 km box used to take about 50 seconds even with a warm cache; it now takes about 5 seconds from scratch and under 2 seconds from cache. Reading one variable for the whole world takes about two minutes. We also stopped validating the same rows twice, which roughly halves read time for larger local datasets. (Timings are on a laptop, for these specific reads.)

Here is the whole thing for one place: how hot the hottest day gets in Toronto around 2050.

from crc_framework import TemperatureUnit
from crc_sdk import Assets, Bounds, CRCOpen, Period

hottest = CRCOpen.Variable.ANNUAL_MAXIMUM_DAILY_MAXIMUM_TEMPERATURE
toronto = Assets({"asset_id": ["toronto"], "longitude": [-79.38], "latitude": [43.65]})

levels = (
    CRCOpen()
    .select(variables=hottest, periods=Period.window(2048, 2051),
            area=Bounds(west=-79.4, south=43.6, east=-79.3, north=43.7))
    .convert_units(variable=hottest.value, unit=TemperatureUnit.CELSIUS)
    .evaluate(toronto)
    .return_periods([10, 100])
    .read()
)
# 1-in-10 year: 37.5 °C · 1-in-100 year: 43.2 °C (2048–2051, SSP5-8.5)

No account, no download step, and the result knows which release, file and curve it came from.

Tested against the real world

We moved our own notebooks, pipelines and AI skills (crc-docs) to 1.0 against the live services: CHIRPS, GloFAS, EFAS, USGS, ECCC IDF, ISD and GHCNh were each read end to end, and the edge cases they turned up are now regression tests. Live checks now run nightly, so a contribution is checked in seconds instead of waiting on someone else's server.

What 1.0 doesn't do

Upgrading

pip install --upgrade "crc-sdk>=1,<2"
npm install @climateriskcommons/crc-framework

Python 3.11 or later. The details live next to the code: crc-sdk migration guide, crc-framework migration guide, and the crc-docs notebooks, now on 1.0. Not ready to move? The 0.x edition of crc-docs stays put.

Final remark

Thanks to Chris Hampu, who did the heavy lifting on the 1.0 rewrite of both packages.

pip install crc-sdk is the whole next step. Then come and tell us what breaks on Discord.

The software is AGPL-3.0-or-later. CRC Open data is CC BY-NC 4.0, a separate licence.