diff --git a/backend/Property.py b/backend/Property.py index 6336e42d..ce21bd52 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -858,6 +858,14 @@ class Property: self.floor_level = 1 return + def is_mid_floor_flat(self): + """ + Simple utility function to check if the property is a mid-floor flat + :return: + """ + + return self.data["property-type"] == "Flat" and self.epc_record.original_epc["floor-level"] == "mid floor" + def set_wall_type(self): """ This method sets the wall type of the property, using a simple approach based on the wall description diff --git a/recommendations/Mds.py b/recommendations/Mds.py index c30cb231..638b6ca8 100644 --- a/recommendations/Mds.py +++ b/recommendations/Mds.py @@ -145,9 +145,7 @@ class Mds: if ( self.property_instance.roof["is_pitched"] and not self.roof_recommender.is_loft_already_insulated() - ): - self.property_instance.data - + ) or self.property_instance.is_mid_floor_flat(): pruned_measures.append(measure) continue @@ -156,7 +154,7 @@ class Mds: if ( self.property_instance.floor["is_solid"] and self.property_instance.floor["insulation_thickness"] not in ["average", "above average"] - ): + ) or self.property_instance.is_mid_floor_flat(): pruned_measures.append(measure) continue @@ -165,7 +163,7 @@ class Mds: if ( self.property_instance.floor["is_suspended"] and self.property_instance.floor["insulation_thickness"] not in ["average", "above average"] - ): + ) or self.property_instance.is_mid_floor_flat(): pruned_measures.append(measure) continue