olivancu / electricity-cost-calculator

This project aims to provide a tool for calculating the electricity bill based on a specific tariff. An example is given for various Californian Utilities tariff, retrieved from the OpenEI API
8 stars 2 forks source link

running the code fails #5

Closed moustafa-a closed 5 years ago

moustafa-a commented 5 years ago

Wed Mar 27 15:00:01 PDT 2019 Saw [xbos/mdal] MDAL 3 seconds 329.753 ms ago Traceback (most recent call last): File "/home/moustafa/go/src/openADR/electricity-cost-calculator/oadr_signal/getDRSignal.py", line 222, in prices = getHourlyDayPrices(startDateTime=st, tariff_name=tariff, isItEventDay=isItAnEventDay) File "/home/moustafa/go/src/openADR/electricity-cost-calculator/oadr_signal/getDRSignal.py", line 82, in getHourlyDayPrices tariff_struct_from_openei_data(tariff_openei_data, bill_calc, pdp_event_filenames='PDP_events.json') File "/home/moustafa/go/src/openADR/electricity-cost-calculator/openei_tariff/openei_tariff_analyzer.py", line 312, in tariff_struct_from_openei_data pdp_dates = datetime.strptime(pdp_event['start_date'], '%Y-%m-%dT%H:%M:%S').replace(tzinfo=pytz.timezone('UTC')), datetime.strptime( File "/usr/lib/python2.7/_strptime.py", line 335, in _strptime data_string[found.end():]) ValueError: unconverted data remains: -08:00

moustafa-a commented 5 years ago

[{"utility_id": 17609, "start_date": "2018-09-28T00:00:00-08:00", "end_date": "2018-09-28T23:59:59-08:00"}, {"utility_id": 17609, "start_date": "2018-10-18T00:00:00-08:00", "end_date": "2018-10-18T23:59:59-08:00"}, {"utility_id": 14328, "start_date": "1969-12-31T00:00:00-08:00", "end_date": "1969-12-31T23:59:59-08:00"}, {"utility_id": 90, "start_date": "1969-12-31T00:00:00-08:00", "end_date": "1969-12-31T23:59:59-08:00"}]

olivancu commented 5 years ago

Referring to commit https://github.com/olivancu/electricity-cost-calculator/commit/f2721516d801b5c437391281dfdadfbafd0040ae I had removed the timezone in the PDP event dates. I solved the issue by using a parser to read the dates, so now you can keep the PDP format you presented above and it should work.

anandkp92 commented 5 years ago

@moustafa-a can you do a git pull origin oadr and let us know if your issue has been fixed?

moustafa-a commented 5 years ago

Yes, I don't get an exception anymore. However the generated prices are still zero.

olivancu commented 5 years ago

@moustafa-a could you tell us under which tariff you get only zeros? @anandkp92 this is maybe because we haven't updated A-10 & others for 2019

moustafa-a commented 5 years ago

It is PGE A-10 (demand and energy). All the others seem to have values