mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
addressing Dan's feedback
This commit is contained in:
parent
73928c67c5
commit
694717bd34
1 changed files with 10 additions and 6 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue