TL;DR: crc-sdk and crc-framework 1.1 are out: pip install --upgrade crc-sdk. Same results, much less waiting: checking a site against a local dataset takes 0.07 seconds instead of 5.6, and reading a whole global variable takes 14 seconds instead of 38 with a sixth of the scratch disk. We also sat down (virtually, ofc) with our science team and wrote down exactly what each built-in damage model was calibrated on, so the models now refuse data that was measured differently.
1.0 was correct, just not fast enough
1.0 was about making a number explain itself. Once people started using it on real portfolios, the feedback was consistent: the answers were right, and they took too long. One site against a local file spent almost six seconds decoding curves it would never use. A full read of one CRC Open hazard variable wrote 3 GB of scratch files just to check that no row appeared twice.
None of that was the maths. It was the plumbing around it, so that is where 1.1 went.
Old way: do everything, then filter
- Read and decode every curve in a file, then keep the handful near your sites
- Download source files one after another, each waiting for the last
- Keep every row key as JSON text in a database index, for every row of every stream
- Match each asset to each series separately, even when the series share the same locations
New way: only the work the question needs
- Read what can match. An evaluation works out which cells its assets can fall in before reading anything. Files and row groups that miss every asset are skipped, and only selected rows are decoded
- Download ahead.
Runtime(workers=n)now fetches CRC Open files, station-years, flood-map windows and Zarr chunks on worker threads, in order, while you consume the previous ones - Check duplicates out of core. Short streams check keys in memory; long ones spill compact hashes to a scratch DuckDB file and only compare rows exactly when hashes collide
- Match once per layout. Series on the same supports share one spatial match per asset
The numbers
Same workloads, same outputs, measured on the same laptop/runtime. Results, metadata and reports were compared with the previous version on every change.
| Workload | SDK 1.0 | SDK 1.1 |
| One site, local Dataset file | 5.6 s | 0.07 s |
| Small area, local Dataset file | 6.3 s | 0.7 s |
| First CRC Open read in a process | 3.5 s | 0.68 s |
| 1,000 sites, local file | 21 s | 12.9 s |
| 10,000 sites, local file | 147 s | 92 s |
| One CRC Open variable, worldwide | 38 s | 14 s |
| Scratch disk for that read | 3.1 GB | 0.48 GB |
And one under the hood: deciding which rows belong to the series you selected went from 227 ms to 2.7 ms per 65,536-row batch, because every key is now one integer code and one vectorized membership test.
The framework did its part too. In crc-framework 1.0.1, probability laws are built and queried natively, without a round trip through JSON or Python lists, and long arrays are evaluated across CPU threads with results identical to a single thread.
Models that say what they were calibrated on
A damage function is only valid for the data it was fitted on. A frost-day curve fitted on days below 0 °C should not be fed days below −2 °C, and a wind curve fitted on 10-minute sustained winds should not be fed gusts. 1.0 already refused to bind a model whose calibration facts were unknown, which was honest but meant most built-in models could not be used on data at all.
So we asked the people who built them. With RiskThinking's climate science team, crc-framework 1.1 now records the definitions behind seven models: frost days and freeze-thaw cycles (0 °C, counted per year), maximum daily precipitation (one-day totals), cyclone wind (10-minute sustained), maximum daily wind (no averaging), SPEI (monthly) and cooling degree days (18 °C base). Data that declares the same definitions binds; data that doesn't is refused with a message saying which fact differs.
Two models changed meaning:
- Wildfire damage needs the wildland-urban interface. The calibration only holds for buildings near enough to wildland fuel to burn. The fire-weather model now asks for
WildfireContext(wildland_urban_interface=...), usually from a yes/no column on your assets, and returns zero damage outside it. Leave it out and the model refuses, rather than charging every building in a dry city. - Hot days is retired. Its calibration no longer matches the methodology. It still loads, with a warning, but will not bind to data, and 2.0 removes it.
More usable data, found by the community
Every data fix in this release started as an issue from Yuri (@shlyakh), who has been running the SDK against real sources and writing up exactly where it fell short:
- 20 more climate models. NASA's downscaled CMIP6 projections keep each model's own calendar. 1.0 accepted only the standard calendar, which left out 20 of 34 models; 1.1 reads 365-day and 360-day calendars as they are. (issue · fix)
- Station days you can define. Hourly station indicators used to need all 24 hours of every day, so one incomplete day left a station-year without a value. A new
daily_coveragesets how many hours make a day, recorded in provenance. (issue · fix) - Every flooded pixel. JRC flood maps only draw depths above 10 cm for each return period. Pixels flooded at a single return period used to be dropped and counted with dry ones; now an unmapped return period is read as dry, and dry pixels are reported separately. (issue · fix)
Yuri also contributed four fixes that shipped in 1.0.1: NEX reads report selected years the source does not publish, JRC reads report an area outside the product's extent, NEX resources record the CMIP6 licence written in each file, and GHCNh hourly files are attributed to NOAA NCEI, the actual publisher. That is the kind of report that makes a release: a real source, the exact symptom, and how many models or station-years it affected.
Your DuckDB, your choice
The SDK now works with DuckDB 1.4 through 2.x, and new installs get 2.x. It only uses what behaves the same on both, with tests on each, so you get the speed of whichever version you install and the same results either way. To stay on 1.x, pin it next to the SDK: pip install --upgrade crc-sdk "duckdb<2".
DuckDB 2 does change two things you may touch directly:
- Your own SQL. A few expressions behave differently, such as
x -> x + 1lambdas and division by zero. This only matters for queries you pass toAssets.sql(...)or run on a connection you lend the SDK - Database files are a one way migration. A
.duckdbfile written by DuckDB 2 cannot be opened by 1.x, and there is no converting it back. If you share database files with anyone still on 1.x, connect withconfig={"storage_compatibility_version": "v1.4.0"}before writing. The SDK itself writes no database files
The DuckDB guide lists each change and how to keep 1.x behaviour.
What 1.1 doesn't do
- It doesn't change CRC Open. The data is the same release as 1.0
- Some saved results won't re-resolve. A fire-weather impact saved without the interface condition was computed on the old assumption; re-run it with
WildfireContext
Upgrading
pip install --upgrade "crc-sdk>=1.1,<2"
npm install @climateriskcommons/crc-framework@1.1
No code changes are needed unless you use the fire-weather or hot-days models. The details are in the crc-sdk 1.1.0 and crc-framework 1.1.0 release notes.
Final remark
Thanks to Andrew (@awiebe42), Rithwik (@rkodamana) and Reshma (@reshmasoman) on the climate science team for answering a long thread of very specific questions, and to Yuri (@shlyakh) for the reports and fixes that helped widen data usability.
Tell us what is still slow on Discord.
The software is AGPL-3.0-or-later. CRC Open data is CC BY-NC 4.0, a separate licence.