ego.tools package

ego.tools.economics

This module collects useful functions for economic calculation of eGo which can mainly distinguished in operational and investment costs.

ego.tools.economics.annuity_per_period(capex, n, wacc, t, p)[source]

Calculate per given period

Parameters:
  • capex (float) – Capital expenditure (NPV of investment)

  • n (int) – Number of years that the investment is used (economic lifetime)

  • wacc (float) – Weighted average cost of capital

  • t (int) – Timesteps in hours

  • p (float) – interest rate

ego.tools.economics.edisgo_convert_capital_costs(overnight_cost, t, p, json_file)[source]

Get scenario and calculation specific annuity cost by given capital costs and lifetime.

Parameters:
  • json_file (:obj:dict) – Dictionary of the scenario_setting.json file

  • _start_snapshot (int) – Start point of calculation from scenario_setting.json file

  • _end_snapshot (int) – End point of calculation from scenario_setting.json file

  • _p (numeric) – interest rate of investment

  • _t (int) – lifetime of investment

Returns:

annuity_cost – Scenario and calculation specific annuity cost by given capital costs and lifetime

Return type:

numeric

Examples

PVA =   (1 / p) - (1 / (p*(1 + p)^t))

ego.tools.economics.etrago_convert_overnight_cost(annuity_cost, json_file, t=40, p=0.05)[source]

Get annuity cost of simulation and calculation total overnight_costs by given capital costs and lifetime.

Parameters:
  • json_file (:obj:dict) – Dictionary of the scenario_setting.json file

  • _start_snapshot (int) – Start point of calculation from scenario_setting.json file

  • _end_snapshot (int) – End point of calculation from scenario_setting.json file

  • _p (numeric) – interest rate of investment

  • _T (int) – lifetime of investment

Returns:

overnight_cost – Scenario and calculation total overnight_costs by given annuity capital costs and lifetime.

Return type:

numeric

Examples

PVA =   (1 / p) - (1 / (p*(1 + p)^t))

K_{ON} = K_a*PVA*((t/(period+1))

ego.tools.economics.etrago_operating_costs(network)[source]

Function to get all operating costs of eTraGo.

Parameters:

network_etrago (etrago.tools.io.NetworkScenario) – eTraGo network object compiled by etrago.appl.etrago()

Returns:

operating_costs – DataFrame with aggregate operational costs per component and voltage level in [EUR] per calculated time steps.

Return type:

pandas.Dataframe

Example

>>> from ego.tools.io import eGo
>>> ego = eGo(jsonpath='scenario_setting.json')
>>> ego.etrago.operating_costs

component

operation_costs

voltage_level

biomass

27.0

ehv

line losses

0.0

ehv

wind_onshore

0.0

ehv

ego.tools.economics.etrago_grid_investment(network, json_file, session)[source]

Function to get grid expantion costs from eTraGo

Parameters:
  • network_etrago (etrago.tools.io.NetworkScenario) – eTraGo network object compiled by etrago.appl.etrago()

  • json_file (:obj:dict) – Dictionary of the scenario_setting.json file

Returns:

grid_investment_costs – Dataframe with voltage_level, number_of_expansion and capital_cost per calculated time steps

Return type:

pandas.Dataframe

Example

>>> from ego.tools.io import eGo
>>> ego = eGo(jsonpath='scenario_setting.json')
>>> ego.etrago.grid_investment_costs

differentiation

voltage_level

number_of_expansion

capital_cost

cross-border

ehv

27.0

31514.1305

domestic

hv

0.0

0.0

ego.tools.economics.edisgo_grid_investment(edisgo, json_file)[source]

Function aggregates all costs, based on all calculated eDisGo grids and their weightings :param edisgo: Contains multiple eDisGo networks :type edisgo: ego.tools.edisgo_integration.EDisGoNetworks

Returns:

Dataframe containing annuity costs per voltage level

Return type:

None or pandas.DataFrame

ego.tools.economics.get_generator_investment(network, scn_name)[source]

Get investment costs per carrier/ generator.

ego.tools.edisgo_integration

ego.tools.io

ego.tools.mv_cluster

ego.tools.plots

ego.tools.results

This module include the results functions for analyze and creating results based on eTraGo or eDisGo for eGo.

ego.tools.results.create_etrago_results(network, scn_name)[source]

Create eTraGo results

Parameters:
Returns:

generator – Result of generator as DataFrame in ego.etrago.generator

Return type:

pandas.DataFrame

ego.tools.specs

ego.tools.storages

This module contains functions for storage units.

ego.tools.storages.etrago_storages(network)[source]

Sum up the pysical storage values of the total scenario based on eTraGo results.

Parameters:

network (etrago.tools.io.NetworkScenario) –

eTraGo NetworkScenario based on PyPSA Network. See also pypsa.network

Returns:

results – Summarize and returns a DataFrame of the storage optimaziation.

Return type:

pandas.DataFrame

Notes

The results dataframe incluedes following parameters:

chargenumeric

Quantity of charged energy in MWh over scenario time steps

dischargenumeric

Quantity of discharged energy in MWh over scenario time steps

countint

Number of storage units

p_nom_o_sum: numeric

Sum of optimal installed power capacity

ego.tools.storages.etrago_storages_investment(network, json_file, session)[source]

Calculate storage investment costs of eTraGo

Parameters:

network (etrago.tools.io.NetworkScenario) –

eTraGo NetworkScenario based on PyPSA Network. See also pypsa.network

Returns:

storage_costs – Storage costs of selected snapshots in [EUR]

Return type:

numeric

ego.tools.utilities

This module contains utility functions for the eGo application.

ego.tools.utilities.define_logging(name)[source]

Helps to log your modeling process with eGo and defines all settings.

Parameters:

log_name (str) – Name of log file. Default: ego.log.

Returns:

logger – Set up logger object of package logging

Return type:

logging.basicConfig.

ego.tools.utilities.get_scenario_setting(jsonpath=None)[source]

Get and open json file with scenaio settings of eGo. The settings incluede eGo, eTraGo and eDisGo specific settings of arguments and parameters for a reproducible calculation.

Parameters:

json_file (str) – Default: scenario_setting.json Name of scenario setting json file

Returns:

json_file – Dictionary of json file

Return type:

dict

ego.tools.utilities.fix_leading_separator(csv_file, **kwargs)[source]

Takes the path to a csv-file. If the first line of this file has a leading separator in its header, this field is deleted. If this is done the second field of every row is removed, too.

ego.tools.utilities.get_time_steps(json_file)[source]

Get time step of calculation by scenario settings.

Parameters:

json_file (dict) – Dictionary of the scenario_setting.json file

Returns:

time_step – Number of timesteps of the calculation.

Return type:

int

ego.tools.utilities.open_oedb_session(ego)[source]