Added coercing of u-value columns to numeric

This commit is contained in:
Khalim Conn-Kowlessar 2023-09-23 15:02:14 +01:00
parent 87e7cce075
commit 210b79242d
2 changed files with 7 additions and 3 deletions

View file

@ -511,6 +511,11 @@ class DataProcessor:
differenced the ending subtract the starting value, which is useful for modelling the difference responces
"""
# We ensure that the u value columns are co-erced to a numerical format
uvalue_columns = [col for col in df.columns if "thermal_transmittance" in col]
for uvalue_col in uvalue_columns:
df[uvalue_col] = pd.to_numeric(df[uvalue_col])
columns = {
x for x in df.columns if x not in FIXED_FEATURES + FIXED_DESCRIPTON_MAPPED_FEATURES + [
"RDSAP_CHANGE", "HEAT_DEMAND_CHANGE", "CARBON_CHANGE", "SAP_STARTING", "HEAT_DEMAND_STARTING",

View file

@ -18,7 +18,7 @@ from model_data.simulation_system.core.DataProcessor import DataProcessor
from utils.s3 import save_dataframe_to_s3_parquet, read_from_s3, read_dataframe_from_s3_parquet
from recommendations.rdsap_tables import england_wales_age_band_lookup
from recommendations.recommendation_utils import (
get_wall_u_value, get_roof_u_value, get_floor_u_value, estimate_perimeter_2_rooms, estimate_perimeter,
get_wall_u_value, get_roof_u_value, get_floor_u_value, estimate_perimeter,
get_wall_type
)
@ -292,8 +292,7 @@ def make_uvalues(df):
floor_area = x[f"TOTAL_FLOOR_AREA{suffix}"]
n_rooms = x["NUMBER_HABITABLE_ROOMS"]
perimeters[f"estimated_perimeter{suffix}"] = estimate_perimeter_2_rooms(floor_area) if n_rooms <= 2 else \
estimate_perimeter(floor_area, n_rooms)
perimeters[f"estimated_perimeter{suffix}"] = estimate_perimeter(floor_area, n_rooms)
floor_type = "suspended" if x["is_suspended"] else "solid"
wall_type = get_wall_type(**x)