wrf-rust0.4.1

WRF post-processing diagnostics, reimplemented in Rust, with a wrf-python-compatible Python API.

Changelog

0.4.1 — 2026-07-10

WRF-Runner compatibility hotfix

Ordinary three-argument interplevel calls again return the exact plain float64 NumPy arrays, NaN missing values, and descending-pressure log interpolation shipped through 0.2.35. Ordinary scalar ll_to_xy calls again return fractional (x, y) tuples and retain the established nearest-edge behavior outside the grid. The wrf-python-compatible metadata, masked-array, integer, sequence, staggering, and analytic-coordinate modes introduced in 0.3.0 remain available by explicit option or extended input.

The WRF-Runner gate now checks concrete return types before any NumPy coercion, covers NaN and fractional-coordinate behavior, and is pinned to Solarpower07/WRF-Runner New-PC-Updates commit fe2e540. This patch changes no Rust diagnostic, cache, parallelism, or HDF5-reader code, so the 0.3.0 diagnostic-pipeline performance work remains intact.

Validation

Python API tests: 42 passed, 0 failed; compatibility-probe unit tests: 4 passed, 0 failed. The clean 0.4.1 wheel passed all 47 P0 WRF-Runner rows on the registered 800×800×79 fixture with xarray installed (3 exact consumer-source hashes, 8 helper contracts, and 36 literal getvar calls). The 500 and 700 hPa real-field interpolation arrays were byte-for-byte identical to 0.2.35, including with xarray present; the helper contracts also passed without xarray. Rust workspace tests: 724 passed, 0 failed, 22 ignored. The pinned wrf-python full-field differential retained 16 of 16 required passes and 0 failures.

0.4.0 — 2026-07-10

Tag v0.4.0. PyPI · GitHub releases

Science audit wave 2

All 25 remaining science-audit findings are resolved: 12 fixed in this release, 7 already resolved in the shipped 0.3.0 line, 4 resolved by documentation, 2 refuted, 0 deferred. Value-moving corrections: the exported SHIP helper now uses the most-unstable parcel's mixing ratio with SHARPpy bounds and corrections (canonical case 0.5 → 1.2, 2.4×); the exported DCP uses the 0–6 km mean wind with knot conversions (1.09 → 2.36, +116.5%); registered SCP applies the current SPC MUCIN factor (−50% / −75% at MUCIN −80 / −160 J/kg); effective STP gains the SPC elevated-inflow zero gate (elevated case 1.0 → 0.0); TEHI follows the literal SPC term assignment (2.4 → 1.6); relative humidity is computed as q/qs per NCAR DCOMPUTERH; gravity is WRF's 9.81 m/s²; height-at-pressure interpolates in log pressure; the dewpoint vapor-pressure floor matches NCAR; updraft-helicity boundary handling matches DCALCUH; and Southern-Hemisphere earth-rotation of winds matches wrf-python. Full table with references and magnitudes.

Compatibility

Two exported Rust helpers changed deliberately: the critical-angle helper now requires the surface wind (the arity change prevents silent stale use), and the exported DCP entry point is the explicit derecho_composite_parameter_from_mean_wind. The Python API is unchanged; WRF-Runner consumer compatibility was proven unaffected, with the consumer unmodified, via the 45-probe runtime test (3 consumer-source, 36 literal getvar, 6 helper; 0 failures). wrf.__version__ now reports the distribution version (previously stuck at 0.2.34).

Tests

Rust workspace suite: 724 passed, 0 failed, 22 ignored (0.3.0 baseline 693 / 0 / 22). wrf-python 1.3.4.1 differential: 16 / 16 required comparisons, 0 failures. SHARPpy 1.4.0a5 differential: 23 / 23, 0 failures, maximum absolute error 3.47 × 10−18. ECAPE goldens unchanged, 12 / 12 plus the pinned upstream golden.

0.3.0 — 2026-07-09

