diff --git a/edisgo/config/config_data_default.cfg b/edisgo/config/config_data_default.cfg new file mode 100644 index 000000000..4f5d6f285 --- /dev/null +++ b/edisgo/config/config_data_default.cfg @@ -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 diff --git a/edisgo/config/config_db_tables_default.cfg b/edisgo/config/config_db_tables_default.cfg index 82a5da15d..ed09a669c 100644 --- a/edisgo/config/config_db_tables_default.cfg +++ b/edisgo/config/config_db_tables_default.cfg @@ -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 diff --git a/edisgo/config/config_scenario_default.cfg b/edisgo/config/config_scenario_default.cfg new file mode 100644 index 000000000..4821ca4dc --- /dev/null +++ b/edisgo/config/config_scenario_default.cfg @@ -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 diff --git a/edisgo/grid/network.py b/edisgo/grid/network.py index a6e9567c9..262b03bf4 100644 --- a/edisgo/grid/network.py +++ b/edisgo/grid/network.py @@ -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 @@ -12,10 +13,6 @@ class Network: ---------- _id : :obj:`str` Name of network - _equipment_data : :obj:`dict` of :pandas:`pandas.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` @@ -23,19 +20,50 @@ class Network: 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` + 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` + """ + + raise NotImplementedError + @classmethod def import_from_dingo(cls, file): """Import grid data from DINGO file