import sys
sys.path.append('.')

import disaggregator as da

db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres"                                                                                         
ps_adapter = da.PecanStreetDatasetAdapter(db_url)

dataids = ps_adapter.get_unique_dataids("curated",1,2013,group=1)
traces = ps_adapter.get_month_traces("curated",2013,1,dataids[-1],group=1)

print [float(t.get_total_usage()) for t in traces]

@@ -52,16 +52,62 @@
 or as da
+%0Afrom pandas.tseries.offsets import DateOffset
 %0A%0Adb_url
@@ -457,16 +457,269 @@
 oup=1)%0A%0A
+shift = traces%5B0%5D.series.size%0Aprint shift%0Atraces%5B1%5D.series.index = traces%5B1%5D.series.index + DateOffset(months=1,days=1)%0Aprint traces%5B0%5D.series%0Aprint traces%5B0%5D.series.index%5B-1%5D - traces%5B0%5D.series.index%5B0%5D + traces%5B0%5D.series.index%0Aprint traces%5B1%5D.series%0A#
 print %5Bf

update ac existence