dCoupler
Differentiable Earth System Coupler — a PyTorch-based framework for building differentiable coupling graphs between hydrological and earth system model components.
Quickstart
pip install dcoupler
import torch
import dcoupler as dc
# Define two components
class Bucket(dc.DifferentiableComponent):
...
class Router(dc.DifferentiableComponent):
...
# Build coupling graph
graph = dc.CouplingGraph()
graph.add_component(bucket)
graph.add_component(router)
graph.connect("bucket", "runoff", "router", "lateral_inflow")
# Run forward
outputs = graph.forward(external_inputs, n_timesteps=365, dt=86400)
# Optimize via backprop
loss = loss_fn(outputs, observations)
loss.backward()
optimizer.step()
Component Types
| Type | Gradient | Use Case |
|---|---|---|
DifferentiableComponent |
PyTorch autograd | Pure PyTorch models |
JAXComponent |
JAX vjp via bridge | JAX models (XAJ, SAC-SMA, Snow-17) |
ProcessComponent |
None / finite diff | External executables (SUMMA, MESH) |
EnzymeComponent |
Enzyme AD | C++ models with Enzyme |
All component types implement the BMIMixin protocol for standardized
lifecycle management (initialize/update/finalize).
Optional Dependencies
pip install dcoupler[jax] # JAX bridge support
pip install dcoupler[models] # cfuse + droute components
pip install dcoupler[all] # Everything
License
Apache 2.0 — see LICENSE for details.
Metadata
Release files for dcoupler 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dcoupler-0.2.0.tar.gz | 40.2 kB | Without provenance | Details for dcoupler-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dcoupler-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for dcoupler-0.2.0-py3-none-any.whl |
Total release size: 79.9 kB
Release files / dcoupler-0.2.0.tar.gz
| Download URL | dcoupler-0.2.0.tar.gz |
|---|---|
| Size | 40.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df6ab1d9a8700e8c16719aaba06428be8ad4c4bc5229b33d3e012ecf88b37033
|
|
BLAKE2b-256 checksum How to use checksums |
15cb9e9b424605923d0c655d4f18e3c12c921d169634b11cf53937eadfd11cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / dcoupler-0.2.0-py3-none-any.whl
| Download URL | dcoupler-0.2.0-py3-none-any.whl |
|---|---|
| Size | 39.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
752d6ad4fe5a89032a1d8fbab1cc6ec4a9e39ab617fd866e272fc80eec7ea47f
|
|
BLAKE2b-256 checksum How to use checksums |
175d24da103def5a928632ef7a0a0b0c0f71b0becb1192de0c93be043be2f425
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for dcoupler 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.
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.