energia

Contents

energia#

Energia

Functions

currencies(model)

Load default currencies

env_indicators(model)

Load default indicators

misc_units(model)

Miscellaneous units

si_units(model)

SI units

time_units(model)

Time units

Classes

Currency(*locs[, label, citations])

Same as Economic Impact (Eco)

Economic([label, citations])

Economic impact

Emission([basis, label, citations])

Environ([label, citations])

Environmental Impact

Land([basis, label, citations])

Land used by Operations

Linkage(source, sink[, dist, bi, auto, ...])

Linkage between two Locations.

Location(*has[, label, citations])

A discretization of Space.

Material([basis, label, citations])

Materials are Resources, that are used to set up Operations

Model([name, init, default, capacitate])

An abstract representation of an energy system.

Periods([size, of, n, label, citations])

A discretization of Time.

Player([label, citations])

Player or Actor, the one taking the decisions based on information provided

Process(*args[, label, citations])

Process converts one Resource to another Resource at some Location

Resource([basis, label, citations])

A resource, can be a material, chemical, energy, etc.

Social([label, citations])

Social Impact

Storage(*args[, label, citations])

Storage is a container for three main elements: 1.

TemporalScales(discretizations[, names])

A temporal scale for a model.

Transport(*args[, label, citations])

Exports Resource through Link basically, moves Resources between Locations

Unit([basis, times, label])

Unit of measure for a quantity provided as input to a component

