Pass session to getTemps
This commit is contained in:
parent
2ec63cc0e3
commit
c55ab31671
2 changed files with 8 additions and 7 deletions
|
@ -3,9 +3,13 @@ import numpy
|
||||||
from .models import DB
|
from .models import DB
|
||||||
|
|
||||||
|
|
||||||
def getTemps(datasets, community_id, minyear, maxyear):
|
def getTemps(session):
|
||||||
model, scenario = datasets.split(',')
|
model, scenario = session['datasets'].split(',')
|
||||||
data = DB.getTemps(minyear, maxyear, community_id, model, scenario)
|
data = DB.getTemps(session['minyear'],
|
||||||
|
session['maxyear'],
|
||||||
|
session['community_data']['id'],
|
||||||
|
model,
|
||||||
|
scenario)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,7 @@ def index():
|
||||||
|
|
||||||
session['ds_name'] = session['datasets'].split(',')
|
session['ds_name'] = session['datasets'].split(',')
|
||||||
|
|
||||||
temps_arr = getTemps(session['datasets'],
|
temps_arr = getTemps(session)
|
||||||
community_id,
|
|
||||||
session['minyear'],
|
|
||||||
session['maxyear'])
|
|
||||||
|
|
||||||
session['avg_temp'] = avg_air_temp(temps_arr)
|
session['avg_temp'] = avg_air_temp(temps_arr)
|
||||||
indices = ann_air_indices(temps_arr)
|
indices = ann_air_indices(temps_arr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue