feature: add converting to csv to simultaneity factor calculations

This commit is contained in:
Majid Rezaei 2024-06-24 18:55:20 -04:00 committed by Majid Rezaei
parent 7a1a3fbef1
commit 1999449738

View File

@ -30,6 +30,9 @@ class DemandShiftProcessor:
self.calculate_and_set_simultaneity_factor(combined_heating_df, 'heating')
self.calculate_and_set_simultaneity_factor(combined_cooling_df, 'cooling')
self.save_demands_to_csv(combined_heating_df, 'heating_demands.csv')
self.save_demands_to_csv(combined_cooling_df, 'cooling_demands.csv')
def convert_building_to_dataframe(self, building, demand_type):
if demand_type == 'heating':
data = {
@ -78,3 +81,6 @@ class DemandShiftProcessor:
self.city.simultaneity_factor_heating = peak_total_demand_original / sum_individual_peak_demands
else: # cooling
self.city.simultaneity_factor_cooling = peak_total_demand_original / sum_individual_peak_demands
def save_demands_to_csv(self, df, filename):
df.to_csv(filename)