Skip to content

Commit

Permalink
return DF with random layer result data #38
Browse files Browse the repository at this point in the history
used by new result layer serial view GeoJSONResultLayerData
  • Loading branch information
nesnoj committed Jun 12, 2019
1 parent 90f6469 commit eae0882
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions results/results.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from stemp_abw.visualizations import highcharts
from stemp_abw.models import Scenario
from stemp_abw.models import Scenario, RegMun
from stemp_abw.results.io import oemof_json_to_results
from stemp_abw.app_settings import NODE_LABELS, SIMULATION_CFG as SIM_CFG

from oemof.outputlib import views

import pandas as pd
from numpy.random import uniform


class Results(object):
Expand Down Expand Up @@ -185,7 +186,26 @@ def get_result_charts_data(self):

def get_layer_results(self):
"""Analyze results and return data for layer display"""
pass

results = pd.DataFrame(list(
RegMun.objects \
.values_list('ags', named=True)))

columns = ['energy_re_el_dem_share_result',
'gen_energy_re_result',
'gen_energy_re_density_result',
'gen_cap_re_result',
'gen_cap_re_density_result',
'gen_count_wind_density_result',
'dem_el_energy_result',
'dem_el_energy_per_capita_result']

for c in columns:
results[c] = [round(_,1) for _ in uniform(low=0, high=100, size=20)]

results.set_index('ags', inplace=True)

return results

def aggregate_flow_results(self, nodes_from, nodes_to, results_raw,
resample_mode='A', agg_mode='sum'):
Expand Down

0 comments on commit eae0882

Please sign in to comment.