Skip to content

flixopt.tutorials

Datasets and example systems for the flixopt tutorials and notebooks.

Two tiers, so every notebook is standalone after pip install flixopt - no need to clone the repository or copy files out of GitHub:

  • Synthetic data (notebooks 01-07) - generated on the fly from numpy/pandas, no files and no network. Access by name with :func:get_data; see :func:list_data.

  • Pre-built example systems (notebooks 08-09) - downloaded (and cached) from the project's GitHub releases with :func:load_example; see :func:list_examples. Needs pooch (pip install flixopt[tutorials]).

Functions:

list_examples

list_examples() -> list[str]

Return the names of the example systems available via :func:load_example.

load_example

load_example(name: ExampleName) -> FlowSystem

Download (and cache) a pre-built example FlowSystem and return it.

Parameters:

Name Type Description Default
name ExampleName

One of :func:list_examples (e.g. 'district_heating').

required

Returns:

Type Description
FlowSystem

The deserialised :class:flixopt.FlowSystem.

Raises:

Type Description
ValueError

If name is not a known example.

ModuleNotFoundError

If pooch is not installed.

Note

The first call for a given example downloads the artefact from the project's GitHub releases; subsequent calls read it from the local cache.

get_data

get_data(name: DataName) -> dict

Return the synthetic tutorial dataset name as a dict of arrays.

Generated from numpy/pandas, so this works offline with no extra dependencies.

Parameters:

Name Type Description Default
name DataName

One of :func:list_data (e.g. 'heat_system').

required

Raises:

Type Description
ValueError

If name is not a known dataset.

list_data

list_data() -> list[str]

Return the names accepted by :func:get_data.