Skip to main content

sdflow

Open-source Python framework for sequential decision problems.

A sequential decision problem is a loop. State S_t is observed, a decision a_t = A^π(S_t) is taken, exogenous information W_{t+1} is revealed, a new state S_{t+1} = S^M(S_t, a_t, W_{t+1}) is reached and a contribution C(S_t, a_t, W_{t+1}) is earned. The goal is a policy π that maximises the expected total contribution.

sdflow gives that loop a concrete form:

  • Problems built from point-in-time datasets, environments and objectives: every field is bitemporal, so a model physically cannot read data that was not knowable at the decision origin.
  • Policies built from predictors, optimizers and simulators, connected by agents.
  • One engine that runs a policy the same way in a backtest over history, a simulation over synthetic exogenous information, and live operation.
  • Verifiable scoring: official splits, a Verifier that fits a fresh submission itself and scores the hidden holdout, bundled benchmarks with reference baselines.

The core is domain-neutral. Energy, the best-supported domain, is an extra: sdflow[energy] adds the asset classes built on energydatamodel. sdflow is the successor of emflow; emflow 0.3 code ports by renaming the import.

Installation

pip install sdflow            # the core
pip install "sdflow[energy]"  # plus the energy asset classes

Quick start

import sdflow as sd

problem = sd.load_problem("gefcom2014:solar")      # a bundled benchmark
result = sd.evaluate(problem, sd.Predictor.persistence(), split="validation")
print(result.score, result.n_origins)

A predictor is fit(train) on a leakage-safe training view and predict(obs) per decision origin; the environment computes the objective from what it returns. See docs/ for the walkthrough: datasets and feeds, environments, features, models, problems and the run engine.

Registering your own problems

Problems in other packages register through the sdflow.problems entry-point group and then load by name anywhere the package is installed:

[project.entry-points."sdflow.problems"]
icing = "my_signals.icing.problem"
sd.load_problem("icing:se1")

Data can live on the Hugging Face Hub: a dataset repo with a rebase.yaml marker is readable through the rb:// filesystem sdflow registers with fsspec (pd.read_parquet("rb://dataset/<owner>/<repo>/<path>")).

Development

uv sync --group dev
uv run pytest

MIT licensed. Built by rebase.energy.

Metadata

Release files for sdflow 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 sdflow 0.1.0
File Size Uploaded Provenance Actions
sdflow-0.1.0.tar.gz 5.5 MB Without provenance Details for sdflow-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.9 MB

Release files / sdflow-0.1.0.tar.gz

Download URL sdflow-0.1.0.tar.gz
Size 5.5 MB
Tags Source
SHA-256 checksum
How to use checksums
773136f4a8fae77cddb8dba50394ac89f2c1a820f26612a5643a619901a756e0
BLAKE2b-256 checksum
How to use checksums
5dcd44c896d20b2aeb64c928e40a6a267fb1393b7582bdb0aecf5047bbddb2d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL sdflow-0.1.0-py3-none-any.whl
Size 5.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
956f73029ef79435b6512dff3b05a5897669a355c75f5cdfef7e831646789599
BLAKE2b-256 checksum
How to use checksums
093f924479a5d976ff8f1866d7471ead10c1f736312a62b1e12db83444bbe7bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sdflow 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.

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.

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