From 8cfd6ebe823712fccc080672f93af0ebfae7a1e1 Mon Sep 17 00:00:00 2001 From: Guille Date: Thu, 18 Apr 2024 07:32:32 +0200 Subject: [PATCH] Bug fix --- hub_api/mockup/building.py | 4 +--- hub_api/persistence/retrofit_results.py | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hub_api/mockup/building.py b/hub_api/mockup/building.py index c9e685e..7ffb112 100644 --- a/hub_api/mockup/building.py +++ b/hub_api/mockup/building.py @@ -10,7 +10,6 @@ from hub.helpers.dictionaries import Dictionaries from hub_api.mockup.properties import * -import pandas as pd class Building: @@ -214,14 +213,13 @@ class Building: :return: [EnergySystem] """ _energy_systems = [] - for system in self._catalog_archetype.systems: _hub_demand_types = [] for demand_type in system.demand_types: # todo: generalize this when we have more catalogs _hub_demand_types.append(Dictionaries().montreal_demand_type_to_hub_energy_demand_type[demand_type]) demands = _hub_demand_types - fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[system.generation_system.fuel_type] + fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[system.generation_systems[0].fuel_type] generic_generation_system = GenericGenerationSystem() generic_generation_system.fuel_type = fuel_type generation_system = GenerationSystem() diff --git a/hub_api/persistence/retrofit_results.py b/hub_api/persistence/retrofit_results.py index 11be93a..2a3990b 100644 --- a/hub_api/persistence/retrofit_results.py +++ b/hub_api/persistence/retrofit_results.py @@ -97,9 +97,7 @@ class RetrofitResults(Resource, Config): payload = request.get_json() if 'scenarios' not in payload: return Response(json.dumps({'error': 'Bad request'}), status=400, headers=token) - start = datetime.datetime.now() results = self.database.results(user_id, application_id, payload) - print(f'{datetime.datetime.now()- start}') if results == {}: # no data found for the given parameters return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token) @@ -117,5 +115,4 @@ class RetrofitResults(Resource, Config): f.start() for f in t: f.join() - print(f'retrieve calculations {datetime.datetime.now() - start}') return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token)