def parse(self): data = self.data[0] if not data or 'values' not in data: raise NoData bd = data['beginDate'] ed = data['endDate'] dates = fill_date_range(bd, ed, date_format='%Y-%m-%d %H:%M:%S') vals = as_list(data['values']) flags = as_list(data['flags']) self.data = [{ 'date': date, 'value': val, 'flag': flag } for date, val, flag in zip(dates, vals, flags)]
def load(self): super(HourlyDataIO, self).load() if self.data and 'values' in self.data[0]: self.data = [ asdict(row) for row in as_list(self.data[0]['values']) ] else: raise NoData
def load(self): if self.debug: self.print_debug() params = self.params fn = getattr(server, self.data_function) self.data = simplify(fn(**params)) if self.data == {}: self.data = [] else: self.data = as_list(self.data)
def load(self): super(HourlyDataIO, self).load() d = { } # since mutiple triplets can be used, then go through each station for data in self.data: stationTriplet = data['stationTriplet'] if data and 'values' in data: data = [asdict(row) for row in as_list(data['values'])] else: data = [] d[stationTriplet] = data self.data = d
def load(self): if self.debug: self.print_debug() params = self.params fn = getattr(get_server(), self.data_function) self.data = fn(**params) if len(self.data) == 0: self.data = [] else: self.data = as_list(self.data) if isinstance(self.data[0], SudsObject): parse = asdict else: parse = str self.data = [parse(row) for row in self.data]
def load(self): super(HourlyDataIO, self).load() if self.data and 'values' in self.data[0]: self.data = as_list(self.data[0]['values']) else: raise NoData