Minimum Working Examples

create_mwe

Create a minimum working example using calliope.

create_fpwe

Create a fully parameterized working example using calliope.

create_chp_expansion

Create a fully parameterized working example using calliope.

py - hardcoded

Note

Calliope model data usually is stored in yaml and csv files which is also the main usage of calliope inside tessif. So the amount of py_hard coded examples is hold to a minimum.

Tests passing the timeseries as pandas dataframe did not work so reading from csv is used. But dataframes should work too. Most likely there has been done some mistakes with indexing it correctly.

The energysystem to_csv function in calliope does not work if file already exists. If changes are done and the csv is wanted to be saved, either another directory should be used, or the existing one being deleted.

py_hard is a tessif module for giving examples on how to create an calliope model.

It collects minimum working examples.

Note that a calliope model can have specific parameters which tessif does not cover. For further information on how to use those refer to the calliope documentation.

tessif.examples.data.calliope.py_hard.create_mwe(directory=None, filename=None)[source]

Create a minimum working example using calliope.

Creates a simple energy system simulation to potentially store it on disc in directory

Parameters:
  • directory (str, default=None) –

    String representing of the path the created energy system is saved to.

    Will be joined with filename.

    If set to None (default) tessif.frused.paths.write_dir/calliope will be the chosen directory.

  • filename (str, default=None) –

    Save the energy system using this name.

    If set to None (default) filename will be mwe_calliope.

Returns:

optimized_es – Energy system carrying the optimization results.

Return type:

Model

Note

The energysystem to_csv function in calliope does not work if file already exists. If changes are done and the csv is wanted to be saved, either another directory should be used, or the existing one being deleted.

Examples

Using create_mwe() to quickly access an optimized calliope energy system to use for doctesting, or trying out this frameworks utilities. (For a step by step explanation see Minimum Working Example):

>>> import tessif.examples.data.calliope.py_hard as cllp_py
>>> optimized_es = cllp_py.create_mwe()
tessif.examples.data.calliope.py_hard.create_fpwe(directory=None, filename=None)[source]

Create a fully parameterized working example using calliope.

Creates a simple energy system simulation to potentially store it on disc in directory

Parameters:
  • directory (str, default=None) –

    String representing of the path the created energy system is saved to.

    Will be joined with filename.

    If set to None (default) tessif.frused.paths.write_dir/calliope will be the chosen directory.

  • filename (str, default=None) –

    Save the energy system using this name.

    If set to None (default) filename will be fpwe_calliope.

Returns:

optimized_es – Energy system carrying the optimization results.

Return type:

Model

Note

This example is not actually fully parameterized but the most important parameters when using calliope with tessif are shown. For full parameterization and all defaults there is a defaults.yaml inside the config folder inside the calliope installation folder.

Examples

Using create_fpwe() to quickly access an optimized calliope energy system to use for doctesting, or trying out this frameworks utilities. (For a step by step explanation see Minimum Working Example):

>>> import tessif.examples.data.calliope.py_hard as cllp_py
>>> optimized_es = cllp_py.create_fpwe()
tessif.examples.data.calliope.py_hard.create_chp_expansion(directory=None, filename=None)[source]

Create a fully parameterized working example using calliope.

Creates a simple energy system simulation to potentially store it on disc in directory

Parameters:
  • directory (str, default=None) –

    String representing of the path the created energy system is saved to.

    Will be joined with filename.

    If set to None (default) tessif.frused.paths.write_dir/calliope will be the chosen directory.

  • filename (str, default=None) –

    Save the energy system using this name.

    If set to None (default) filename will be chp_calliope.

Returns:

optimized_es – Energy system carrying the optimization results.

Return type:

Model

Note

This energy system model was created to further inspect the parameter definitions of CHPs when they are expandable. It can be seen that costs refer to the primary output.

Examples

Using create_chp() to quickly access an optimized calliope energy system to use for doctesting, or trying out this frameworks utilities. (For a step by step explanation see Minimum Working Example):

>>> import tessif.examples.data.calliope.py_hard as cllp_py
>>> optimized_es = cllp_py.create_chp_expansion()