Skip to main content

Library for modeling investment decisions under uncertainty

Project description

ETA Incerto

ETA Incerto is a Python library for modeling investment decisions under uncertainty in energy systems. It provides deterministic, stochastic, robust, regret, and antifragile optimization workflows using Pyomo models and optional multi-objective search via pymoo.

Key Features

  • Deterministic evaluation and investment sizing
  • Stochastic, robust, and regret-based optimization under uncertainty
  • Antifragile optimization with PCE-based evaluation
  • Multi-objective optimization with pymoo + Pyomo
  • Results reporting, plotting, and optional results repository publishing

Workflow Overview

flowchart LR
  Config["Config file (json/toml/yaml)"] --> Eta[EtaIncerto]
  Register["Variant system registration"] --> Eta
  Eta --> Load["Load series + scenarios"]
  Load --> Opt["Optimization or evaluation"]
  Opt --> Results["HDF5 results artifacts"]
  Results --> Plots["Reports and plots"]
  Results --> Repo["Publish to results repo (optional)"]

Results repository integration

See docs/results_integration.md for publishing and pulling optimization run artifacts via the Git LFS results repository, including the eta-incerto-results console entry point.

Installation

Python >=3.11,<3.13 is required.

Recommended (development setup):

poetry install
poetry run pre-commit install

Solver note: Pyomo requires an available solver. This project includes gurobipy as a dependency, but you can use any compatible Pyomo solver configured on your system.

Adding dependencies

poetry add <package-name>@latest

Quick Start

Minimal usage with a config file and a registered system:

from pathlib import Path

from eta_incerto.core import EtaIncerto

# Import a variant module to register a system
import examples.antifragile.variants.variant_zero.system  # noqa: F401

root_path = Path("examples/antifragile")
experiment = EtaIncerto(root_path, "config", relpath_config=".")
experiment.antifragile_optimization()

Configuration

ETA Incerto loads configuration from JSON/TOML/YAML. Required top-level sections are:

  • paths
  • system
  • scenario
  • series

Additional sections such as solver/horizon (e.g. pyomo key for backward compatibility), pymoo, algorithm, termination, evaluate, plots, and analysis control solver, optimization, and reporting behavior.

Configs are resolved relative to root_path and relpath_config. Example usage:

EtaIncerto(root_path, "config", relpath_config=".")

Examples

Antifragile optimization:

python examples/antifragile/main.py --config config

Conventional methods (stochastic/robust/regret):

python examples/conventional/main.py --config config

Deterministic evaluation:

python examples/deterministic_operation/main.py --config config

To publish results artifacts from example runs (optional):

python examples/antifragile/main.py \
  --publish-results \
  --objectives-summary "Minimize cost and latency"

CLI Tools

Unified runtime analysis (conventional + antifragile + all profilers in one call):

eta-incerto-runtime-analysis runs/2026-03-06_1344_8f8584

Config files are read from the run folder by a fixed naming convention (config, config_debug_minimal, config_line_profile, config_pyinstrument, config_job_profile). See docs/runtime_analysis.md for the config table, one-command usage, and expected artifacts.

Line profiling (line-by-line timing) for antifragile optimization:

eta-incerto-profile --config examples/antifragile/config --variant variant_one --single-eval

See docs/line_profile.md for all options and CLI examples.

Call-stack profiling (pyinstrument) for a full antifragile run (sampling profiler, HTML report):

eta-incerto-pyinstrument --config examples/antifragile/config --html-report report.html

See docs/pyinstrument_profile.md for options. Use line profiling for per-line hotspots; use pyinstrument for high-level call-stack and full-run timing. The pyinstrument package is a dev dependency (poetry install includes it in development).

Results repository integration:

eta-incerto-results publish --artifact outputs/results.h5 --config config/run_config.yaml

See docs/results_integration.md for details on publishing and pulling artifacts.

Results Repository Integration

The results repository integration is opt-in and uses Git LFS to store large artifacts. Environment variables:

  • RESULTS_REPO_URL
  • RESULTS_REPO_PATH
  • PUBLISH_RESULTS=1

Development

poetry install
poetry run pre-commit install

Developing against a local eta-components clone

ETA Incerto depends on eta-components. To work on both repos in parallel (e.g. in a multi-root Cursor workspace), use an editable install so changes in eta-components are picked up without reinstalling.

  1. Clone both repos side by side, e.g. c:\Git\eta-incerto and c:\Git\eta-components.
  2. In this repo’s pyproject.toml, eta-components is already set to a path dependency:
    eta-components = { path = "../eta-components", develop = true }
    
  3. Run poetry lock and poetry install in this repo. Your environment will use the local eta-components clone.

For release or CI (e.g. publishing to PyPI or running in a clean environment), change that line back to a version constraint, e.g. eta-components = "^0.0.6", and rely on the published package.

License

BSD-2-Clause License.

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

eta_incerto-1.0.2.tar.gz (202.4 kB view details)

Uploaded Source

Built Distribution

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

eta_incerto-1.0.2-py3-none-any.whl (257.6 kB view details)

Uploaded Python 3

File details

Details for the file eta_incerto-1.0.2.tar.gz.

File metadata

  • Download URL: eta_incerto-1.0.2.tar.gz
  • Upload date:
  • Size: 202.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11

File hashes

Hashes for eta_incerto-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8175185538e374d5e7fd7bc8ac396b304e9eb79baa39391df9134e6e18f3bd66
MD5 bdb6e42df4219188a447479f7880157e
BLAKE2b-256 1f9a48cac1da0525f94af57bbbc5fb378d73ab79ab191ac84039dd86fd1067c5

See more details on using hashes here.

File details

Details for the file eta_incerto-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: eta_incerto-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 257.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11

File hashes

Hashes for eta_incerto-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f4dedf045d185aa8b206c4fd3d8b50ea0d062e0fc68e4772086155013e94bc95
MD5 f61e15d3cc60ed434baa98668fd8056d
BLAKE2b-256 b513f3d543e39e0ae9a68205c55ab024c7a9a2c934294e34029236586c2f5b9a

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