debugging wood chips fuel types

This commit is contained in:
Khalim Conn-Kowlessar 2025-11-28 06:47:57 +00:00
parent cfc7f2a247
commit c400a67bf6
4 changed files with 33 additions and 28 deletions

View file

@ -86,6 +86,8 @@ DESCRIPTIONS_TO_FUEL_TYPES = {
"cop": AVERAGE_ASHP_EFFICIENCY / 100}, "cop": AVERAGE_ASHP_EFFICIENCY / 100},
"Ground source heat pump, underfloor, electric": {"fuel": "Electricity", "cop": AVERAGE_ASHP_EFFICIENCY / 100}, "Ground source heat pump, underfloor, electric": {"fuel": "Electricity", "cop": AVERAGE_ASHP_EFFICIENCY / 100},
"Electric ceiling heating": {"fuel": "Electricity", "cop": 1}, "Electric ceiling heating": {"fuel": "Electricity", "cop": 1},
"Boiler and radiators, wood chips": {"fuel": "Wood Logs", "cop": 0.85},
"Oil range cooker, no cylinder thermostat": {"fuel": "Oil", "cop": 0.85},
} }
# These are the measure types where if there is a ventilation recommendation, we force the inclusion of it # These are the measure types where if there is a ventilation recommendation, we force the inclusion of it

View file

@ -394,12 +394,13 @@ class TrainingDataset(BaseDataset):
axis=1, axis=1,
) )
roof_starting_uvalue = self.df["roof_thermal_transmittance"].fillna( roof_starting_uvalue = pd.to_numeric(
roof_starting_uvalue self.df["roof_thermal_transmittance"], errors="coerce"
) ).fillna(roof_starting_uvalue)
roof_ending_uvalue = self.df["roof_thermal_transmittance_ending"].fillna(
roof_ending_uvalue roof_ending_uvalue = pd.to_numeric(
) self.df["roof_thermal_transmittance_ending"], errors="coerce"
).fillna(roof_ending_uvalue)
# ~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~
# Floor # Floor
@ -459,20 +460,20 @@ class TrainingDataset(BaseDataset):
axis=1, axis=1,
) )
floor_starting_uvalue = self.df["floor_thermal_transmittance"].fillna( floor_starting_uvalue = pd.to_numeric(
floor_starting_uvalue self.df["floor_thermal_transmittance"], errors="coerce"
) ).fillna(floor_starting_uvalue)
floor_ending_uvalue = self.df["floor_thermal_transmittance_ending"].fillna( floor_ending_uvalue = pd.to_numeric(
floor_ending_uvalue self.df["floor_thermal_transmittance_ending"], errors="coerce"
) ).fillna(floor_ending_uvalue)
for component in ["walls", "roof", "floor"]: for component in ["walls", "roof", "floor"]:
self.df[f"{component}_thermal_transmittance"] = self.df[ self.df[f"{component}_thermal_transmittance"] = pd.to_numeric(
f"{component}_thermal_transmittance" self.df[f"{component}_thermal_transmittance"], errors="coerce"
].fillna(eval(f"{component}_starting_uvalue")) ).fillna(eval(f"{component}_starting_uvalue"))
self.df[f"{component}_thermal_transmittance_ending"] = self.df[ self.df[f"{component}_thermal_transmittance_ending"] = pd.to_numeric(
f"{component}_thermal_transmittance_ending" self.df[f"{component}_thermal_transmittance_ending"], errors="coerce"
].fillna(eval(f"{component}_ending_uvalue")) ).fillna(eval(f"{component}_ending_uvalue"))
self.df = self.df.drop( self.df = self.df.drop(
columns=[ columns=[

View file

@ -38,6 +38,8 @@ DATA_BUCKET = os.environ.get(
"DATA_BUCKET", "retrofit-data-dev" if ENVIRONMENT == "dev" else None "DATA_BUCKET", "retrofit-data-dev" if ENVIRONMENT == "dev" else None
) )
pd.set_option("future.no_silent_downcasting", True)
@dataclass @dataclass
class EPCRecord: class EPCRecord:

View file

@ -744,7 +744,7 @@ class Recommendations:
# fairly regularly. A task has been added to planner to refactor this # fairly regularly. A task has been added to planner to refactor this
# We have observed an edge case where the fuel is described as not being community # We have observed an edge case where the fuel is described as not being community
# but the hot water is. We handle as such # but the hot water is. We handle as such
logger.warning("Hot water description not mapped: %s", heating_description) logger.warning("Hot water description not mapped: %s", hotwater_description)
mapped_hotwater = {"fuel": 'Unmapped', "cop": 0.9} mapped_hotwater = {"fuel": 'Unmapped', "cop": 0.9}
return { return {