Skip to main content

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.

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluxopt-0.0.3a0.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fluxopt-0.0.3a0-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

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

Hashes for fluxopt-0.0.3a0.tar.gz
Algorithm Hash digest
SHA256 dfa1a61236ccf433cfd9fe62af7840f042a94ab1028fb50ddd3f0da330789169
MD5 9eb876d95910acd2a9ecf1f89163440f
BLAKE2b-256 0c9845bae8b0abfef176cdc7c184f2e11c6d1f8cf0245343b50d9a1a6b1587e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxopt-0.0.3a0.tar.gz:

Publisher: release.yaml on FBumann/fluxopt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for fluxopt-0.0.3a0-py3-none-any.whl
Algorithm Hash digest
SHA256 50f98833e7bfdf3cb337a86ce7373e093f777e2d5a4908fb736fd5cc73ea32e2
MD5 4f46aa43546ffc60488f862fac4e54f0
BLAKE2b-256 d0c35b52123a8b0e980be8f4eb7820322dd6e3f9e7e4243304d0b5447d45b74c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxopt-0.0.3a0-py3-none-any.whl:

Publisher: release.yaml on FBumann/fluxopt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page