diff --git a/model_data/Property.py b/backend/Property.py similarity index 100% rename from model_data/Property.py rename to backend/Property.py diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index aa8655bf..4934042e 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -3,7 +3,7 @@ from backend.app.dependencies import validate_token from backend.app.plan.schemas import PlanTriggerRequest from backend.app.utils import read_csv_from_s3 from backend.app.config import get_settings -from model_data.Property import Property +from backend.Property import Property from epc_api.client import EpcClient from utils.logger import setup_logger from recommendations.FloorRecommendations import FloorRecommendations diff --git a/model_data/tests/test_property.py b/backend/tests/test_property.py similarity index 100% rename from model_data/tests/test_property.py rename to backend/tests/test_property.py diff --git a/model_data/requirements/requirements.txt b/model_data/requirements/requirements.txt index 1bc54bc7..28fce331 100644 --- a/model_data/requirements/requirements.txt +++ b/model_data/requirements/requirements.txt @@ -18,4 +18,3 @@ statsmodels scikit-learn pyspellchecker textblob -xgboost diff --git a/model_data/requirements/static.txt b/model_data/requirements/static.txt index 95a6a6dd..55b449c1 100644 --- a/model_data/requirements/static.txt +++ b/model_data/requirements/static.txt @@ -1,3 +1,2 @@ -xgboost statsmodels scikit-learn diff --git a/recommendations/FloorRecommendations.py b/recommendations/FloorRecommendations.py index afdea35f..2cf90c0f 100644 --- a/recommendations/FloorRecommendations.py +++ b/recommendations/FloorRecommendations.py @@ -1,7 +1,7 @@ import math from typing import List from model_data.BaseUtility import BaseUtility -from model_data.Property import Property +from backend.Property import Property from model_data.rdsap_tables import default_wall_thickness, age_band_data from recommendations.recommendation_utils import ( r_value_per_mm_to_u_value, calculate_u_value_uplift, is_diminishing_returns, update_lowest_selected_u_value, diff --git a/recommendations/WallRecommendations.py b/recommendations/WallRecommendations.py index f729fc82..35a5b022 100644 --- a/recommendations/WallRecommendations.py +++ b/recommendations/WallRecommendations.py @@ -1,7 +1,7 @@ import itertools import math -from model_data.Property import Property +from backend.Property import Property from model_data.BaseUtility import BaseUtility from recommendations.recommendation_utils import ( r_value_per_mm_to_u_value, calculate_u_value_uplift, is_diminishing_returns, update_lowest_selected_u_value, diff --git a/recommendations/recommendation_utils.py b/recommendations/recommendation_utils.py index 9d09a13a..ae906194 100644 --- a/recommendations/recommendation_utils.py +++ b/recommendations/recommendation_utils.py @@ -1,5 +1,5 @@ from copy import deepcopy -from model_data.Property import Property +from backend.Property import Property from statistics import mean diff --git a/recommendations/tests/test_data/input_properties.pkl b/recommendations/tests/test_data/input_properties.pkl index 09aa1dc9..d21b89c2 100644 Binary files a/recommendations/tests/test_data/input_properties.pkl and b/recommendations/tests/test_data/input_properties.pkl differ diff --git a/recommendations/tests/test_floor_recommendations.py b/recommendations/tests/test_floor_recommendations.py index 8e265acc..ac9c7380 100644 --- a/recommendations/tests/test_floor_recommendations.py +++ b/recommendations/tests/test_floor_recommendations.py @@ -5,6 +5,17 @@ from unittest.mock import Mock from recommendations.FloorRecommendations import FloorRecommendations +# with open( +# os.path.abspath(os.path.dirname(__file__)) + "/recommendations/tests/test_data/input_properties.pkl", "rb" +# ) as f: +# input_properties = pickle.load(f) +# +# with open( +# os.path.abspath(os.path.dirname(__file__)) + "/recommendations/tests/test_data/uvalue_estimates.pkl", "rb" +# ) as f: +# uvalue_estimates = pickle.load(f) + + class TestWallRecommendations: @pytest.fixture @@ -106,7 +117,7 @@ class TestWallRecommendations: recommender.recommend() assert not recommender.property.floor["is_suspended"] assert recommender.property.floor["is_solid"] - assert recommender.estimated_u_value == 0.7361642182695053 + assert recommender.estimated_u_value == 0.7528014214215474 assert recommender.recommendations types = {part["type"] for x in recommender.recommendations for part in x["parts"]} diff --git a/recommendations/tests/test_wall_recommendations.py b/recommendations/tests/test_wall_recommendations.py index 2aa751cb..c053de03 100644 --- a/recommendations/tests/test_wall_recommendations.py +++ b/recommendations/tests/test_wall_recommendations.py @@ -7,7 +7,7 @@ import numpy as np from unittest.mock import Mock, MagicMock from recommendations.WallRecommendations import WallRecommendations from model_data.analysis.UvalueEstimations import UvalueEstimations -from model_data.Property import Property +from backend.Property import Property from recommendations.recommendation_utils import is_diminishing_returns