modified building.py for saving monthly heating and cooling values

This commit is contained in:
pilar 2020-10-23 06:57:34 -04:00
parent f6ba7ac911
commit 51df504a52

View File

@ -42,8 +42,8 @@ class Building(CityObject):
self._type = 'building' self._type = 'building'
self._monthly_heating = pd.DataFrame() self._monthly_heating = pd.DataFrame()
self._monthly_cooling = pd.DataFrame() self._monthly_cooling = pd.DataFrame()
self._hourly_heating = pd.DataFrame() self._hourly_heating = []
self._hourly_cooling = pd.DataFrame() self._hourly_cooling = []
self._week_day_schedule = [] self._week_day_schedule = []
self._saturday_schedule = [] self._saturday_schedule = []
self._sunday_schedule = [] self._sunday_schedule = []
@ -279,7 +279,7 @@ class Building(CityObject):
self._building_units = value self._building_units = value
@property @property
def monthly_heating(self) -> pd.DataFrame: def monthly_heating(self):
""" """
building monthly heating values in Watts-hour building monthly heating values in Watts-hour
:return: DataFrame with 12 values and a header with the source of those :return: DataFrame with 12 values and a header with the source of those
@ -292,10 +292,13 @@ class Building(CityObject):
building monthly heating values in Watts-hour and a header with the source building monthly heating values in Watts-hour and a header with the source
:param value: DataFrame(heating demand) :param value: DataFrame(heating demand)
""" """
self._monthly_heating.append(value) if self._monthly_heating.empty:
self._monthly_heating = value
else:
self._monthly_heating = pd.concat([self._monthly_heating, value])
@property @property
def monthly_cooling(self) -> pd.DataFrame: def monthly_cooling(self):
""" """
building monthly cooling values in Watts-hour building monthly cooling values in Watts-hour
:return: DataFrame with 12 values and a header with the source of those :return: DataFrame with 12 values and a header with the source of those
@ -308,10 +311,13 @@ class Building(CityObject):
building monthly cooling values in Watts-hour and a header with the source building monthly cooling values in Watts-hour and a header with the source
:param value: DataFrame(cooling demand) :param value: DataFrame(cooling demand)
""" """
self._monthly_cooling.append(value) if self._monthly_cooling.empty:
self._monthly_cooling = value
else:
self._monthly_cooling = pd.concat([self._monthly_cooling, value])
@property @property
def hourly_heating(self) -> pd.DataFrame: def hourly_heating(self):
""" """
building hourly heating values in Watts-hour building hourly heating values in Watts-hour
:return: DataFrame with 8760 values and a header with the source of those :return: DataFrame with 8760 values and a header with the source of those
@ -327,7 +333,7 @@ class Building(CityObject):
self._hourly_heating.append(value) self._hourly_heating.append(value)
@property @property
def hourly_cooling(self) -> pd.DataFrame: def hourly_cooling(self):
""" """
building hourly cooling values in Watts-hour building hourly cooling values in Watts-hour
:return: DataFrame with 8760 values and a header with the source of those :return: DataFrame with 8760 values and a header with the source of those