Energy system optimization with linopy — progressive modeling, from simple to complex.
Project description
fluxopt
Energy system optimization with linopy — detailed dispatch, scaled to multi period planning.
Early development — the API may change between releases. Planned features and progress are tracked in Issues.
Installation
pip install fluxopt
Includes the HiGHS solver out of the box.
Quick Start
from datetime import datetime, timedelta
import fluxopt as fx
timesteps = [datetime(2024, 1, 1) + timedelta(hours=i) for i in range(4)]
result = fx.optimize(
timesteps=timesteps,
carriers=[fx.Carrier('electricity')],
effects=[fx.Effect('cost', is_objective=True)],
ports=[
fx.Port('grid', imports=[
fx.Flow('electricity', size=200, effects_per_flow_hour={'cost': 0.04}),
]),
fx.Port('demand', exports=[
fx.Flow('electricity', size=100, fixed_relative_profile=[0.5, 0.8, 1.0, 0.6]),
]),
],
)
Roadmap
fluxopt is evolving into a family of packages with a lean core and optional companions:
┌──────────────┐
│ fluxopt │ core: model building, solving, results, IO
└──────┬───────┘
┌───────────┬──┴──────────┬────────────────┐
│ │ │ │
fluxopt-plot fluxopt-yaml fluxopt-tsam (examples)
plotting YAML+CSV time series cross-package
(plotly) loader aggregation notebooks
Companion packages depend on core — core has no knowledge of companions.
Milestones
| Milestone | Description | Status | Issue |
|---|---|---|---|
Result.stats accessor |
Cached xarray properties for post-processing | Planned | #49 |
.plot stub on Result |
Discoverable property, helpful error if plot package absent | Planned | #50 |
fluxopt-plot package |
Interactive plotly visualization as companion package | Scaffolded | #51 |
fluxopt-yaml package |
Declarative model definition via YAML + CSV | Scaffolded | #52 |
fluxopt-tsam package |
Time series aggregation preprocessing | Planned | — |
| ReadTheDocs migration | Automatic versioned docs from git tags | Planned | #53 |
| Remove plotly from core | Keep core lean — plotting deps in fluxopt-plot only |
Planned | #54 |
Stability Tiers
| Component | Tier | Policy |
|---|---|---|
| Core modeling API | Stable | Semver. Deprecation warnings before removal. |
| Stats accessor | Semi-stable | Breaking changes allowed between minor versions with changelog entry. |
fluxopt-yaml |
Experimental | Own versioning. YAML schema may change. |
fluxopt-plot |
Experimental | Own versioning. Method signatures may change. |
fluxopt-tsam |
Independent | Fully independent semver. |
See #47 for the full architecture discussion.
Development
Requires uv and Python >= 3.12.
uv sync --group dev # Install deps
uv run pytest -v # Run tests
uv run ruff check . # Lint
uv run ruff format . # Format
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fluxopt-0.0.3a0.tar.gz.
File metadata
- Download URL: fluxopt-0.0.3a0.tar.gz
- Upload date:
- Size: 35.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfa1a61236ccf433cfd9fe62af7840f042a94ab1028fb50ddd3f0da330789169
|
|
| MD5 |
9eb876d95910acd2a9ecf1f89163440f
|
|
| BLAKE2b-256 |
0c9845bae8b0abfef176cdc7c184f2e11c6d1f8cf0245343b50d9a1a6b1587e2
|
Provenance
The following attestation bundles were made for fluxopt-0.0.3a0.tar.gz:
Publisher:
release.yaml on FBumann/fluxopt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fluxopt-0.0.3a0.tar.gz -
Subject digest:
dfa1a61236ccf433cfd9fe62af7840f042a94ab1028fb50ddd3f0da330789169 - Sigstore transparency entry: 1079040393
- Sigstore integration time:
-
Permalink:
FBumann/fluxopt@908c2ae5c9b27ef3e3feca424884afe19e5a3314 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FBumann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@908c2ae5c9b27ef3e3feca424884afe19e5a3314 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fluxopt-0.0.3a0-py3-none-any.whl.
File metadata
- Download URL: fluxopt-0.0.3a0-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f98833e7bfdf3cb337a86ce7373e093f777e2d5a4908fb736fd5cc73ea32e2
|
|
| MD5 |
4f46aa43546ffc60488f862fac4e54f0
|
|
| BLAKE2b-256 |
d0c35b52123a8b0e980be8f4eb7820322dd6e3f9e7e4243304d0b5447d45b74c
|
Provenance
The following attestation bundles were made for fluxopt-0.0.3a0-py3-none-any.whl:
Publisher:
release.yaml on FBumann/fluxopt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fluxopt-0.0.3a0-py3-none-any.whl -
Subject digest:
50f98833e7bfdf3cb337a86ce7373e093f777e2d5a4908fb736fd5cc73ea32e2 - Sigstore transparency entry: 1079040401
- Sigstore integration time:
-
Permalink:
FBumann/fluxopt@908c2ae5c9b27ef3e3feca424884afe19e5a3314 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FBumann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@908c2ae5c9b27ef3e3feca424884afe19e5a3314 -
Trigger Event:
push
-
Statement type: