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.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.jsonfile_start_snapshot (int) – Start point of calculation from
scenario_setting.jsonfile_end_snapshot (int) – End point of calculation from
scenario_setting.jsonfile_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

- 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_costsby given capital costs and lifetime.- Parameters:
json_file (:obj:dict) – Dictionary of the
scenario_setting.jsonfile_start_snapshot (int) – Start point of calculation from
scenario_setting.jsonfile_end_snapshot (int) – End point of calculation from
scenario_setting.jsonfile_p (numeric) – interest rate of investment
_T (int) – lifetime of investment
- Returns:
overnight_cost – Scenario and calculation total
overnight_costsby given annuity capital costs and lifetime.- Return type:
numeric
Examples

- 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 byetrago.appl.etrago()- Returns:
operating_costs – DataFrame with aggregate operational costs per component and voltage level in [EUR] per calculated time steps.
- Return type:
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 byetrago.appl.etrago()json_file (:obj:dict) – Dictionary of the
scenario_setting.jsonfile
- Returns:
grid_investment_costs – Dataframe with
voltage_level,number_of_expansionandcapital_costper calculated time steps- Return type:
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.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:
network (
NetworkScenario) – eTraGoNetworkScenariobased on PyPSA Network. See also pypsa.networkscn_name (str) – Name of used scenario
- Returns:
generator – Result of generator as DataFrame in
ego.etrago.generator- Return type:
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
NetworkScenariobased on PyPSA Network. See also pypsa.network- Returns:
results – Summarize and returns a
DataFrameof the storage optimaziation.- Return type:
Notes
The
resultsdataframe 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
NetworkScenariobased 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
loggerobject of packagelogging- 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.
- 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.