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.2.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.2.0
File Size Uploaded Provenance Actions
earthsci_astdiff-0.2.0.tar.gz 108.6 kB With provenance Details for earthsci_astdiff-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 197.4 kB

Release files / earthsci_astdiff-0.2.0.tar.gz

Download URL earthsci_astdiff-0.2.0.tar.gz
Size 108.6 kB
Tags Source
SHA-256 checksum
How to use checksums
781e048ce85389aae5948927a36c349c8ee31452babba3e40606e8609749c244
BLAKE2b-256 checksum
How to use checksums
eafd0b360d9f46f7d441d7821477db4c6796a3e65bfc634fb722b027983e1aeb
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 1, 2026.

Transparency log

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

Download URL earthsci_astdiff-0.2.0-py3-none-any.whl
Size 88.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63cdfb47361130d23d96738dec673e92ad3d53d5c6298d32dfb11e1a29180344
BLAKE2b-256 checksum
How to use checksums
3b8af3863cf9e4b8699f7aeeca2783096b4e2fd6dda601848fa1308d4b7f7507
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 1, 2026.

Transparency log

Security for earthsci-astdiff 0.2.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.2.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 1, 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