Skip to main content

Tempest: WX-1 — High-Performance Scientific Weather Storage Format

PyPI version Python License Determinism

WX-1 is a high-performance, container-native scientific storage engine and file format engineered specifically for Numerical Weather Prediction (NWP), atmospheric modeling, climate reanalysis, and earth system simulations.

Built on a memory-safe Rust core with native Python (PyO3) bindings and an xarray backend engine (engine="wx1"), WX-1 replaces legacy formats with deterministic, ultra-fast I/O for 3D/4D atmospheric tensors.


Key Highlights

  • 100% Bit-Exact Determinism: Preserves raw IEEE 754 bit-patterns ($\Delta_{\max} = 0.0$ verified via .view(np.uint32)), guaranteeing bit-exact restarts for prognostic NWP dynamical cores.
  • Large Array & Chunk Capacity (up to 16 GiB): Supports massive high-resolution global grids, multi-layer soil matrices, and 137-level atmospheric columns without artificial 64 MB chunk restrictions.
  • Multi-Variable Datasets: Bundle multiple atmospheric variables (e.g., surface $T_{2m}$, $MSLP$, $10m$ wind, precipitation) or 3D pressure levels in a unified container via wx1.write_dataset().
  • Ultra-Fast Sub-Volume Slicing:
    • Synoptic horizontal 2D map retrieval: < 10 ms.
    • Atmospheric vertical sounding extraction (e.g. De Bilt column): < 25 ms.
    • Instant container metadata open: 2.97 ms (19.5× faster than NetCDF-4).
  • Native xarray Integration: Open datasets directly with xr.open_dataset("path.wx1", engine="wx1") with lazy variable indexing and Dask chunking.
  • Pluggable Lossless & Bounded Lossy Codecs: Choose zstd_shuffle (byte-shuffle + Zstandard), pure lz4, raw uncompressed, or bounded error quantization (profile="output").
  • Format Adapters: Bidirectional converters for WMO GRIB Edition 1 & 2, NetCDF-4 (HDF5), and Zarr v2/v3.

Benchmark Evidence: Authentic ECMWF ERA5 Reanalysis

Benchmarks executed on authentic ECMWF ERA5 global reanalysis data ($0.25^\circ$, $721 \times 1440 = 1,038,240$ points/slice):

Surface Reanalysis (7 Variables, 120 Timesteps, 872M float32 values)

Variable Description Raw (f32) NetCDF-4 (zlib) WX-1 (Zstd+Shuffle) WX-1 vs NetCDF-4
tp Total precipitation 498.36 MB 108.44 MB 99.58 MB -8.86 MB (-8.2%)
t2m 2m temperature 498.36 MB ~186.22 MB 174.56 MB -11.66 MB (-6.3%)
msl Mean sea level pressure 498.36 MB ~186.22 MB 160.27 MB -25.95 MB (-13.9%)
sp Surface pressure 498.36 MB ~186.22 MB 163.73 MB -22.49 MB (-12.1%)
sst Sea surface temp (NaN mask) 498.36 MB ~186.22 MB 44.03 MB -142.19 MB (-76.4%)
u10 10m U-wind component 498.36 MB ~186.22 MB 245.49 MB +59.27 MB
v10 10m V-wind component 498.36 MB ~186.22 MB 246.88 MB +60.66 MB
TOTAL All 7 Variables 3,488.52 MB 1,225.78 MB 1,134.55 MB -91.23 MB (-7.4%)
  • Comparison to GRIB1: The original era5_sfc_all.grib is 1,675.46 MB. WX-1 is 540.91 MB smaller (-32.3%).
  • Bit-Exactness: All $872,121,600$ float32 values are 100% bit-exact ($\Delta_{\max} = 0.0$).
  • Read Latency: Container open in 2.97 ms (NetCDF-4: 57.91 ms). Sliced field read in 159 ms (NetCDF-4: 883 ms).

Installation

Standard Installation

pip install tempest-wx1

Installation with Scientific & NWP Extras

# Core meteorological stack (NumPy, xarray, Dask)
pip install "tempest-wx1[xarray,dask]"

# Format converters (GRIB2, NetCDF4, Zarr)
pip install "tempest-wx1[grib2,netcdf,zarr]"

# Full stack (including CUDA/GPU support)
pip install "tempest-wx1[all]"

Quickstart Guide

1. Multi-Variable Forecast Export (write_dataset)

Bundle multiple surface variables into a single unified container:

import wx1
import numpy as np

lats = np.linspace(90, -90, 721, dtype=np.float32)
lons = np.linspace(0, 359.75, 1440, dtype=np.float32)

