diff --git a/thermostat/climate_zone.py b/thermostat/climate_zone.py index ffaf2c5d..806eec90 100644 --- a/thermostat/climate_zone.py +++ b/thermostat/climate_zone.py @@ -5,6 +5,7 @@ from eeweather.geo import get_lat_long_climate_zones import numpy as np import logging +from pathlib import Path logger = logging.getLogger('epathermostat') @@ -38,20 +39,12 @@ 'Mixed-Dry': 'Mixed-Dry/Hot-Dry', } +WEIGHTS = pd.read_csv( + Path(__file__).parents[0] / "resources" / "NationalAverageClimateZoneWeightings.csv" + ).set_index('climate_zone') +HEATING_CLIMATE_ZONE_WEIGHTS = WEIGHTS["heating_weight"].to_dict() -HEATING_CLIMATE_ZONE_WEIGHTS = { - 'very-cold_cold': 0.549, - 'mixed-humid': 0.312, - 'mixed-dry_hot-dry': 0.054, - 'hot-humid': 0.049, - 'marine': 0.036} - -COOLING_CLIMATE_ZONE_WEIGHTS = { - 'very-cold_cold': 0.096, - 'mixed-humid': 0.34, - 'mixed-dry_hot-dry': 0.144, - 'hot-humid': 0.42, - 'marine': 0.0} +COOLING_CLIMATE_ZONE_WEIGHTS = WEIGHTS["cooling_weight"].to_dict() def retrieve_climate_zone(zipcode): diff --git a/thermostat/resources/NationalAverageClimateZoneWeightings.csv b/thermostat/resources/NationalAverageClimateZoneWeightings.csv index 7de2f267..6d8661cc 100644 --- a/thermostat/resources/NationalAverageClimateZoneWeightings.csv +++ b/thermostat/resources/NationalAverageClimateZoneWeightings.csv @@ -1,6 +1,6 @@ climate_zone,heating_weight,cooling_weight -Very-Cold/Cold,0.549,0.096 -Mixed-Humid,0.312,0.340 -Mixed-Dry/Hot-Dry,0.054,0.144 -Hot-Humid,0.049,0.420 -Marine,0.036,0.000 +very-cold_cold,0.564,0.194 +mixed-humid,0.294,0.311 +mixed-dry_hot-dry,0.051,0.137 +hot-humid,0.054,0.345 +marine,0.037,0.013