Ejemplo n.º 1
0
print '''You can now get trace information per house. You can also see the
trace of a particular appliance. However this is the point where you are
informed that "seeing" is actually a step that comes after pickling. Do you want to pickle a house? If not you will be asked shortly to pickle a type? Enter yes or no'''
boo = raw_input()
if str(boo) == 'yes':

    #house = raw_input('Enter a home id\n')
    #appliance = raw_input('Enter an appliance name (this is not actually necessary at\this point):')

    #query = 'select * from {0}.{1} where dataid={2}'.format(schema_names[schema], month,house)
    #df = p.get_dataframe(query).fillna(0)
    #   temp = p.clean_dataframe(df,schema,[])
    #   test = p.get_month_traces_per_dataid(schema,month,house)

    print 'you now have a bunch of appliance traces, one trace for each appliance in a house'
    print 'here is some information about the first trace '

elif str(boo) == 'no':
    print 'ok what appliance do you want?'
    app = str(raw_input())
    print 'this step takes quite a while'
    pecan.set_url(db_url)
    dataids = pecan.get_dataids_with_real_values(schema, month, app)

    type = pecan.generate_traces_for_appliance_by_dataids(
        schema, month, app, dataids)
    utils.pickle_object(type, '{}_{}'.format(app, month))

else:
    print 'what was that?'
Ejemplo n.º 2
0
    #house = raw_input('Enter a home id\n')
    #appliance = raw_input('Enter an appliance name (this is not actually necessary at\this point):')

    #query = 'select * from {0}.{1} where dataid={2}'.format(schema_names[schema], month,house)
    #df = p.get_dataframe(query).fillna(0)
    #   temp = p.clean_dataframe(df,schema,[])
    #   test = p.get_month_traces_per_dataid(schema,month,house)

    print 'you now have a bunch of appliance traces, one trace for each appliance in a house'
    print 'here is some information about the first trace '


elif str(boo)=='no':
    print 'ok what appliance do you want?'
    app = str(raw_input())
    print 'this step takes quite a while'
    pecan.set_url(db_url)
    dataids = pecan.get_dataids_with_real_values(schema,month,app)

    type = pecan.generate_traces_for_appliance_by_dataids(schema, month,app,dataids)
    utils.pickle_object(type, '{}_{}'.format(app,month))

else:
    print 'what was that?'





Ejemplo n.º 3
0
    trace = opdsa.generate_trace_by_dataid(homes, home)

    print_permission = raw_input("Would you like to see it? Enter yes or no\n")

    if print_permission == 'yes':
        print trace
    pickle_thing = trace
    pickle_name = str(home)

elif reply == "set":
    print "You can see any month in 2013, and any month up to July in 2014."
    year = raw_input("Please enter 2014 or 2013\n")
    month = raw_input("Please enter a number one through twelve\n")
    print "Ok hold on"
    app_set = opdsa.generate_set_by_year_month(homes, int(year), int(month))
    pickle_thing = app_set
    pickle_name = '{}_{}'.format(str(year), str(month))
else:
    print "HEY! I said trace or set dum dum"

pickle_permission = raw_input(
    "Would you like a pickle with that? Enter yes or no\n")

if pickle_permission == 'yes':
    utils.pickle_object(pickle_thing, pickle_name)
else:
    print "Okie Doke, thanks for coming!"

#print trace.resample('MS').series
Ejemplo n.º 4
0
    trace = opdsa.generate_trace_by_dataid(homes,home)

    print_permission = raw_input("Would you like to see it? Enter yes or no\n")

    if print_permission=='yes':
        print trace
    pickle_thing=trace
    pickle_name = str(home)

elif reply=="set":
    print "You can see any month in 2013, and any month up to July in 2014."
    year = raw_input("Please enter 2014 or 2013\n")
    month = raw_input("Please enter a number one through twelve\n")
    print "Ok hold on"
    app_set = opdsa.generate_set_by_year_month(homes,int(year),int(month))
    pickle_thing=app_set
    pickle_name = '{}_{}'.format(str(year),str(month))
else:
    print "HEY! I said trace or set dum dum"

pickle_permission = raw_input("Would you like a pickle with that? Enter yes or no\n")

if pickle_permission=='yes':
    utils.pickle_object(pickle_thing,pickle_name)
else:
    print "Okie Doke, thanks for coming!"

#print trace.resample('MS').series