From 1fdbdbad076c6fcfed161d5547641f95055e8f61 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 13 Sep 2023 15:54:41 +0100 Subject: [PATCH] simplying router for recommendation engine wip --- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- backend/app/plan/router.py | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.idea/Model.iml b/.idea/Model.iml index b03b31b1..05b9012b 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ca0e1cd9..3b05c6ac 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index d120a552..e383d665 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -209,26 +209,21 @@ async def trigger_plan(body: PlanTriggerRequest): if not input_properties: return Response(status_code=204) - logger.info("Getting EPC data") + logger.info("Getting EPC, coordinates and conservation area data") for p in input_properties: p.search_address_epc() p.set_year_built() - logger.info("Getting coordinates") - # This is placeholder, until the full dataset is loaded into the database - for p in input_properties: coordinate_data = [x for x in open_uprn_data if x['UPRN'] == int(p.data['uprn'])][0] p.set_coordinates(coordinate_data) - logger.info("Check if property is in conservation area") - for p in input_properties: in_conservation_area = [x for x in in_conservation_area_data if x['uprn'] == int(p.data['uprn'])][0].get( "is_in_conservation_area" ) p.set_is_in_conservation_area(in_conservation_area) # The materials data could be cached or local so we don't need to make - # consistent requrests to the backend for + # consistent requests to the backend for # the same data # TODO: It might not be the best choice to store the materials data in a database table since thi # table probably won't be very large and won't be updated that often. It might be better to