Skip to main content

earthsci-astdiff (Python)

Python binding of EarthSciASTDiff: analytical sparse Jacobians for .esm models, by rule-based differentiation of the expression AST. Implements the derivative semantics of esm-jacobian-spec.md (§3 per-operator rules, §4 band entries incl. contracted dimensions) against the earthsci-ast types, and is gated by the same band-list goldens as the Julia reference (tests/goldens/*.bands.json, byte-identical deterministic JSON).

import earthsci_ast
from earthsci_astdiff import jacobian_bands, serialize_band, stable_json

file = earthsci_ast.load_path("model.esm")
entries = jacobian_bands(file, "MyModel")  # ∂f/∂u as Band entries
entries_p = jacobian_bands(file, "MyModel", wrt="parameters")
text = stable_json([serialize_band(e) for e in entries])

Scope: the band calculus (jacobian_bands), the §4 entry serialization (serialize_band / parse_band / stable_json), the structural sparsity pattern (jacobian_pattern, plain COO index lists — no scipy dependency), jacobian_block / parse_jacobian_block with the §4.1 template CSE (cse_templates / expand_templates), the structure classification, the factorization plans (per-cell block LU, Markowitz ordering + fill-in), the derived evaluation document (evaluation_document, with hoist_observed), the product documents (jvp_document / vjp_document / hvp_document, spec §9) and the scatter plans (scatter_plan / bind_plan, spec §8) — each byte-identical to the reference's goldens.

The package evaluates nothing: every value is EarthSciAST's, from running one of these documents. The tests do exactly that (tests/docvals.py, with EarthSciAST's numpy interpreter) and gate the results against the Julia reference's value goldens (tests/goldens/*.jvals.json, *.hvals.json; exact key set + 1e-10 relative).

Metadata

Release files for earthsci-astdiff 0.3.0

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

Source distribution (sdist)

Source distribution for earthsci-astdiff 0.3.0
File Size Uploaded Provenance Actions
earthsci_astdiff-0.3.0.tar.gz 118.2 kB With provenance Details for earthsci_astdiff-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for earthsci-astdiff 0.3.0
File Interpreter ABI Platform Actions
earthsci_astdiff-0.3.0-py3-none-any.whl Python 3 none any Details for earthsci_astdiff-0.3.0-py3-none-any.whl

Total release size: 210.4 kB

Release files / earthsci_astdiff-0.3.0.tar.gz

Download URL earthsci_astdiff-0.3.0.tar.gz
Size 118.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9d30f51a39e9261cc08f17907c1ff61a2862e47ac618747e6677506cb0cd0462
BLAKE2b-256 checksum
How to use checksums
b51fb8aa5e314fac7258b5e9a2f78b9d422ef8c8d3094e5decef71e2760350c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / earthsci_astdiff-0.3.0-py3-none-any.whl

Download URL earthsci_astdiff-0.3.0-py3-none-any.whl
Size 92.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f0eee730aa7e3d2723affca5d626ea1155e7ebbc124552284e65211e745b954
BLAKE2b-256 checksum
How to use checksums
4953e9e58ff8760876d6779cda8df68fae780877633d6b305a53f5d51cb97b81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for earthsci-astdiff 0.3.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for earthsci_astdiff-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

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