System Model

Tessifs energy supply syste model.

Serving as primary input data harmonization.

Main Class/Functionality

AbstractEnergySystem

Aggregate tessif's abstract components into an energy system.

AbstractEnergySystem.tropp

Transform, Optimize and PostProcess this Tessif system model.

Alternative Ways of Creation

AbstractEnergySystem.from_components

Create an energy system from a collection of component instances.

Frequently Used Methods

AbstractEnergySystem.connect

Connect another AbstractEnergySystem object to this one.

AbstractEnergySystem.duplicate

Duplicate the energy system and return it.

AbstractEnergySystem.to_nxgrph

Transform tessif system model into networkx graph.

AbstractEnergySystem.serialize

Serialize this system model.

AbstractEnergySystem.deserialize

Load from stored system.

AbstractEnergySystem.pickle

Pickle this system model.

AbstractEnergySystem.unpickle

Restore a pickled energy system object.

class tessif.system_model.AbstractEnergySystem(uid, *args, **kwargs)[source]

Bases: object

Aggregate tessif’s abstract components into an energy system.

Parameters
  • uid (Hashable) – Hashable unique identifier. Usually a string aka a name.

  • busses (Iterable) – Iterable of Bus objects to be added to the energy system

  • sinks (Iterable) – Iterable of Sink objects to be added to the energy system

  • sources (Iterable) – Iterable of Source objects to be added to the energy system

  • transformers (Iterable) – Iterable of Transformer objects to be added to the energy system

  • storages (Iterable) – Iterable of Storage objects to be added to the energy system

  • timeframe (pandas.DatetimeIndex) –

    Datetime index representing the evaluated timeframe. Explicitly stating:

    For example:

    idx = pd.DatetimeIndex(
        data=pd.date_range(
            '2016-01-01 00:00:00', periods=11, freq='H'))
    

  • global_constraints (dict, default={'emissions': float('+inf')}) –

    Dictionary of numeric values mapped to global constraint naming strings.

    Currently recognized constraint keys are:

    • emissions

property uid

Hashable unique identifier.

Usually a string aka a name.

property busses

Generator of the system model’s busses.

Generator of Bus objects part of the energy system.

property chps

Generator of the system model’s CHPs.

Generator of CHP objects part of the energy system.

property connectors

Generator of the system model’s connectors.

Generator of Connectors objects part of the energy system.

property sources

Generator of the system model’s sources.

Generator of Source objects part of the energy system.

property sinks

Generator of the system model’s sinks.

Generator of Sink objects part of the energy system.

property transformers

Generator of the system model’s transformers.

Generator of Transformer objects part of the energy system.

property storages

Generator of the system model’s storages.

Generator of Storage objects part of the energy system.

property nodes

Generator yielding this system models’ components.

property edges

Generator yielding this system model’s Graph representation edges.

Generator of Edge NamedTuples representing graph like edges.

property global_constraints

The system model’s global constraints.

Dictionary of numeric values mapped to global constraint naming strings currently respected by the energy system.

connect(energy_system, connecting_busses, connection_uid)[source]

Connect another AbstractEnergySystem object to this one.

Parameters
  • energy_system (tessif.model.energy_system.AbstractEnergySystem) –

    Energy system object to be connected to this energy system via the respective connecting_busses.

    The energy_system's Bus specified in connecting_busses[1] will be connected to this energy system’s Bus specified in connecting_busses[0]. So it’s uid must be found in this energy system.

  • connecting_busses (tuple) –

    Tuple of Uids string representation specifying the busses with which the energy systems will be connected.

    The energy_system's Bus specified in connecting_busses[1] will be connected to this energy system’s Bus specified in connecting_busses[0].

  • connection_uid (tessif.frused.namedtuples.Uid) – Uid of the Connector object created for connecting the energy system.

Returns

The energy system created by connecting the energy_system to this energy system.

Return type

tessif.model.energy_system.AbstractEnergySystem

duplicate(prefix='', separator='_', suffix='copy')[source]

Duplicate the energy system and return it.

Potentially modify the node names.

Parameters
property timeframe

Timeframe representing the optimization time span.

serialize(fp=None)[source]

Serialize this system model.

classmethod deserialize(stream)[source]

Load from stored system.

pickle(location)[source]

Pickle this system model.

Parameters

location (str, default = None) – String representing of a path the created system model is pickled to. Passed to: meth: pickle.dump.

unpickle(location)[source]

Restore a pickled energy system object.

tropp(plugins, trans_ops=None, opt_ops=None, quiet=False, parent_dir=None)[source]

Transform, Optimize and PostProcess this Tessif system model.

Parameters
  • plugins – Iterable of plugin strings used for tropping.

  • trans_ops (dict, None) – Dictionairy of transformation options.

  • opt_ops (dict, None) – Dictionairy of optimization options.

  • quite (bool) – If True tropp logging level is set to logging.WARNING

  • parent_dir (str, None) – Parent directory aka tessif’s main user directory. Usually established using tessif init my_parent_dir. If default initialization is used (tessif init recommended) then the main user directory is ~/.tessif.d/ and this parameter can and should be ignored.

Returns

Dictionairy holding the tessif.deserialize.RestoredResults keyed by:

Return type

dict

classmethod from_components(uid, components, timeframe, global_constraints=None, **kwargs)[source]

Create an energy system from a collection of component instances.

Particularly usefull when creating energy systems out of existing ones.

Parameters
  • uid (Hashable) – Hashable unique identifier. Usually a string aka a name.

  • components (~collections.abc.Iterable) – Iterable of tessif.model.components.AbstractEsComponent objects the energy system will be created of.

  • timeframe (pandas.DatetimeIndex, optional) –

    Datetime index representing the evaluated timeframe. Explicitly stating:

    For example:

    idx = pd.DatetimeIndex(
        data=pd.date_range(
            '2016-01-01 00:00:00', periods=11, freq='H'))
    

  • global_constraints (dict, default={'emissions': float('+inf')}) –

    Dictionairy of numeric values mapped to global constraint naming strings.

    Recognized constraint keys are:

    • emissions

Returns

The newly constructed energy system containing each component found in components.

Return type

AbstractEnergySystem

to_nxgrph()[source]

Transform tessif system model into networkx graph.

Transform the AbstractEnergySystem object into a networkx.DiGraph object.

Returns

directional_graph – Networkx Directional Graph representing the abstract energy system.

Return type

networkx.DiGraph