|
|
|
@ -109,7 +109,7 @@ def parallel_daily(): |
|
|
|
|
myxs = {} |
|
|
|
|
|
|
|
|
|
for data_point in res_all: |
|
|
|
|
point_id = ':'.join(data_point[3:6]) |
|
|
|
|
point_id = ':'.join(format(y, '02d') for y in data_point[3:6]) |
|
|
|
|
myxs[point_id] = 'pos1' |
|
|
|
|
data_point = [point_id, *data_point[6:]] |
|
|
|
|
sample.append(data_point) |
|
|
|
@ -221,7 +221,7 @@ def parallel_monthly(): |
|
|
|
|
myxs = {} |
|
|
|
|
# group by day; take first of each group |
|
|
|
|
for data_point in res_all: |
|
|
|
|
point_id = '-'.join(data_point[:3]) |
|
|
|
|
point_id = '-'.join(format(y, '02d') for y in data_point[:3]) |
|
|
|
|
myxs[point_id] = 'pos1' |
|
|
|
|
data_point = [point_id, *data_point[6:]] |
|
|
|
|
sample.append(data_point) |
|
|
|
@ -296,8 +296,8 @@ def grid_yearly(): |
|
|
|
|
res_all = cur.fetchall() |
|
|
|
|
|
|
|
|
|
out = [] |
|
|
|
|
out.append(['-'.join(x[:3]) for x in res_all]) |
|
|
|
|
out.append([':'.join(x[3:6]) for x in res_all]) |
|
|
|
|
out.append(['-'.join(format(y, '02d') for y in x[:3]) for x in res_all]) |
|
|
|
|
out.append([':'.join(format(y, '02d') for y in x[3:6]) for x in res_all]) |
|
|
|
|
out.append([x[6] for x in res_all]) |
|
|
|
|
|
|
|
|
|
return out |
|
|
|
@ -331,8 +331,8 @@ def grid_monthly(): |
|
|
|
|
res_all = cur.fetchall() |
|
|
|
|
|
|
|
|
|
out = [] |
|
|
|
|
out.append(['-'.join(x[:3]) for x in res_all]) |
|
|
|
|
out.append([':'.join(x[3:6]) for x in res_all]) |
|
|
|
|
out.append(['-'.join(format(y, '02d') for y in x[:3]) for x in res_all]) |
|
|
|
|
out.append([':'.join(format(y, '02d') for y in x[3:6]) for x in res_all]) |
|
|
|
|
out.append([x[6] for x in res_all]) |
|
|
|
|
|
|
|
|
|
return out |
|
|
|
@ -376,8 +376,8 @@ def grid_weekly(): |
|
|
|
|
res_all = cur.fetchall() |
|
|
|
|
|
|
|
|
|
out = [] |
|
|
|
|
out.append(['-'.join(x[:3]) for x in res_all]) |
|
|
|
|
out.append([':'.join(x[3:6]) for x in res_all]) |
|
|
|
|
out.append(['-'.join(format(y, '02d') for y in x[:3]) for x in res_all]) |
|
|
|
|
out.append([':'.join(format(y, '02d') for y in x[3:6]) for x in res_all]) |
|
|
|
|
out.append([x[6] for x in res_all]) |
|
|
|
|
|
|
|
|
|
return out |
|
|
|
@ -423,8 +423,8 @@ def horizon_yearly(): |
|
|
|
|
for i, sensor_name in enumerate(out['sensor_names']): |
|
|
|
|
sensor_data_sorted = sorted(aux_data[sensor_name]) |
|
|
|
|
if i == 0: |
|
|
|
|
out['days'] = ['-'.join(x[:3]) for x in sensor_data_sorted] |
|
|
|
|
out['times'] = [':'.join(x[3:6]) for x in sensor_data_sorted] |
|
|
|
|
out['days'] = ['-'.join(format(y, '02d') for y in x[:3]) for x in sensor_data_sorted] |
|
|
|
|
out['times'] = [':'.join(format(y, '02d') for y in x[3:6]) for x in sensor_data_sorted] |
|
|
|
|
out[sensor_name] = [x[6] for x in sensor_data_sorted] |
|
|
|
|
|
|
|
|
|
return out |
|
|
|
@ -465,8 +465,8 @@ def horizon_monthly(): |
|
|
|
|
# Important: this only works assuming that res_all is correctly sorted |
|
|
|
|
|
|
|
|
|
for row in res_all: |
|
|
|
|
out['days'].append('-'.join(row[:3])) |
|
|
|
|
out['times'].append(':'.join(row[3:6])) |
|
|
|
|
out['days'].append('-'.join(format(y, '02d') for y in row[:3])) |
|
|
|
|
out['times'].append(':'.join(format(y, '02d') for y in row[3:6])) |
|
|
|
|
for i in range(6, len(row)): |
|
|
|
|
out[out['sensor_names'][i-6]].append(row[i]) |
|
|
|
|
|
|
|
|
@ -511,8 +511,8 @@ def horizon_weekly(): |
|
|
|
|
# Important: this only works assuming that res_all is correctly sorted |
|
|
|
|
|
|
|
|
|
for row in res_all: |
|
|
|
|
out['days'].append('-'.join(row[:3])) |
|
|
|
|
out['times'].append(':'.join(row[3:6])) |
|
|
|
|
out['days'].append('-'.join(format(y, '02d') for y in row[:3])) |
|
|
|
|
out['times'].append(':'.join(format(y, '02d') for y in row[3:6])) |
|
|
|
|
for i in range(6, len(row)): |
|
|
|
|
out[out['sensor_names'][i-6]].append(row[i]) |
|
|
|
|
|
|
|
|
@ -552,8 +552,8 @@ def horizon_daily(): |
|
|
|
|
# Important: this only works assuming that res_all is correctly sorted |
|
|
|
|
|
|
|
|
|
for row in res_all: |
|
|
|
|
out['days'].append('-'.join(row[:3])) |
|
|
|
|
out['times'].append(':'.join(row[3:6])) |
|
|
|
|
out['days'].append('-'.join(format(y, '02d') for y in row[:3])) |
|
|
|
|
out['times'].append(':'.join(format(y, '02d') for y in row[3:6])) |
|
|
|
|
for i in range(6, len(row)): |
|
|
|
|
out[out['sensor_names'][i-6]].append(row[i]) |
|
|
|
|
|
|
|
|
|