Skip to content

Commit

Permalink
Fixed bug with datetime inside production and exchange for CZ parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Lee authored and Scott Lee committed Oct 11, 2016
1 parent 5d0a95e commit ec3b216
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions feeder/parsers/CZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def fetch_CZ():
'biomass': data['AltPP [MW]'],
'unknown': data['ApPP [MW]'],
'oil': 0,
'datetime': arrow.get(data['Date'], "DD.MM.YYYY HH:mm").replace(
tzinfo=dateutil.tz.gettz(TIME_ZONE)).datetime
}
obj['productionDatetime'] = arrow.get(data['Date'], "DD.MM.YYYY HH:mm").replace(
tzinfo=dateutil.tz.gettz(TIME_ZONE)).datetime

# Fetch exchanges
url = ('http://www.ceps.cz/_layouts/15/Ceps/_Pages/GraphData.aspx?mode=txt&' +
Expand All @@ -42,13 +42,13 @@ def fetch_CZ():
data = pd.read_csv(StringIO(requests.get(url).text), sep=';', header=2).iloc[-1]

obj['exchange'] = {
'datetime': arrow.get(data['Date'], "DD.MM.YYYY HH:mm").replace(
tzinfo=dateutil.tz.gettz(TIME_ZONE)).datetime,
'PL': data['PSE Actual [MW]'],
'SK': data['SEPS Actual [MW]'],
'AT': data['APG Actual [MW]'],
'DE': data['TenneT Actual [MW]'] + data['50HzT Actual [MW]']
}
obj['exchangeDatetime'] = arrow.get(data['Date'], "DD.MM.YYYY HH:mm").replace(
tzinfo=dateutil.tz.gettz(TIME_ZONE)).datetime

return obj

Expand Down

0 comments on commit ec3b216

Please sign in to comment.