Skip to main content

Python framework for optimizing multi-energy systems.

Project description

odys

CI Coverage Python versions PyPI Commit activity License



Odys is a Python package for optimizing multi-asset energy portfolios across multiple electricity markets using stochastic optimization, powered by Pydantic, linopy, and HiGHS .

The key features are:

  • Intuitive to write: Great editor support. Completion everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.
  • Simple API: Define your energy system (generators, batteries, loads, markets) and call .optimize(). The mathematical model is built and solved for you under the hood.
  • Pydantic-powered validation: All models are built on Pydantic with strict typing and validators, catching configuration errors early.
  • Stochastic optimization: Optimize across multiple probabilistic scenarios with different prices, capacities, and load profiles to make decisions under uncertainty.

Requirements

A recent and currently supported version of Python.

As Odys is based on Pydantic, linopy, and HiGHS, they will be automatically installed when you install odys.

Installation

pip:

pip install odys

uv:

uv add odys

Example

A generator and a battery working together to meet a fixed load over 4 hourly timesteps:

from datetime import timedelta

from odys.energy_system import EnergySystem
from odys.energy_system_models.assets.generator import PowerGenerator
from odys.energy_system_models.assets.load import Load
from odys.energy_system_models.assets.portfolio import AssetPortfolio
from odys.energy_system_models.assets.storage import Battery
from odys.energy_system_models.scenarios import Scenario

generator = PowerGenerator(
    name="gen",
    nominal_power=100.0,
    variable_cost=50.0,
)

battery = Battery(
    name="battery",
    capacity=50.0,
    max_power=25.0,
    efficiency_charging=0.95,
    efficiency_discharging=0.95,
    soc_start=0.5,
    soc_end=0.5,
)

load = Load(name="demand")

portfolio = AssetPortfolio()
portfolio.add_asset(generator)
portfolio.add_asset(battery)
portfolio.add_asset(load)

energy_system = EnergySystem(
    portfolio=portfolio,
    scenarios=Scenario(
        load_profiles={"demand": [60, 90, 40, 70]},
    ),
    timestep=timedelta(hours=1),
    number_of_steps=4,
    power_unit="MW",
)

result = energy_system.optimize()

Contributing

For guidance on setting up a development environment and how to make a contribution to odys, see Contributing to odys.

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

odys-0.1.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

odys-0.1.2-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file odys-0.1.2.tar.gz.

File metadata

  • Download URL: odys-0.1.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odys-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d01d50d95d34ef5a9eebb89ff713597195ee4c497f8e2286a55b75e8d63598af
MD5 7733367f946954379db6f8e4bcf3d6c3
BLAKE2b-256 514fc5b81bc657c89cca8ea23c5dea0e946b7fde510f05b47b9ec381108e2353

See more details on using hashes here.

File details

Details for the file odys-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: odys-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 38.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odys-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd919c202a99cbe01ad464128b763d692540cf03d4f4aecd6237a218c7f5e178
MD5 893fa22cbd229ad093d7cc9e4ba582ea
BLAKE2b-256 532c0e7478c90219e165b7b96bee66cce285c49a9c93bdf087ebf455e5b52175

See more details on using hashes here.

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