def populateAllEnergy(self,date, num_hours): alldata = get_real_data.process(date, num_hours) tdelta = timedelta(hours=1) d = date for i in range(len(alldata)): self.timeToEnergy[d] = alldata[i] d = d+tdelta return
def populateEnergy(self,date): alldata = get_real_data.process(date, MAX_HOURS) tdelta = timedelta(hours=1) d = date for i in range(len(alldata)): if not self.timeToEnergy.has_key(d): self.timeToEnergy[d] = alldata[i] d = d+tdelta return