diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index 1e2c1e6f..1b0dd267 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -741,6 +741,9 @@ async def build_mds(body: PlanTriggerRequest): for p in tqdm(input_properties): p.get_components(cleaned, photo_supply_lookup, floor_area_decile_thresholds) + # [{'external_wall_insulation': 'EWI (Trad Const)'}, {'loft_insulation': 'LI'}, {'air_source_heat_pump': + # 'ASHP Htg'}, {'solar_pv': 'Solar PV'}] + # p.measures = [{'external_wall_insulation': 'EWI (Trad Const)'}] mds = Mds(property_instance=p, materials=materials) property_representative_recommendations, errors = mds.build() @@ -788,6 +791,15 @@ async def build_mds(body: PlanTriggerRequest): all_predictions[key] = pd.concat([all_predictions[key], scored]) # We now produce a table of results for the mds report + from utils.s3 import read_dataframe_from_s3_parquet + z = read_dataframe_from_s3_parquet( + bucket_name="retrofit-data-dev", + file_key="sap_change_model/2024-05-28-19-08-25/dataset_rooms.parquet" + ) + + # TODO: 1) walls_insulation_thickness_ending is not being set in the recommendations_scoring_data, + # insulation_thickness_ending is being set instead + # 2) # TODO: TEMP for p in plan_input: diff --git a/etl/property_valuation/scrape_valuations.py b/etl/property_valuation/scrape_valuations.py index 67713a4e..434168ca 100644 --- a/etl/property_valuation/scrape_valuations.py +++ b/etl/property_valuation/scrape_valuations.py @@ -78,6 +78,11 @@ def app(): savepoint = pd.DataFrame(result) savepoint.to_csv(f"savepoint_index_{i}.csv", index=False) + # TODO: Testing Jina AI - didn't work but maybe one of the alternatives might work: + # https://www.youtube.com/watch?v=QxHE4af5BQE + response = requests.get("https://r.jina.ai/https://www.zoopla.co.uk/property/uprn/41222761/") + response.text + if __name__ == "__main__": app() diff --git a/recommendations/WallRecommendations.py b/recommendations/WallRecommendations.py index 5c890823..b2ad4e5d 100644 --- a/recommendations/WallRecommendations.py +++ b/recommendations/WallRecommendations.py @@ -102,7 +102,7 @@ class WallRecommendations(Definitions): part for part in materials if part["type"] - in ["iwi_wall_demolition", "iwi_vapour_barrier", "iwi_redecoration"] + in ["iwi_wall_demolition", "iwi_vapour_barrier", "iwi_redecoration"] ] self.external_wall_insulation_materials = [ @@ -113,7 +113,7 @@ class WallRecommendations(Definitions): part for part in materials if part["type"] - in ["ewi_wall_demolition", "ewi_wall_preparation", "ewi_wall_redecoration"] + in ["ewi_wall_demolition", "ewi_wall_preparation", "ewi_wall_redecoration"] ] @property diff --git a/recommendations/recommendation_utils.py b/recommendations/recommendation_utils.py index 996f5c9c..07a861dc 100644 --- a/recommendations/recommendation_utils.py +++ b/recommendations/recommendation_utils.py @@ -756,17 +756,23 @@ def calculate_cavity_age(newest_epc, older_epcs, cleaned): return cavity_age -def check_simulation_difference(old_config, new_config, prefix=""): +def check_simulation_difference(old_config, new_config, prefix="", keys_with_prefix=None): """ Given two dictionaries, that describe the heating control configurations, this method will compare the two and pick out the differences. These differences will be things that have been added and things that have been removed. This will be used to determine how we should be updating the configuration in the simulation :return: """ + + keys_with_prefix = ( + ["is_assumed", "thermal_transmittance", "insulation_thickness"] if keys_with_prefix is None + else keys_with_prefix + ) + differences = {} for key in new_config: if old_config[key] != new_config[key]: - new_key = prefix + key + "_ending" if key in ["is_assumed", "thermal_transmittance"] else key + "_ending" + new_key = prefix + key + "_ending" if key in keys_with_prefix else key + "_ending" differences[new_key] = new_config[key] return differences