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), and numeric assembly (assemble_jacobian → {(row, col): value} summed per §4 additivity) — a correctness surface evaluated per cell through the official numpy-interpreter runtime and gated against the Julia reference's value goldens (tests/goldens/*.jvals.json, exact key set + 1e-10 relative). The emission side is in as well: jacobian_block / parse_jacobian_block with the §4.1 template CSE (cse_templates / expand_templates), the structure classification, and the factorization plans (per-cell block LU, Markowitz ordering + fill-in) — byte-identical to the reference's emitted blocks (tests/goldens/*.block.json). Production-rate assembly follows.

Metadata

Release files for earthsci-astdiff 0.1.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.1.0
File Size Uploaded Provenance Actions
earthsci_astdiff-0.1.0.tar.gz 38.4 kB With provenance Details for earthsci_astdiff-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 75.9 kB

Release files / earthsci_astdiff-0.1.0.tar.gz

Download URL earthsci_astdiff-0.1.0.tar.gz
Size 38.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eec8cffb9b59164d5dd8066d145abb1cb172a5a36e711a260a41d2ebc044d6ee
BLAKE2b-256 checksum
How to use checksums
b568cc0d2f1ae7554ead607f5c6d3c2e6343441d3663f4a66431214451ab2882
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 Oct 31, 2026.

Transparency log

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

Download URL earthsci_astdiff-0.1.0-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2cc8680bbd0410d4c70d203f12f096b26381ea870ccb13e332ffd0557ad1b0e
BLAKE2b-256 checksum
How to use checksums
485abd92ddcb601de3f1982c459070be3dbad0d2918f916849f170051903338b
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 Oct 31, 2026.

Transparency log

Security for earthsci-astdiff 0.1.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.1.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 Oct 31, 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