From 3a864c6c21627a43b81667bd893e6f2003e96b3a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 19 Sep 2023 11:20:54 +0100 Subject: [PATCH] Added the drop columns for roof --- .../generate_rdsap_change.py | 21 ++++++++----------- .../simulation_system/test_data_generation.py | 5 ++--- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/model_data/simulation_system/generate_rdsap_change.py b/model_data/simulation_system/generate_rdsap_change.py index 50ccaee6..73d98d48 100644 --- a/model_data/simulation_system/generate_rdsap_change.py +++ b/model_data/simulation_system/generate_rdsap_change.py @@ -51,6 +51,8 @@ def process_and_prune_desriptions(df, cleaned_lookup): # TODO: In a future iteration, we can test using the binary features and the insulation thickness # estimates, we well as estimated U-values + # TODO: If we integrate u values, we can probably remove insulation thickness + cols_to_drop = { "walls": [ 'original_description', 'clean_description', 'thermal_transmittance_unit', @@ -73,20 +75,15 @@ def process_and_prune_desriptions(df, cleaned_lookup): "is_assumed_ENDING" ], "roof": [ - 'original_description', 'thermal_transmittance', - 'thermal_transmittance_unit', 'is_pitched', 'is_roof_room', 'is_loft', - 'is_flat', 'is_thatched', 'is_at_rafters', 'is_assumed', - 'has_dwelling_above', 'is_valid', 'insulation_thickness', - 'original_description_ENDING', - 'thermal_transmittance_ENDING', 'thermal_transmittance_unit_ENDING', - 'is_pitched_ENDING', 'is_roof_room_ENDING', 'is_loft_ENDING', - 'is_flat_ENDING', 'is_thatched_ENDING', 'is_at_rafters_ENDING', - 'is_assumed_ENDING', 'has_dwelling_above_ENDING', 'is_valid_ENDING', - 'insulation_thickness_ENDING', + "original_description", "clean_description", "thermal_transmittance_unit", + "is_assumed", "is_valid", "original_description_ENDING", "clean_description_ENDING", + "thermal_transmittance_unit_ENDING", "is_pitched_ENDING", "is_roof_room_ENDING", + "is_loft_ENDING", "is_flat_ENDING", "is_thatched_ENDING", "is_at_rafters_ENDING", + "has_dwelling_above_ENDING", "is_assumed_ENDING", "is_valid_ENDING" ] } - for component in ["walls", "floor", "roof"]: + for component in ["walls", "floor", "roof", "hotwater"]: component_upper = component.upper() df = df.merge( @@ -120,7 +117,7 @@ def process_and_prune_desriptions(df, cleaned_lookup): (df["is_to_unheated_space"] == df["is_to_unheated_space_ENDING"]) & (df["is_to_external_air"] == df["is_to_external_air_ENDING"]) ] - else: + elif component == "roof": df = df[ (df["is_pitched"] == df["is_pitched_ENDING"]) & (df["is_roof_room"] == df["is_roof_room_ENDING"]) & diff --git a/model_data/simulation_system/test_data_generation.py b/model_data/simulation_system/test_data_generation.py index 8d1dbf2b..8989d491 100644 --- a/model_data/simulation_system/test_data_generation.py +++ b/model_data/simulation_system/test_data_generation.py @@ -1,8 +1,8 @@ -from core.Logger import logger +from model_data.simulation_system.core.Logger import logger import argparse import pandas as pd from pathlib import Path -from core.Settings import RANDOM_SEED, TRAIN_AND_VALIDATION_DATA_NAME, TEST_DATA_NAME +from model_data.simulation_system.core.Settings import RANDOM_SEED, TRAIN_AND_VALIDATION_DATA_NAME, TEST_DATA_NAME def ingest_arguments() -> argparse.Namespace: @@ -96,7 +96,6 @@ def main( if __name__ == "__main__": - logger.info("--- Generate test data pipeline ---") args = ingest_arguments()