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.3.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.3-py3-none-any.whl (257.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eta_incerto-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6279c6a49eb4be35a42da92778e853a998ac13cda066cb971bc0669a4ab54176
MD5 15f3ca3f7beff06311d9c622e2e55040
BLAKE2b-256 a80477c3c28da762c07a6ee163ae79987c26f4ba5a878bbfddb0a66bce1dcb91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eta_incerto-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e576111588692bf294a1caeeeb628489be3260750c75e1243692c58f850f6237
MD5 6a026e94cdaebe0445e063c10192cbdd
BLAKE2b-256 a3ca3c28336a66cffd96857e374a427f493d85b8ed41d6f74a9c72ed2e15d962

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