Partial completion for costs and co2 emitions

This commit is contained in:
Guille Gutierrez 2023-07-31 14:48:17 -04:00
parent 98a60fa0a1
commit bc377bc1fb
2 changed files with 21 additions and 35 deletions

View File

@ -12,40 +12,23 @@ class Building:
""" """
Building class Building class
""" """
def __init__(self, def __init__(self, building_info, catalog_archetype):
function, self._function = building_info.function
volume, self._area = building_info.area
area, self._volume = building_info.volume
total_heating_area, self._total_heating_area = building_info.total_heating_area
wall_area, self._wall_area = building_info.wall_area
windows_area, self._windows_area = building_info.windows_area
roof_area, self._roof_area = building_info.roof_area
solar_collectors_area_reduction_factor, self._solar_collectors_area_reduction_factor = building_info.total_pv_area
heating_consumption, self._heating_consumption = building_info.heating_consumption
cooling_consumption, self._cooling_consumption = building_info.cooling_consumption
domestic_hot_water_consumption, self._domestic_hot_water_consumption = building_info.domestic_hot_water_consumption
lighting_electrical_demand, self._lighting_electrical_demand = building_info.lighting_electrical_demand
appliances_electrical_demand, self._appliances_electrical_demand = building_info.appliances_electrical_demand
heating_peak_load, self._heating_peak_load = building_info.heating_peak_load
cooling_peak_load, self._cooling_peak_load = building_info.cooling_peak_load
onsite_electrical_production, self._onsite_electrical_production = building_info.onsite_electrical_production
catalog_archetype):
self._function = function
self._area = area
self._volume = volume
self._total_heating_area = total_heating_area
self._wall_area = wall_area
self._windows_area = windows_area
self._roof_area = roof_area
self._solar_collectors_area_reduction_factor = solar_collectors_area_reduction_factor
self._heating_consumption = heating_consumption
self._cooling_consumption = cooling_consumption
self._domestic_hot_water_consumption = domestic_hot_water_consumption
self._lighting_electrical_demand = lighting_electrical_demand
self._appliances_electrical_demand = appliances_electrical_demand
self._heating_peak_load = heating_peak_load
self._cooling_peak_load = cooling_peak_load
self._onsite_electrical_production = onsite_electrical_production
self._catalog_archetype = catalog_archetype self._catalog_archetype = catalog_archetype
@property @property

View File

@ -5,6 +5,7 @@ from flask_restful import Resource
from hub_api.config import Config from hub_api.config import Config
from hub_api.helpers.session_helper import session, refresh_session from hub_api.helpers.session_helper import session, refresh_session
from hub_api.mockup.building import Building
class RetrofitResults(Resource, Config): class RetrofitResults(Resource, Config):
@ -40,8 +41,10 @@ class RetrofitResults(Resource, Config):
buildings.append(name) buildings.append(name)
for building in buildings: for building in buildings:
building_info = self.database.building(building, user_id, application_id, scenario_name) building_info = self.database.building(building, user_id, application_id, scenario_name)
self.energy_systems_catalog.get_entry(building_info.system_name) archetype = self.energy_systems_catalog.get_entry(building_info.system_name)
buildings_info.append(building_info) buildings_info.append(building_info)
buildings.append(Building(building_info, archetype))
results = self.database.results(user_id, application_id, payload) results = self.database.results(user_id, application_id, payload)
if results == {}: if results == {}:
# no data found for the given parameters # no data found for the given parameters