Skip to main content

Rust-native drop-in Python import replacement for eccodes

Project description

ecrust

Rust-native Python package that targets the low-level eccodes import surface for modern GRIB workflows.

Current benchmark and handoff state for follow-on work lives in AGENT_CONTEXT.md. The latest Windows HRRR benchmark there shows ecrust ahead of ecCodes on both the single-file end-to-end values path and the 4-copy multi-file run. GitHub CI for release verification now lives in .github/workflows/ci.yml.

Goal:

  • replace import eccodes with import ecrust
  • keep the common codes_* handle/get/release flow unchanged
  • avoid a native ecCodes C-library dependency

For the supported GRIB workflows, ecrust is a pure-Rust path and does not require linking against the ecCodes C library.

Current implemented surface:

  • codes_grib_new_from_file
  • codes_new_from_file
  • codes_any_new_from_file
  • codes_count_in_file
  • codes_get, codes_get_long, codes_get_double, codes_get_string
  • codes_get_array, codes_get_double_array, codes_get_long_array
  • codes_get_values
  • codes_is_defined, codes_is_missing
  • codes_get_size, codes_get_offset, codes_get_message_offset, codes_get_message_size
  • codes_get_native_type
  • codes_keys_iterator_*
  • codes_skip_*
  • codes_clone, codes_release

Performance note:

  • codes_get_values and native/double "values" array access now return read-only NumPy arrays backed by Rust-owned memory to avoid an extra copy on the hot path.
  • codes_get_version_info() and the benchmark scripts now report allocator and target metadata so performance reruns are attributable to a concrete build variant.

Windows dev note:

  • Local Python tests and benchmarks load python\ecrust\_ecrust.cp313-win_amd64.pyd. After cargo build --release, copy target\release\_ecrust.dll over that file before rerunning Python-side checks.
  • Plain Windows release builds now default to mimalloc because the system allocator was materially slower on the HRRR workload. Use cargo build --release --features system-allocator only for A/B comparison.

Linux / WSL dev note:

  • For Linux validation, run benchmarks from the distro filesystem rather than /mnt/c, and pass explicit --source / --copy-dir paths to the benchmark scripts.
  • Non-Windows builds still default to the system allocator. Use maturin develop --release --features mimalloc or cargo build --release --features mimalloc only when comparing allocators.
  • On Ubuntu 24.04 WSL with Rust 1.94.1, maturin develop --release hit a rustc warning-emission ICE. RUSTFLAGS="-Awarnings" maturin develop --release worked around it.

Verification note:

  • The local parity suite now includes focused drop-in API coverage in tests/test_dropin_surface.py, and the repository includes a Linux/Windows GitHub Actions workflow that builds the extension and runs pytest -q.
  • The parity suite now also includes pinned official operational ECMWF, GFS, and RRFS near-surface GRIB2 subsets, assembled from published .idx / .index sidecars via HTTP range requests so CI verifies real model data without downloading full upstream files.

Current scope:

  • GRIB1 and GRIB2 decode
  • modern GRIB metadata and value access
  • GRIB2 mutation and write-back for common sample and real-world workflows: codes_set_*, codes_get_message, and codes_write now repack common GRIB2 messages and patch original section metadata instead of only exposing shadow state through getters
  • expanded real-world parity coverage against the cfgrib sample corpus plus pinned official ECMWF/GFS/RRFS operational subsets, with broad modern GRIB message compatibility checks and mutation round-trip tests
  • pure-Rust decode path, including JPEG2000 and CCSDS/AEC support through Rust crates

Current non-goals:

  • BUFR, METAR, and GTS support
  • full GRIB write/repack parity across every grid/packing/template combination
  • the full long-tail of every historical eccodes binding function

Release checklist:

  1. Set the final GitHub repository URL in package metadata once the repo is online.
  2. Push the branch and confirm .github/workflows/ci.yml is green on Linux and Windows.
  3. Configure trusted publishing for this repo on TestPyPI and PyPI, or provide the equivalent publish credentials expected by .github/workflows/release.yml.
  4. Run .github/workflows/release.yml with publish_to=testpypi for a dry-run package upload.
  5. Verify pip install ecrust from the published TestPyPI build on Windows and Linux.
  6. Push a vX.Y.Z tag that matches the package version to build Linux x86_64 manylinux wheels, Windows x64 wheels, and an sdist, upload them to the GitHub release, and publish to PyPI.