class Currency(*locs: Location, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Commodity

Same as Economic Impact (Eco)

Parameters:
  • label (str, optional) – Label of the commodity, used for plotting. Defaults to None.

  • name (str, optional) – Name of the commodity, used for indexing. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversions (list[Conversion]) – List of conversions associated with the commodity. Defaults to [].

  • insitu (bool, optional) – If the commodity only exists insitu, i.e., does not scale any domains

locs: list[Location] | None = None#
howmany(cash: Self)[source]#

Exchange rate basically

property I#

gana index set (I)

property balance: dict[Conversion | Self, int | float]#

Conversion

property cons: list[C]#

Constraints

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

Circumscribing Periods (Temporal Scale)

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

values() an object providing a view on D's values#
class Economic(label: str = '', citations: str = '', **kwargs)[source]#

Bases: Indicator

Economic impact

Parameters:
  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

property I#

gana index set (I)

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property impact: Impact#

Impact object

property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

class Emission(basis: Unit | None = None, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Commodity

Parameters:
  • label (str, optional) – Label of the commodity, used for plotting. Defaults to None.

  • name (str, optional) – Name of the commodity, used for indexing. Defaults to None.

  • basis (Unit, optional) – Unit basis of the commodity. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversions (list[Conversion]) – List of conversions associated with the commodity. Defaults to [].

  • insitu (bool, optional) – If the commodity only exists insitu, i.e., does not scale any domains

property I#

gana index set (I)

property balance: dict[Conversion | Self, int | float]#

Conversion

property cons: list[C]#

Constraints

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

Circumscribing Periods (Temporal Scale)

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

values() an object providing a view on D's values#
class Environ(label: str = '', citations: str = '', **kwargs)[source]#

Bases: Indicator

Environmental Impact

Parameters:
  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

property I#

gana index set (I)

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property impact: Impact#

Impact object

property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

class Land(basis: Unit | None = None, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Commodity

Land used by Operations

Parameters:
  • label (str, optional) – Label of the commodity, used for plotting. Defaults to None.

  • name (str, optional) – Name of the commodity, used for indexing. Defaults to None.

  • basis (Unit, optional) – Unit basis of the commodity. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversions (list[Conversion]) – List of conversions associated with the commodity. Defaults to [].

  • insitu (bool, optional) – If the commodity only exists insitu, i.e., does not scale any domains

property I#

gana index set (I)

property balance: dict[Conversion | Self, int | float]#

Conversion

property cons: list[C]#

Constraints

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

Circumscribing Periods (Temporal Scale)

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

values() an object providing a view on D's values#
class Linkage(source: Location, sink: Location, dist: float | None = None, bi: bool = False, auto: bool = False, label: str = '', citations: str = '')[source]#

Bases: _X

Linkage between two Locations.

Parameters:
  • name (str, optional) – Name of the Linkage. Defaults to None.

  • label (str, optional) – Label of the Linkage. Defaults to None.

  • source (Loc) – Source Location.

  • sink (Loc) – Sink Location.

  • dist (float | Unit) – Distance between the two Locations.

  • bi (bool, optional) – Is the Linkage bidirectional? Defaults to False.

  • auto (bool, optional) – Is the Linkage automatically generated? Defaults to False.

Variables:
  • model (Model) – Model to which the Linkage belongs.

  • space (Space) – Space to which the Linkage belongs.

  • network (Loc) – Network to which the Linkage belongs.

property space: Space[source]#

Space to which the Location belongs

property network: Location#

Network to which the Location belongs

property isnetwork: bool#

Is this the network of the model? Linkage can never be the network

property isin: Location | None#

Location to which the Linkage belongs

rev()[source]#

Reversed Link

property I: I[source]#

gana index set (I)

update_hierarchy(hierarchy: int = 0)[source]#

Updates the hierarchy of the locations

property cons: list[C]#

Constraints

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

class Location(*has: Self, label: str = '', citations: str = '')[source]#

Bases: _X

A discretization of Space. A location can be inclusive of other locations

Parameters:
  • has (tuple[IsLocation]) – Locations contained in this Location.

  • label (str, optional) – Label of the Location. Defaults to None.

Variables:
  • model (Model) – Model to which the Location belongs.

  • name (str) – Name of the Location. Set when the Location is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the Location.

  • domains (list[Domain]) – List of domains associated with the Location.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the Location with domains.

  • isin (IsLocation, optional) – Location in which this Location is contained. Defaults to None.

  • currency (Currency, optional) – Currency used in the Location. Defaults to None.

  • alsohas (tuple[IsLocation]) – Locations contained in this Location, but not directly. Defaults to ()

  • hierarchy (int, optional) – Level of hierarchy of the Location. Defaults to None.

locate(*operations: Process | Storage)[source]#

Locates the Operations

property tree: dict[Self, dict]#

Prints the tree of Locations

property parent: Self | None#

Finds the parent Location

property depth#

Finds the depth of the Location

update_hierarchy(hierarchy: int = 0)[source]#

Updates the hierarchy of the locations

property space: Space#

Space to which the Location belongs

property network: Self#

Network to which the Location belongs

property isnetwork: bool#

Is this the network of the model?

property I: I[source]#

gana index set

sink()[source]#

Tells whether the location is a sink

source()[source]#

Tells whether the location is a source

Finds the links between two Locations

Parameters:
  • location (IsLocation) – Location to find links with

  • show (bool, optional) – Whether the links are to be printed. Defaults to True.

Returns:

Links between the Locations

Return type:

list[Linkage]

connected(location, show: bool = False) bool[source]#

Finds whether the Locations are connected

Parameters:
  • location (IsLocation) – Location to verify Links with

  • show (bool, optional) – Whether to print the Links. Defaults to False.

Returns:

True if Locations are connected

Return type:

bool

all()[source]#

gives locations within

property cons: list[C]#

Constraints

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

class Material(basis: Unit | None = None, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Resource

Materials are Resources, that are used to set up Operations

Parameters:
  • label (str, optional) – Label of the commodity, used for plotting. Defaults to None.

  • name (str, optional) – Name of the commodity, used for indexing. Defaults to None.

  • basis (Unit, optional) – Unit basis of the commodity. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversions (list[Conversion]) – List of conversions associated with the commodity. Defaults to [].

  • insitu (bool, optional) – If the commodity only exists insitu, i.e., does not scale any domains

property I#

gana index set (I)

property balance: dict[Conversion | Self, int | float]#

Conversion

property cons: list[C]#

Constraints

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

Circumscribing Periods (Temporal Scale)

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

values() an object providing a view on D's values#
class Model(name: str = 'm', init: list[Callable[[Self]]] | None = None, default: bool = True, capacitate: bool = False)[source]#

Bases: object

An abstract representation of an energy system.

Parameters:
  • name (str) – Name of the Model. Defaults to m.

  • init (list[Callable], optional) – List of functions to initialize the Model. Defaults to None.

  • default (bool) – True if some default objects should be declared.

  • capacitate (bool) – True if process capacities should be determined to bound operations.

Variables:
  • added (list[str]) – List of added objects to the Model.

  • update_map (dict) – maps component type to representation and collection.

  • time (Time) – time representation of the Model.

  • space (Space) – spatial representation of the Model.

  • impact (Impact) – impact representation of the Model.

  • tree (Tree) – feasible region (Decision-Making) of the Model.

  • graph (Graph) – Graph (Network) of the Model.

  • system (System) – System (Resource Task Network) of the Model.

  • program (Program) – Mathematical (mixed integer) program of the Model.

  • conversions (list[Conversion]) – List of Balances in the Model.

  • convmatrix (dict[Process, dict[Resource, int | float | list]]) – Conversion matrix of the Model.

  • modes_dict (dict[Bind, Modes]) – Dictionary mapping Bind objects to Modes.

  • cookbook (dict[str, Recipe]) – Recipes to create Aspects.

  • directory (dict[str, dict[str, Recipe]]) – Map of attribute names to recipes for creating them.

  • classifiers (list[Enum]) – List of classifiers for the Model.

  • grb (DefaultDict[Commodity,DefaultDict[Location | Linkage, DefaultDict[Periods, list[Aspect]]]]) – Dictionary which tells you what aspects of resource have GRB {loc: time: []} and {time: loc: []}.

  • dispositions (dict[Aspect, dict[Commodity | Process | Storage | Transport, dict[Location | Linkage, dict[Periods, list[Aspect]]]]]) – Dictionary which tells you what aspects of what component have been bound at what location and time.

  • maps (dict[Aspect, dict[Domain, dict[str, list[Domain]]]]) – Maps of aspects to domains.

  • maps_report (dict[Aspect, dict[Domain, dict[str, list[Domain]]]]) – Maps of aspects to domains for reporting variables.

Siunits_set:

True if SI units have been set.

Raises:

ValueError – If an attribute name already exists in the Model.

name: str = 'm'#
init: list[Callable[[Self]]] | None = None#
default: bool = True#
capacitate: bool = False#
property problem: Problem#

The active problem

property graph: Graph#

The active graph

property program: Program#

The active program

property scenario: Scenario#

The active scenario

property game: Game#

The active game

property horizon: Periods#

Time horizon

property network: Location#

Encompassing Location

property indicators: list[Environ | Social | Economic]#

Impact indicators

property operations: list[Process | Storage | Transport]#

System operations

property aspects: list[Consequence | Stream | Control | State]#

Problem aspects

property domains: list[Domain]#

Problem domains

update(name: str, value: _X, represent: str, collection: str, aspects: list[str] | None = None)[source]#

Update the Model with a new value

Parameters:
  • name (str) – Name of the value to be added

  • value (X) – Value to be added

  • represent (str) – Representation to which the value belongs

  • collection (str) – Collection within the representation to which the value belongs

  • aspects (list[str], optional) – Aspects to be added to the value, defaults to None

Recipe(name: str, kind: Type[Aspect], primary_type: tuple[Type[_Component]] | Type[_Component], label: str = '', latex: str = '', add: str = '', add_latex: str = '', add_kind: Type[Aspect] | None = None, sub: str = '', sub_latex: str = '', sub_kind: Type[Aspect] | None = None, neg: str = '', neg_latex: str = '', neg_label: str = '', bound: str = '', ispos: bool = True, nn: bool = True, use_multiplier: bool = False)[source]#

Creates a Recipe and updates recipes

Parameters:
  • name (str) – Name of the aspect

  • kind (Type[Aspect]) – type of the aspect

  • primary_type (tuple[Type[_Component]] | Type[_Component]) – type of primary component

  • label (str, optional) – label for the aspect. Defaults to ‘’.

  • latex (str, optional) – LaTeX representation for the aspect. Defaults to None.

  • add (str, optional) – add control variable. Defaults to ‘’.

  • add_latex (str, optional) – LaTeX representation for the add aspect. Defaults to ‘’.

  • add_kind (Type[Aspect], optional) – type of the add aspect. Defaults to None.

  • sub (str, optional) – sub control variable. Defaults to ‘’.

  • sub_latex (str, optional) – LaTeX representation for the sub aspect. Defaults to ‘’.

  • sub_kind (Type[Aspect], optional) – type of the sub aspect. Defaults to None.

  • neg (str, optional) – name of the negative aspect. Defaults to ‘’.

  • neg_latex (str, optional) – LaTeX representation for the negative aspect. Defaults to ‘’.

  • neg_label (str, optional) – label for the negative aspect. Defaults to ‘’.

  • bound (str, optional) – name of the bound aspect. Defaults to ‘’.

  • ispos (bool, optional) – whether the aspect is positive. Defaults to True.

  • nn (bool, optional) – whether the aspect is non-negative. Defaults to True.

  • use_multiplier (bool) – Use a scaler (such as distance) for calculations

alias(*names: str, of: str)[source]#

Set aspect aliases

Parameters:
  • names (str) – Names of the aliases

  • to (str) – Name of the aspect to which the aliases point

Instruction(name: str, kind: Type[_Component], deciding: str, depending: str, default: str, label: str = '', latex: str = '')[source]#

Creates an Instruction and updates the manual

Parameters:
  • deciding (str) – Name of the deciding aspect

  • depending (str) – Name of the depending aspect

  • default (str) – Name of the default component

  • label (str, optional) – Label for the parameter. Defaults to ‘’.

  • latex (str, optional) – LaTeX representation for the parameter. Defaults to ‘’.

declare(what: Type[_X], names: list[str])[source]#

Declares objects conveniently

Parameters:
  • what (Type[X]) – Type of object to be created

  • names (list[str]) – Names of the objects to be created

Link two Locations

Parameters:
  • source (Location) – Source Location

  • sink (Location) – Sink Location

  • dist (float | Unit, optional) – Distance between the Locations. Defaults to None.

  • bi (bool, optional) – Whether the linkage is bidirectional. Defaults to False.

TemporalScales(discretizations: list[int], names: list[str])[source]#

This is an easy way to define multiple time periods (scales)

Parameters:
  • discretizations (list[int]) – List of discretizations for the temporal scale.

  • names (list[str], optional) – Names of the discretizations. Defaults to [t<i>] for each discretization.

Modes(size: int, sample: Sample)[source]#

This is an easy way to define modes within a period

Parameters:
  • size (int) – Number of modes to create

  • name (str, optional) – Name of the modes. Defaults to “modes”.

show(descriptive: bool = False, categorical: bool = True, category: str = '')[source]#

Pretty print the Model

Parameters:
  • descriptive (bool, optional) – Whether to show descriptive information. Defaults to False.

  • categorical (bool, optional) – Whether to group by category. Defaults to True.

  • category (str, optional) – If provided, shows only this category. Defaults to None.

draw(variable: Aspect | Sample | None = None, n_sol: int = 0)[source]#

Draw the solution for a variable

Parameters:
  • variable (Aspect | Sample | None, optional) – Variable to draw. Defaults to None.

  • n_sol (int, optional) – Solution number to draw. Defaults to 0.

output(n_sol: int = 0, slack: bool = True, compare: bool = False)[source]#

Solution

locate(*operations: Process | Storage)[source]#

Locate operations in the network

Parameters:

operations (Process | Storage) – Operations to locate

solve(using: Literal['combinatorial', 'combinatorial_parallel', 'combinatorial_parallel_exp', 'graph', 'graph_exp', 'graph_parallel', 'graph_parallel_exp', 'combinatorial_graph', 'geometric', 'geometric_parallel', 'geometric_parallel_exp'] = 'combinatorial')[source]#

Solve the multiparametric program

Parameters:

using (Literal) – The solving method to use. Defaults to “combinatorial”.

eval(*theta_vals: float, n_sol: int = 0, roundoff: int = 4) list[float][source]#

Evaluate the objective function at given theta values

Parameters:
  • theta_vals (float) – values for the parametric variables

  • n_sol (int, optional) – solution number to evaluate, defaults to 0

  • roundoff (int, optional) – number of decimal places to round off to, defaults to 4

Returns:

list of objective function values

Return type:

list[float]

save(as_type: str = 'dill')[source]#

Save the Model to a file

class Periods(size: int | float = 1, of: Self | None = None, n: int | None = None, label: str = '', citations: str = '')[source]#

Bases: _X

A discretization of Time.

Parameters:
  • periods (int | float) – Number of periods in Periods. Defaults to 1.

  • of (Periods | Lag, optional) – The periods of which this is a multiple. Defaults to None.

  • name (str, optional) – Name of the periods. Defaults to None.

  • label (str, optional) – Label of the periods. Defaults to None.

Variables:
  • model (Model) – Model to which the Periods belongs.

  • time (Time) – Time to which the Periods belongs.

  • horizon (Periods) – Horizon of the Time.

  • I (I) – Index set of the Periods.

  • constraints (list[str]) – List of constraints associated with the Periods. Defaults to [].

  • domains (list[Domain]) – List of domains associated with the Periods. Defaults to [].

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the Periods.

isroot()[source]#

Is used to define another period?

ishorizon() bool[source]#

Is this the horizon of the model?

property tree: dict[Self, dict]#

Tree representation of the Periods

property cons: list[C]#

Constraints

property horizon: Self#

Time Horizon

property time: Time[source]#

Time to which the Periods belongs

property I: I[source]#

Index tuple

property i: I[source]#

Only Index

property true_size: float#

True size of the Periods

howmany(of: Periods)[source]#

How many periods make this period

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

class Player(label: str = '', citations: str = '', **kwargs)[source]#

Bases: _Component

Player or Actor, the one taking the decisions based on information provided

Players own certain processes and be responsible for the streams and impact caused by their decisions pertaining to this

Parameters:
  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

property I#

gana index set (I)

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

class Process(*args, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Operation

Process converts one Resource to another Resource at some Location

Parameters:
  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversion (Conversion, optional) – Operational conversion associated with the operation. Defaults to None.

  • _conv (bool) – True if the operational conversion has been set. Defaults to False.

  • fab (Conversion, optional) – Material conversion associated with the operation. Defaults to None.

  • _fab_balanced (bool) – True if the material conversion has been balanced. Defaults to False.

  • locations (list[Location]) – Locations at which the process is balanced. Defaults to [].

  • charges (Storage, optional) – If the Process is Storage charging. Defaults to None.

  • discharges (Storage, optional) – If the Process is Storage discharging. Defaults to None.

property spaces: list[Location]#

Locations at which the process is balanced

property production#

Alias for primary_conversion

property I#

gana index set (I)

property balance: dict[Resource, int | float]#

Conversion of commodities

property basis: Resource#

Base resource

property capacity_aspect: Aspect#

Capacity Aspect

property capacity_sample: Sample#

Capacity Sample

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property lag: Lag#

Lag of the process

locate(*spaces: Location | Linkage)#

Locate the process

property network: Location#

Circumscribing Loc (Spatial Scale)

property operate_aspect: Aspect#

Operate Aspect

property operate_sample: Sample#

Operate Sample

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

write_construction(space_times: list[tuple[Location | Linkage, Periods]])#

write fabrication constraints for the operation

write_primary_conversion(space_times: list[tuple[Location, Periods]])[source]#

Write the production constraints for the process

class Resource(basis: Unit | None = None, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Commodity

A resource, can be a material, chemical, energy, etc.

Parameters:
  • label (str, optional) – Label of the commodity, used for plotting. Defaults to None.

  • name (str, optional) – Name of the commodity, used for indexing. Defaults to None.

  • basis (Unit, optional) – Unit basis of the commodity. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversions (list[Conversion]) – List of conversions associated with the commodity. Defaults to [].

  • insitu (bool, optional) – If the commodity only exists insitu, i.e., does not scale any domains

property I#

gana index set (I)

property balance: dict[Conversion | Self, int | float]#

Conversion

property cons: list[C]#

Constraints

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

Circumscribing Periods (Temporal Scale)

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

values() an object providing a view on D's values#
class Social(label: str = '', citations: str = '', **kwargs)[source]#

Bases: Indicator

Social Impact

Parameters:
  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

property I#

gana index set (I)

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property impact: Impact#

Impact object

property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

class Storage(*args, label: str = '', citations: str = '', **kwargs)[source]#

Bases: _Component

Storage is a container for three main elements: 1. A Stored resource 2. A charge Process that puts the resource into storage 3. A discharge Process that withdraws the resource from storage

Parameters:
  • basis (Unit, optional) – Unit basis of the component. Defaults to None.

  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

  • store (Resource, optional) – The resource to be stored. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • stored (Stored, optional) – The resource being stored. Defaults to None.

  • conversion (Conversion, optional) – Operational conversion associated with the storage. Defaults to None.

  • _conv (bool) – True if the operational conversion has been set. Defaults to False.

  • charge (Process) – The charge process associated with the storage.

  • discharge (Process) – The discharge process associated with the storage.

  • locations (list[Location]) – List of locations where the storage is located. Defaults to [].

property space_times: list[tuple[Location, Periods]][source]#

List of location, time tuples where storage is located

property capacity_aspect: Aspect[source]#

Reports invcapacity as aspect

property inventory_aspect: Aspect[source]#

Reports inventory as aspect

property basis: Resource#

Base resource

property storage_cost: Sample#

Cost of storing the resource

property cons: list[C]#

Constraints

write_construction(space_times: list[tuple[Location, Periods]])[source]#

write fabrication constraints for the operation

locate(*spaces: Location)[source]#

Locate the storage

property I#

gana index set (I)

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

class TemporalScales(discretizations: list[int], names: list[str] | None = None)[source]#

Bases: object

A temporal scale for a model.

Parameters:
  • discretizations (list[int]) – List of discretizations for the temporal scale.

  • names (list[str], optional) – Names of the discretizations. Defaults to [t<i>] for each discretization.

class Transport(*args, label: str = '', citations: str = '', **kwargs)[source]#

Bases: Operation

Exports Resource through Link basically, moves Resources between Locations

Parameters:
  • basis (Unit, optional) – Unit basis of the component. Defaults to None.

  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

Variables:
  • model (Model) – The model to which the component belongs.

  • name (str) – Set when the component is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the component.

  • domains (list[Domain]) – List of domains associated with the component.

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the component with domains.

  • conversion (Conversion, optional) – Operational conversion associated with the operation. Defaults to None.

  • _conv (bool) – True if the operational conversion has been set. Defaults to False.

  • fab (Conversion, optional) – Material conversion associated with the operation. Defaults to None.

  • _fab_balanced (bool) – True if the material conversion has been balanced. Defaults to False.

  • linkages (list[Linkage]) – List of Linkages where the transport is located. Defaults to [].

property transportation#

Alias for primary_conversion

property spaces: list[Linkage]#

Locations at which the process is balanced

property I#

gana index set (I)

property balance: dict[Resource, int | float]#

Conversion of commodities

property basis: Resource#

Base resource

property capacity_aspect: Aspect#

Capacity Aspect

property capacity_sample: Sample#

Capacity Sample

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property lag: Lag#

Lag of the process

locate(*spaces: Location | Linkage)#

Locate the process

property network: Location#

Circumscribing Loc (Spatial Scale)

property operate_aspect: Aspect#

Operate Aspect

property operate_sample: Sample#

Operate Sample

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component

property space: Space#

Space

property time: Time#

Time

write_construction(space_times: list[tuple[Location | Linkage, Periods]])#

write fabrication constraints for the operation

write_primary_conversion(space_times: list[tuple[Location, Periods]])[source]#

Write the production constraints for the process

class Unit(basis: Self | None = None, times: int | float | None = None, label: str = '')[source]#

Bases: _Name

Unit of measure for a quantity provided as input to a component

Parameters:
  • label (str, optional) – Label of the component, used for plotting. Defaults to None.

  • basis (Unit, optional) – Basis of the unit, if defined based on another Unit. Defaults to None.

  • times (int | float, optional) – How many times the basis is contained in the unit. Defaults to None.

Variables:

name (str) – Name of the object. Defaults to ‘’.

howmany(basis: Self)[source]#

How many times is this basis contained in the other basis

Parameters:

basis (Unit) – Basis to compare with.

currencies(model: Model)[source]#

Load default currencies

citation#

Triennial Central Bank Survey: Foreign Exchange Turnover in April 2022. Bank for International Settlements, 27 Oct. 2022, p. 12. Bank for International Settlements, https://www.bis.org/statistics/rpfx22_fx.pdf

env_indicators(model)[source]#

Load default indicators

misc_units(model: Model)[source]#

Miscellaneous units

si_units(model: Model)[source]#

SI units

time_units(model: Model)[source]#

Time units

Modules

components

energia.components module

dimensions

export

Export docs/examples notebooks to .py

library

modeling

represent

environ init file

utils