From 199944973876f2484b19ed2313972edef301b513 Mon Sep 17 00:00:00 2001 From: Majid Rezaei Date: Mon, 24 Jun 2024 18:55:20 -0400 Subject: [PATCH] feature: add converting to csv to simultaneity factor calculations --- scripts/district_heating_network/simultinity_factor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/district_heating_network/simultinity_factor.py b/scripts/district_heating_network/simultinity_factor.py index c97932b5..11686de9 100644 --- a/scripts/district_heating_network/simultinity_factor.py +++ b/scripts/district_heating_network/simultinity_factor.py @@ -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)