Skip to content

Commit

Permalink
Fix New Zealand parser issues due to upgrade to arrow (electricitymap…
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhughgriffin authored and con-cat committed May 18, 2021
1 parent 917e61f commit 80417d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parsers/NZ.py
Expand Up @@ -58,7 +58,7 @@ def fetch_production(zone_key=None, session=None, target_datetime=None, logger=N

obj = fetch(session)

datetime = arrow.get(obj['soPgenGraph']['timestamp']).datetime
datetime = arrow.get(obj['soPgenGraph']['timestamp'],"X").datetime

if zone_key == 'NZ-NZN':
region_key = 'North Island'
Expand Down Expand Up @@ -118,7 +118,7 @@ def fetch_exchange(zone_key1='NZ-NZN', zone_key2='NZ-NZS', session=None, target_
datetime_start = arrow.now().to(timezone).floor('day')
data = []
for item in obj['data']['mw_north']:
datetime = datetime_start.replace(minutes=+item[0])
datetime = datetime_start.shift(minutes=+item[0])
if datetime > arrow.get() or item[1] is None:
continue
netFlow = item[1]
Expand Down

0 comments on commit 80417d7

Please sign in to comment.