remove prints

This commit is contained in:
Guille Gutierrez 2024-06-14 06:11:57 +02:00
parent 73641f985e
commit ce18c72fe3
2 changed files with 1 additions and 6 deletions

View File

@ -22,7 +22,6 @@ class IdfGenerator(Resource, Config):
""" """
API call generate the IDF file for the input data API call generate the IDF file for the input data
""" """
start = datetime.datetime.now()
session_id = request.headers.get('session-id', None) session_id = request.headers.get('session-id', None)
token = request.headers.get('token', None) token = request.headers.get('token', None)
application_uuid = request.headers.get('application-uuid', None) application_uuid = request.headers.get('application-uuid', None)
@ -42,7 +41,7 @@ class IdfGenerator(Resource, Config):
payload = request.get_json() payload = request.get_json()
for key, value in payload.items(): for key, value in payload.items():
db_city = self.database.get_city(self.database.building(value, user_id, application_id, key).city_id) db_city = self.database.get_city(self.database.building(value, user_id, application_id, key).city_id)
print(f'{datetime.datetime.now() - start}')
if version != db_city.hub_release: if version != db_city.hub_release:
return Response(json.dumps({ return Response(json.dumps({
'error': 'The selected building belongs to an old hub release and cannot be loaded.' 'error': 'The selected building belongs to an old hub release and cannot be loaded.'

View File

@ -84,7 +84,6 @@ class RetrofitResults(Resource, Config):
API call for requesting a specified list of enriched persistence API call for requesting a specified list of enriched persistence
""" """
# todo: cost and co2 libraries are using default canadians values, in the future need to be optionally API configurable # todo: cost and co2 libraries are using default canadians values, in the future need to be optionally API configurable
start = datetime.datetime.now()
session_id = request.headers.get('session-id', None) session_id = request.headers.get('session-id', None)
if session_id == "deece4fa-6809-42b1-a4e6-36e9f3c6edc2": if session_id == "deece4fa-6809-42b1-a4e6-36e9f3c6edc2":
return Response(json.dumps(dic), status=200) return Response(json.dumps(dic), status=200)
@ -105,8 +104,6 @@ class RetrofitResults(Resource, Config):
# no data found for the given parameters # no data found for the given parameters
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
print(f'session {datetime.datetime.now() - start}')
start = datetime.datetime.now()
t = [] t = []
for scenario in results: for scenario in results:
scenario_id = self._scenario_ids[scenario] scenario_id = self._scenario_ids[scenario]
@ -119,5 +116,4 @@ class RetrofitResults(Resource, Config):
f.start() f.start()
for f in t: for f in t:
f.join() f.join()
print(f'calculated {datetime.datetime.now() - start}')
return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token) return Response(json.dumps({'result': 'succeed', 'results': results}), status=200, headers=token)