addressing Dan's feedback

This commit is contained in:
Khalim Conn-Kowlessar 2026-02-23 14:14:07 +00:00
parent 73928c67c5
commit 694717bd34

View file

@ -403,21 +403,25 @@ def flatten_recommendations_with_defaults(property_id, recommendations, selected
def check_needs_ventilation( def check_needs_ventilation(
property_measure_types: Set[str], property_measure_types: Set[str],
measures_needing_ventilation: List[str], measures_needing_ventilation: List[str],
has_ventilation: bool, property_already_has_ventilation: bool,
ventilation_included: bool ventilation_in_included_measures: bool
) -> bool: ) -> bool:
""" """
Function to check if we need to include ventilation based on the measures selected and the property Function to check if we need to include ventilation based on the measures selected and the property
features features
:param property_measure_types: The set of measure types recommended for the property :param property_measure_types: The set of measure types recommended for the property
:param measures_needing_ventilation: The set of measure types that require ventilation :param measures_needing_ventilation: The set of measure types that require ventilation
:param has_ventilation: Whether the property currently has ventilation :param property_already_has_ventilation: Whether the property currently has ventilation
:param ventilation_included: Whether ventilation is already included in the recommended measures :param ventilation_in_included_measures: Whether ventilation is already included in the recommended
measures
:return: Boolean indicating whether ventilation needs to be included in the recommendations :return: Boolean indicating whether ventilation needs to be included in the recommendations
# TODO - none of the inputs of this function are well structured and so this is quite brittle - we should # TODO - none of the inputs of this function are well structured and so this is quite brittle - we should
consider refactoring to make this more robust consider refactoring to make this more robust
""" """
return any(
needs_ventilation = any(
x in property_measure_types for x in measures_needing_ventilation x in property_measure_types for x in measures_needing_ventilation
) and not has_ventilation and ventilation_included )
return needs_ventilation and not has_ventilation and ventilation_included