Tag v0.3.0 at commit 351b8f3. PyPI · GitHub releases

Performance

The severe/diagnostic pipeline is ≈3.3× faster on large grids: effective-inflow-layer scans cached, depth-limited CAPE and EL grids parallelized, composites reuse cached CAPE/DCAPE, parallel HDF5 chunk decompression, reduced per-column allocations. Measured details.

Science corrections

Values change where the old ones were wrong: saturated parcel lifts above 1000 hPa no longer clamp to the 1000 hPa adiabat; sub-LCL CIN integrates every level instead of one midpoint slab; CIN no longer accumulates negative buoyancy above the LFC; AVO/PVO apply WRF map-scale factors; theta diagnostics return registered Kelvin units; the helicity alias maps to srh. Verified against wrf-python with a differential parity harness (zero failures) and SPC definitions. Corrections with magnitudes and citations.

Python

Strict wrf-python CAPE/SRH compatibility modes (cape2d_wrfpython, cape3d_wrfpython, srh_wrfpython and components), interplevel compatibility, and analytic WRF coordinate transforms (ll_to_xy/xy_to_ll).

Prior releases

Compact list from the repository's annotated tags.

VersionDateSummary
0.2.352026-04-23Maintenance release
0.2.342026-04-14Maintenance release
0.2.332026-04-14Maintenance release
0.2.322026-04-13Maintenance release
0.2.312026-04-13Cache CAPE/Bunkers families; acknowledge Solarpower07
0.2.302026-04-13Maintenance release
0.2.292026-04-13Maintenance release
0.2.282026-04-12Maintenance release
0.2.262026-04-12Maintenance release
0.2.252026-03-25Clear intermediate cache after each getvar to reduce memory
0.2.242026-03-25Time-slice HDF5 reads to reduce peak memory
0.2.232026-03-22interplevel returns NaN for out-of-range levels instead of clamping
0.2.222026-03-19Remove rayon to fix ProcessPoolExecutor hang
0.2.212026-03-17Match wrf-python DBZ defaults; expose use_varint/use_liqskin
0.2.202026-03-17DBZ variable intercepts; plot fixes
0.2.192026-03-17Rewrite DBZ and UH to match Fortran reference exactly
0.2.182026-03-17Fix reflectivity, UH, and SLP computations
0.2.172026-03-17Prefer WRF native REFL_10CM and UP_HELI_MAX
0.2.162026-03-17Full SHIP formula; stale lapse rates delegate to generic path
0.2.152026-03-17Add tv2m (2-m virtual temperature) with lake_interp
0.2.142026-03-17Lapse rate uses 2 m data at surface; supports lake_interp
0.2.132026-03-17lake_interp flows through STP/SCP/EHI/SHIP/BRI
0.2.122026-03-17interplevel supports 2-D target arrays; SRH exact match
0.2.112026-03-17Match SRH exactly to Solarpower07's implementation
0.2.102026-03-17Unify all SRH/Bunkers paths; fix 5 consistency issues
0.2.92026-03-17SRH: switch to non-pressure-weighted mean wind (SHARPpy mean_wind_npw)
0.2.82026-03-16Maintenance release
0.2.72026-03-16Maintenance release
0.2.62026-03-16Raw variable unit conversion for RAINNC/T2/PSFC and others
0.2.52026-03-16Fix 7 bugs from code review; add dam unit
0.2.42026-03-16Fix SRH sign convention; raw variable fallback; t2
0.2.32026-03-16Add t2; fix hybrid HDF5; interplevel/get_cartopy
0.2.22026-03-16Fix hybrid HDF5; add interplevel/get_cartopy/latlon_coords
0.2.12026-03-16Fix hybrid HDF5 files: v0 superblock + v2 object headers
0.2.02026-03-16Self-contained: vendored math, lake interpolation, solar7 colormaps
0.1.02026-03-16Pure-Rust reader default; fix Sync for PyO3; verify output matches

Note: 0.2.27 was never tagged.