mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
pruning rep recs so we don't have heating and heating contols as representatives separately
This commit is contained in:
parent
40b89f7cb8
commit
1aee76dac1
2 changed files with 15 additions and 2 deletions
|
|
@ -377,7 +377,9 @@ class Property:
|
|||
x["type"] != "internal_wall_insulation"
|
||||
]
|
||||
else:
|
||||
epc_transformations = [x["description_simulation"] for x in represenative_recs_to_this_phase]
|
||||
epc_transformations = [
|
||||
x["description_simulation"] for x in represenative_recs_to_this_phase
|
||||
]
|
||||
|
||||
# It is possible that we could have two simulations applied to the same descriptions
|
||||
# We extract these out
|
||||
|
|
@ -407,7 +409,8 @@ class Property:
|
|||
continue
|
||||
|
||||
raise NotImplementedError(
|
||||
"Already have this key in the phase_epc_transformation - implement me")
|
||||
"Already have this key in the phase_epc_transformation - implement me"
|
||||
)
|
||||
phase_epc_transformation[k] = v
|
||||
|
||||
simulation_epc = self.epc_record.prepared_epc.copy()
|
||||
|
|
|
|||
|
|
@ -230,6 +230,16 @@ class Recommendations:
|
|||
# When check if these recommendations have two different types, such as solid wall insulation
|
||||
# If we have multiple types, we group by type and then select the best recommendation for each type
|
||||
|
||||
# If we have a heating and heating control recommendation, we use JUST the heating reommendation
|
||||
has_both_heating_types = all(
|
||||
x in [rec["type"] for rec in recommendations_by_type] for x in ["heating", "heating_control"]
|
||||
)
|
||||
if has_both_heating_types:
|
||||
# Take just heating
|
||||
recommendations_by_type = [
|
||||
rec for rec in recommendations_by_type if rec["type"] == "heating"
|
||||
]
|
||||
|
||||
recommendations_by_type = sorted(recommendations_by_type, key=lambda x: x["type"])
|
||||
representative_recommendations = []
|
||||
for _type, recommendations in groupby(recommendations_by_type, key=lambda x: x["type"]):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue