energia.modeling.parameters.conversion#

Conversion

Classes

Conversion([aspect, add, sub, operation, ...])

Processes convert one Commodity to another Commodity Conversion provides the conversion of resources

Lag([of, periods])

A number of temporal Periods.

Mapping()

A Mapping is a generic container for associating key/value pairs.

Modes([size, sample, parent, n])

Represents a discrete choice to be taken within a spatiotemporal disposition.

PWLConversion(conversions, sample[, aspect, ...])

Piece Wise Linear Conversion

cached_property(func)

class Conversion(aspect: str = '', add: str = '', sub: str = '', operation: Operation | Storage | None = None, resource: Commodity | None = None, balance: dict[Commodity, float | list[float]] | None = None, hold: int | float | None = None, attr_name: str = '', symbol: str = 'η', use_max_time: bool = False)[source]#

Bases: Mapping, _Hash

Processes convert one Commodity to another Commodity Conversion provides the conversion of resources

Parameters:
  • resource (Commodity) – Commodity that is balanced

  • operation (Process | Storage) – Process or Storage that serves as primary spatial index

  • bind (Sample) – Sample that is used to define the conversion

Variables:
  • name (str) – Name of the component, generated based on the operation.

  • base (Commodity) – Basis Commodity, usually has a value 1 in the conversion matrix, set using __call__. Defaults to None.

  • conversion (dict[Commodity : int | float]) – {Commoditys: conversion}. Defaults to {}, set using __eq__.

  • lag (Lag) – Temporal lag (processing time) for conversion, set using __getitem__.

  • periods (Periods) – Periods over which the conversion is defined. Defaults to None.

Raises:

ValueError – If conversion lists are of inconsistent lengths.

Note

  • name and operation are generated post init

  • base (__call__), conversion (__eq__), lag (__getitem__) are defined as the program is built

  • Storage contains two processes (charge and discharge), hence is provided separately

property args: dict[str, str | Operation | Commodity | None]#

Arguments of the conversion

classmethod from_balance(balance: dict[Commodity, float | list[float]], by: str = '', add: str = '', sub: str = '', operation: Operation | None = None, basis: Commodity | None = None) Self[source]#

Creates Conversion from balance dict

property name: str#

Name

property model: Model | None[source]#

energia Model

property program: Prg | None[source]#

gana Program

balancer()[source]#

Checks if there is a list in the conversion If yes, tries to make everything consistent

time_checker(commodity: Commodity, space: Location | Linkage, time: Periods)[source]#

This checks if it is actually necessary to write conversion at denser temporal scales

write(space: Location | Linkage, time: Periods | Lag, modes: Modes | None = None)[source]#

Writes equations for conversion balance

items()[source]#

Items of the conversion balance

keys()[source]#

Keys of the conversion balance

values()[source]#

Values of the conversion balance

get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
class PWLConversion(conversions: list[Conversion], sample: Sample, aspect: str = '', add: str = '', sub: str = '')[source]#

Bases: Mapping, _Hash

Piece Wise Linear Conversion

classmethod from_balance(balance: dict[Modes, Conversion], sample: Sample) Self[source]#

Creates PWLConversion from balance dict

property aspect: str#
property add: str#
property sub: str#
property lag: str#
property name: str#

Name

balancer()[source]#

Balances all conversions

items()[source]#

Items of the conversion balance

keys()[source]#

Keys of the conversion balance

values()[source]#

Values of the conversion balance

box()[source]#

Consolidates the conversion dict into {resource: par} format

write(space: Location | Linkage, time: Periods | Lag)[source]#

Writes equations for conversion balance

get(k[, d]) D[k] if k in D, else d.  d defaults to None.#