variables = {
    "t2m": np.random.uniform(250.0, 310.0, size=(721, 1440)).astype(np.float32),
    "mslp": np.random.uniform(98000.0, 104000.0, size=(721, 1440)).astype(np.float32),
    "u10": np.random.uniform(-25.0, 25.0, size=(721, 1440)).astype(np.float32),
    "v10": np.random.uniform(-25.0, 25.0, size=(721, 1440)).astype(np.float32),
}

variable_attributes = {
    "t2m": {"units": "K", "long_name": "2 metre temperature"},
    "mslp": {"units": "Pa", "long_name": "Mean sea level pressure"},
    "u10": {"units": "m/s", "long_name": "10 metre U wind component"},
    "v10": {"units": "m/s", "long_name": "10 metre V wind component"},
}

wx1.write_dataset(
    "surface_forecast.wx1",
    variables=variables,
    dimensions={"latitude": 721, "longitude": 1440},
    dimension_roles={"latitude": "latitude", "longitude": "longitude"},
    variable_attributes=variable_attributes,
    variable_dimensions={k: ["latitude", "longitude"] for k in variables},
    dataset_id="tempest_surface_step03",
    codec="zstd_shuffle",
)

2. High-Dimensional Array Storage (write_array)

Write 3D/4D atmospheric tensor volumes (up to 16 GiB per variable/chunk):

# 4D atmospheric temperature tensor: [time, level, lat, lon]
t_profile = np.random.randn(24, 137, 451, 900).astype(np.float32)

wx1.write_array(
    "pressure_levels.wx1",
    t_profile,
    dataset_id="t_profile_d1",
    variable_path="/temperature",
    dimensions=["time", "level", "lat", "lon"],
    chunk_shape=[1, 1, 451, 900],  # 1 level per chunk for instant vertical retrieval
    codec="zstd_shuffle",
    profile="restart",            # 100% bit-exact lossless
    attributes={"units": "K", "standard_name": "air_temperature"},
)

3. Ultra-Fast Slicing & Atmospheric Soundings

Extract specific vertical soundings or synoptic slices without decompressing the entire file:

with wx1.open_file("pressure_levels.wx1") as f:
    # Read T500 hPa slice at step 0: shape [1, 1, 451, 900]
    t500 = f.read_array_slice("/temperature", start=[0, 10, 0, 0], count=[1, 1, 451, 900])
    print("T500 shape:", t500.shape)

    # Read full vertical atmospheric sounding at station coordinates (lat_idx=250, lon_idx=420)
    sounding = f.read_array_slice("/temperature", start=[0, 0, 250, 420], count=[1, 137, 1, 1])
    print("137-level sounding shape:", sounding.squeeze().shape)

4. Direct xarray Integration

Load WX-1 containers seamlessly into xarray.Dataset with lazy indexing:

import xarray as xr

ds = xr.open_dataset("surface_forecast.wx1", engine="wx1")
print(ds)
print(ds["t2m"].values)

5. Format Conversion Utilities

Interoperate directly with existing GRIB2, NetCDF, and Zarr pipelines:

# Convert operational GRIB2 feed to WX-1
wx1.from_grib("gfs_forecast.grib2", "gfs_forecast.wx1", variable_name="t2m")

# Export WX-1 back to CF-compliant NetCDF-4 or Zarr
wx1.to_netcdf("surface_forecast.wx1", "surface_forecast.nc")
wx1.to_zarr("surface_forecast.wx1", "surface_forecast.zarr")

License & Attribution

  • Licensed under the Apache License, Version 2.0 (LICENSE).
  • Copyright 2026 Jordy van Gils.
  • Developed for high-performance physics-based meteorological simulation and operational NWP pipelines.

Metadata

Release files for tempest-wx1 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tempest-wx1 0.1.2
File Size Uploaded Provenance Actions
tempest_wx1-0.1.2.tar.gz 184.0 kB Without provenance Details for tempest_wx1-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tempest-wx1 0.1.2
File Interpreter ABI Platform Actions
tempest_wx1-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for tempest_wx1-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl

Total release size: 1.2 MB

Release files / tempest_wx1-0.1.2.tar.gz

Download URL tempest_wx1-0.1.2.tar.gz
Size 184.0 kB
Tags Source
SHA-256 checksum
How to use checksums
89149a9131f0a7e1a73740d8abd51e4ba78ad2529d74d635e8afde2e0d2e69a6
BLAKE2b-256 checksum
How to use checksums
6163972040b2417dcf439c7ef59ced071cd972c0630a23166c74f5dd8de875a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / tempest_wx1-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL tempest_wx1-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.0 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
750b5236d27a975521558e1ddfdc8e495ea596ca0ac40cc33c041d1de9716d55
BLAKE2b-256 checksum
How to use checksums
14d48f54cfac04e6279f2bdb52e948311548743749a5831c3f0b83f354baa949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Security for tempest-wx1 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page