fluxopt

Energy system optimization with linopy — detailed dispatch, scaled to multi period planning.
https://github.com/fbumann/fluxopt

Category: Energy Systems
Sub Category: Energy System Modeling Frameworks

Last synced: about 23 hours ago
JSON representation

Repository metadata

Successor of flixopt with a new datamodel

README.md

fluxopt

Energy system optimization with linopy — detailed dispatch, scaled to multi period planning.

PyPI
Downloads
License: MIT
Python 3.12+
Ruff

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

# A gas boiler covers a heat demand, minimizing fuel cost
from datetime import datetime
from fluxopt import Carrier, Converter, Effect, Flow, Port, optimize

result = optimize(
    timesteps=[datetime(2024, 1, 1, h) for h in range(4)],
    carriers=[Carrier('gas'), Carrier('heat')],
    effects=[Effect('cost')],
    ports=[
        Port('grid', imports=[
            Flow('gas', size=500, effects_per_flow_hour={'cost': 0.04})
        ]),
        Port('demand', exports=[
            Flow('heat', size=100, fixed_relative_profile=[0.4, 0.7, 0.5, 0.6])
        ])
    ],
    converters=[
        Converter.boiler(
            'boiler',
            thermal_efficiency=0.9,
            fuel_flow=Flow('gas', size=300),
            thermal_flow=Flow('heat', size=200)
        )
    ],
    objective_effects='cost',
)

print(f"Total cost: {result.objective:.2f}")
print(result.flow_rates)

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


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 122
Total Committers: 4
Avg Commits per committer: 30.5
Development Distribution Score (DDS): 0.172

Commits in past year: 122
Committers in past year: 4
Avg Commits per committer in past year: 30.5
Development Distribution Score (DDS) in past year: 0.172

Name Email Commits
FBumann 1****n 101
dependabot[bot] 4****] 15
fluxopt-release[bot] 2****] 5
GitButler g****r@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 3 days ago

Total issues: 6
Total pull requests: 31
Average time to close issues: about 6 hours
Average time to close pull requests: 5 days
Total issue authors: 1
Total pull request authors: 3
Average comments per issue: 0.33
Average comments per pull request: 1.26
Merged pull request: 13
Bot issues: 0
Bot pull requests: 17

Past year issues: 6
Past year pull requests: 31
Past year average time to close issues: about 6 hours
Past year average time to close pull requests: 5 days
Past year issue authors: 1
Past year pull request authors: 3
Past year average comments per issue: 0.33
Past year average comments per pull request: 1.26
Past year merged pull request: 13
Past year bot issues: 0
Past year bot pull requests: 17

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/fbumann/fluxopt

Top Issue Authors

  • FBumann (6)

Top Pull Request Authors

  • dependabot[bot] (15)
  • FBumann (14)
  • fluxopt-release[bot] (2)

Top Issue Labels

  • area:api (2)
  • type:feat (2)
  • area:storage (1)
  • area:new (1)
  • area:multi-period (1)
  • type:docs (1)

Top Pull Request Labels

  • dependencies (13)
  • type:docs (7)
  • autorelease: pending (2)

Package metadata

pypi.org: fluxopt

Energy system optimization with linopy — progressive modeling, from simple to complex.

  • Homepage:
  • Documentation: https://fluxopt.readthedocs.io/
  • Licenses: MIT
  • Latest release: 0.0.3a0 (published 3 months ago)
  • Last Synced: 2026-05-23T19:00:50.953Z (3 days ago)
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 70 Last month
  • Rankings:
    • Dependent packages count: 7.8%
    • Average: 27.089%
    • Downloads: 29.361%
    • Dependent repos count: 44.106%
  • Maintainers (1)

Dependencies

pyproject.toml pypi
  • highspy >=1.13.1
  • linopy @ git+https://github.com/PyPSA/linopy.git@f53d1968e53d70962eb208b01c3f938f693f0083
  • netcdf4 >=1.6.0
  • numpy >=1.26
  • pandas >=2.1
  • xarray >=2024.1.0
.github/workflows/dependabot-auto-merge.yaml actions
  • actions/create-github-app-token v3 composite
  • dependabot/fetch-metadata v2 composite
.github/workflows/ci.yaml actions
  • actions/checkout v6 composite
  • actions/setup-python v6 composite
  • astral-sh/ruff-action v3 composite
  • astral-sh/setup-uv v7 composite
  • codecov/codecov-action v5 composite
.github/workflows/pr-title.yaml actions
  • amannn/action-semantic-pull-request v6 composite
.github/workflows/release.yaml actions
  • actions/create-github-app-token v3 composite
  • googleapis/release-please-action v4 composite
.github/workflows/publish.yaml actions
  • actions/checkout v6 composite
  • actions/setup-python v6 composite
  • astral-sh/setup-uv v7 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/label-from-title.yaml actions

Score: 9.01627006814768