Skip to content

Commit

Permalink
Cleanup and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanGoldman committed Aug 8, 2023
1 parent f6187df commit 8f711ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/write_stats.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# for testing purposes; only run the first n thermostat files
# set to None to run all
top_n = 30


import os
import pandas as pd
import eeweather
from thermostat.core import Thermostat
from thermostat.climate_zone import retrieve_climate_zone
from thermostat.importers import from_csv, get_single_thermostat
from thermostat.exporters import metrics_to_csv
from thermostat.multiple import multiple_thermostat_calculate_epa_field_savings_metrics

def main():
# path to the raw thermostat data in csv format
data_dir = os.path.join('../', '../', 'tau-search-2', 'EPA_Tau')
metadata_path = os.path.join(data_dir, '2019_epa_tau.csv')
# dir to save tau search stats to (multiple files per thermostat)
output_dir = os.path.join('../', '../', 'tau-search-2', 'EPA_Tau_results')
METRICS_FILEPATH = os.path.join(output_dir, '2019_EPA_tau_2023_06_01_metrics_new.csv')
# metadata = pd.read_csv(metadata_path)
# metadata.zipcode = metadata.zipcode.astype(str)
# metadata.head()

thermostats, tstat_errors = from_csv(metadata_path, top_n=None)
thermostats, tstat_errors = from_csv(metadata_path, top_n=top_n)
metrics = multiple_thermostat_calculate_epa_field_savings_metrics(thermostats)

metrics_to_csv(metrics, METRICS_FILEPATH)
Expand Down

0 comments on commit 8f711ba

Please sign in to comment.