Source code for entsoe_data_manager

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Defines abstract Datamanagers for ENTSO-E
Created on Sat Nov 28 09:30:46 2020

@author: maurer
"""
from datetime import datetime
from typing import List


[docs] class Filter: def __init__(self, begin: datetime, end: datetime, groupby='day'): self.begin = begin self.end = end self.groupby = groupby
[docs] class EntsoeDataManager: ''' Assumptions on the DataManager: index is time series, everything else are values no date and month columns '''
[docs] def capacity(self, country: str): pass
[docs] def load(self, country: str, filt: Filter): pass
[docs] def generation(self, country: str, filt: Filter): pass
[docs] def crossborderFlows(self, country: str, filt: Filter): pass
[docs] def countries(self): pass
[docs] def climateImpact(self): pass
[docs] class EntsoePlantDataManager: ''' Assumptions on the PlantDataManager: index is time series, everything else are values '''
[docs] def plantGen(self, names: List[str], filt: Filter): ''' generation data per power plant ''' pass
[docs] def getNames(self): ''' returns a dataframe with all power plant names ''' pass
[docs] def capacityPerPlant(self, country=''): ''' returns capacities for all plants of a country or all if country is empty ''' pass
[docs] def powersystems(self, country=''): ''' returns location data and capacities of power plants ''' pass
[docs] def revReplaceStr(string): ''' replaces series names for better visualization ''' st = str.replace(string, 'sum(', '') st = str.replace(st, ')', '') st = str.replace(st, '(', '') st = str.replace(st, '_', ' ') st = st.strip() return st