mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +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(
|
||||
property_measure_types: Set[str],
|
||||
measures_needing_ventilation: List[str],
|
||||
has_ventilation: bool,
|
||||
ventilation_included: bool
|
||||
property_already_has_ventilation: bool,
|
||||
ventilation_in_included_measures: bool
|
||||
) -> bool:
|
||||
"""
|
||||
Function to check if we need to include ventilation based on the measures selected and the property
|
||||
features
|
||||
: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 has_ventilation: Whether the property currently has ventilation
|
||||
:param ventilation_included: Whether ventilation is already included in the recommended measures
|
||||
:param property_already_has_ventilation: Whether the property currently has ventilation
|
||||
: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
|
||||
|
||||
# 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
|
||||
"""
|
||||
return any(
|
||||
|
||||
needs_ventilation = any(
|
||||
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