Known remaining GRIB gap:

  • GRIB1 spectral-complex packing (spherical_harmonics.grib) is still not implemented

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecrust-0.1.0.tar.gz (88.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ecrust-0.1.0-cp313-cp313-win_amd64.whl (527.6 kB view details)

Uploaded CPython 3.13Windows x86-64

ecrust-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (545.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ecrust-0.1.0-cp312-cp312-win_amd64.whl (528.2 kB view details)

Uploaded CPython 3.12Windows x86-64

ecrust-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (545.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ecrust-0.1.0-cp311-cp311-win_amd64.whl (527.4 kB view details)

Uploaded CPython 3.11Windows x86-64

ecrust-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (546.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ecrust-0.1.0-cp310-cp310-win_amd64.whl (527.5 kB view details)

Uploaded CPython 3.10Windows x86-64

ecrust-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (546.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file ecrust-0.1.0.tar.gz.

File metadata

  • Download URL: ecrust-0.1.0.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecrust-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9311882c12839603bd82881caf6739bde197216c4223d800ae71a833660cdaf4
MD5 f7b1c1ce480412136191e40bebd730ac
BLAKE2b-256 362f6ad4787860ee28ba5d9e4da02cb762e3f7e6c2c8cfeca2e8fb98de0d06bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0.tar.gz:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: ecrust-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 527.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecrust-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 505e8334df57e7b9d27ec37a852d19f709cf10bf69ebcae84648df70c99b0a7c
MD5 e3ce70319d9276232d7891c8ab5d20a0
BLAKE2b-256 aa0e84ff030ba9fa0677e31792a660f633a80ba7b975fd3c672a536717bb87d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ecrust-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8805f33e694e966ab80525eb54dbe7df169581b3321124ec4f6206c3c6647970
MD5 f5f785efccf97d0b58e5defa5b8546a4
BLAKE2b-256 037de53956bb771172f973e0a35eb7e08c8079c575103e05764cf95964b44cee

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ecrust-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 528.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecrust-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7c79fc79da6433f8cb3c9d245627bc8813484d065f1729466793cc5cdb0b19da
MD5 fd2a488fc018acc8b5e3cbc64c3fd299
BLAKE2b-256 dfe66153d010a409730d85ec4360c762f6e1d68da1606367441f1527a8f82e08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ecrust-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07390347c49d1d5fef96e1245c8fb94622d0229d7edb18680a42523b1d0b1dd4
MD5 ee2c5ef731a0c6aaa55bca63393a28e0
BLAKE2b-256 cb20b9375bf3e59065429fbdc49189e4a99b42ed5dc466a4aacc288b194e3c14

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ecrust-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 527.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecrust-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 91c67e0621631134a18c2e967c5261a9f6a7b4aa9a650118a9f1e70955eb5a56
MD5 a626d058ed8cdbb27dd887abe77abf4a
BLAKE2b-256 c9b6abd7dde66645abd03220e80f67a46f095ce4038b0a61ef386af316b47767

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ecrust-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7af09ed102b5a25f776f9554d14810f0070d55b7ad5739e1c708f6b85d06523
MD5 1344661e3a6cec57aabae3aef84a5750
BLAKE2b-256 4c9a99e2613a73a7f79d9ceabf7a53a9ab9a3730ee9aa4a13d91fee778907c42

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ecrust-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 527.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecrust-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8d622e0e8fde25e72f6e3323571b0c95b5d995719437425b91ebc37f2dce0021
MD5 00dcfefb0ad7d9b8ece34fb6194a5f39
BLAKE2b-256 d51a2fc972c4a909842326e19a34c06c840ef65be1f70e8b7124cac999f0ab7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecrust-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ecrust-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75f0a9da74ef746f16715166124178221d3eb216f613962d77e9c2e268775e88
MD5 f51d2ba6092d74ac61cee497b8b7fe0b
BLAKE2b-256 2ef15936b54526cf973af2347a95623c6a1b0928bd7199a2ee179f188549b95f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecrust-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on FahrenheitResearch/ecrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page