correct retrofit results to apply costs and co2 to all scenariosa

This commit is contained in:
Guille Gutierrez 2023-08-03 12:38:19 -04:00
parent b06a1d3d53
commit b96617bb21

View File

@ -38,8 +38,8 @@ class RetrofitResults(Resource, Config):
return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token) return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token)
# deserialize the response to return pure json # deserialize the response to return pure json
scenario = next(iter(results))
for scenario in results:
for building_results in results[scenario]: for building_results in results[scenario]:
values = [] values = []
building_info = self.database.building(building_results['building'], user_id, application_id, scenario) building_info = self.database.building(building_results['building'], user_id, application_id, scenario)
@ -97,6 +97,5 @@ class RetrofitResults(Resource, Config):
'subsidies_pv': global_capital_incomes['Subsidies PV'].tolist() 'subsidies_pv': global_capital_incomes['Subsidies PV'].tolist()
} }
} }
print(operational_co2)
building_results['operational_co2'] = operational_co2 building_results['operational_co2'] = operational_co2
return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token) return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token)