restructured app to move property to backend

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-21 17:32:06 +01:00
parent 3e5d6cc4b4
commit 39f954a088
11 changed files with 17 additions and 8 deletions

View file

@ -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

View file

@ -18,4 +18,3 @@ statsmodels
scikit-learn
pyspellchecker
textblob
xgboost

View file

@ -1,3 +1,2 @@
xgboost
statsmodels
scikit-learn

View file

@ -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,

View file

@ -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,

View file

@ -1,5 +1,5 @@
from copy import deepcopy
from model_data.Property import Property
from backend.Property import Property
from statistics import mean

View file

@ -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"]}

View file

@ -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