Skip to content

Commit

Permalink
OMerge branch 'features/#25-dir-and-config' into features/#21-import-…
Browse files Browse the repository at this point in the history
…connect-genos
  • Loading branch information
nesnoj committed Aug 28, 2017
2 parents e8585c2 + 5c6265c commit 04bec93
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 11 deletions.
11 changes: 11 additions & 0 deletions edisgo/config/config_data_default.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file is part of eDisGo, a python package for distribution grid
# analysis and optimization.
#
# It is developed in the project open_eGo: https://openegoproject.wordpress.com
#
# eDisGo lives at github: https://github.com/openego/edisgo/
# The documentation is available on RTD: http://edisgo.readthedocs.io

[data]

data_source = oedb
18 changes: 14 additions & 4 deletions edisgo/config/config_db_tables_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ data_source = model_draft

[model_draft]

conv_generators_nep2035 = t_ego_supply_conv_powerplant_nep2035_mview
conv_generators_ego100 = ego_supply_conv_powerplant_ego100_mview
re_generators_nep2035 = t_ego_supply_res_powerplant_nep2035_mview
re_generators_ego100 = t_ego_supply_res_powerplant_ego100_mview
conv_generators_prefix = t_ego_supply_conv_powerplant_
conv_generators_suffix = _mview
re_generators_prefix = t_ego_supply_res_powerplant_
re_generators_suffix = _mview

#conv_generators_nep2035 = t_ego_supply_conv_powerplant_nep2035_mview
#conv_generators_ego100 = ego_supply_conv_powerplant_ego100_mview
#re_generators_nep2035 = t_ego_supply_res_powerplant_nep2035_mview
#re_generators_ego100 = t_ego_supply_res_powerplant_ego100_mview

[versioned]

conv_generators_prefix = t_ego_supply_conv_powerplant_
conv_generators_suffix = _mview
re_generators_prefix = t_ego_supply_res_powerplant_
re_generators_suffix = _mview

version = 0.2.10
12 changes: 12 additions & 0 deletions edisgo/config/config_scenario_default.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of eDisGo, a python package for distribution grid
# analysis and optimization.
#
# It is developed in the project open_eGo: https://openegoproject.wordpress.com
#
# eDisGo lives at github: https://github.com/openego/edisgo/
# The documentation is available on RTD: http://edisgo.readthedocs.io

[scenario]

name = nep2035
#name = ego100
42 changes: 35 additions & 7 deletions edisgo/grid/network.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from edisgo.data.import_data import import_from_dingo
from edisgo.tools import config
from edisgo.data.import_data import import_from_dingo, import_generators
import pandas as pd


Expand All @@ -12,30 +13,57 @@ class Network:
----------
_id : :obj:`str`
Name of network
_equipment_data : :obj:`dict` of :pandas:`pandas.DataFrame<dataframe>`
Electrical equipment such as lines and transformers
_config : ???
#TODO: TBD
_metadata : :obj:`dict`
Metadata of Network such as ?
_data_sources : :obj:`dict` of :obj:`str`
Data Sources of grid, generators etc.
Keys: 'grid', 'generators', ?
_scenario : :class:`~.grid.grids.Scenario`
Scenario which is used for calculations
_config :
#TODO: TBD
_equipment_data : :obj:`dict` of :pandas:`pandas.DataFrame<dataframe>`
Electrical equipment such as lines and transformers
# TODO: Add remaining attributes
"""

def __init__(self, **kwargs):
self._id = kwargs.get('id', None)
self._equipment_data = kwargs.get('equipment_data', None)
self._config = kwargs.get('config', None)
self._metadata = kwargs.get('metadata', None)
self._data_sources = kwargs.get('data_sources', {})
self._scenario = kwargs.get('scenario', None)
self._mv_grid = kwargs.get('mv_grid', None)
self.results = Results()

self._config = self._load_config()
self._equipment_data = self._load_equipment_data()

@staticmethod
def _load_config():
"""Load config files
Returns
-------
config object
"""

config.load_config('config_db_tables.cfg')
config.load_config('config_data.cfg')
config.load_config('config_scenario.cfg')

return config.cfg.sections()

@staticmethod
def _load_equipment_data():
"""Load equipment data for transformers, cables etc.
Returns
-------
:obj:`dict` of :pandas:`pandas.DataFrame<dataframe>`
"""

raise NotImplementedError

@classmethod
def import_from_dingo(cls, file):
"""Import grid data from DINGO file
Expand Down

0 comments on commit 04bec93

Please sign in to comment.