Dataset adapters

The general idea behind dataset adapters is to abstract loading of datasets into the general appliance framework. This notebook will show some common ways of using them.


In [1]:
import sys
sys.path.append('../../')

import disaggregator as dis

An example of how to initialize a database adapter pecan street.


In [2]:
db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres"
ps_adapter = dis.PecanStreetDatasetAdapter(db_url)

Grab all unique dataids for a particular month


In [3]:
dataids = ps_adapter.get_unique_dataids("curated",1,2013,1)

In [4]:
dataids[0]


Out[4]:
5949

Get month-long traces for a home


In [5]:
traces = ps_adapter.get_month_traces("curated",2013,1,5949,group=1,sampling_rate="15T")

In [6]:
traces[0]


Out[6]:
<disaggregator.ApplianceTrace.ApplianceTrace at 0x112086110>

In [10]:
traces[0].get_series().name


Out[10]:
u'air1'

In [ ]: