# year: year to generate the data for in astronomical numbering
# year: year to generate the data for in astronomical numbering
# annual_demand: annual heating demand in kWh
# annual_demand: annual heating demand in kWh
# temperatures: daily temperatures in °C
# temperatures: daily temperatures in °C
# seperate_warm_water: if set to false, the function returns one heating demand profile, if set to true, the function returns two demand profiles, the first is the heating demand withoud the warm water demand and the second is the warm water demand
# profile_type: profile type to generate, e.g. D13, D23, etc.
# seperate_warm_water: if set to false, the function ret^urns one heating demand profile, if set to true, the function returns two demand profiles, the first is the heating demand without the warm water demand and the second is the warm water demand
# days in the year, depending on if the given year is a leap year
#TODO: implement error handling
# days in the year, depending on wehter the given year a leap year
days_in_year=365ifnotcalendar.isleap(year)else366
days_in_year=365ifnotcalendar.isleap(year)else366
iflen(temperatures)!=days_in_year:
iflen(temperatures)!=days_in_year:
raiseValueError(f"Lengh of daily tamperatures has to be {days_in_year}!")
raiseValueError(f"Lengh of daily tamperatures has to be {days_in_year}!")
# compute geometric mean of the temperatures
# compute geometric mean of the temperatures to smooth out temperature fluctuations
allocation_temperatures=(
allocation_temperatures=(
temperatures
temperatures
+0.5*np.roll(temperatures,1)
+0.5*np.roll(temperatures,1)
...
@@ -183,11 +186,13 @@ class HeatingDemandGenerator:
...
@@ -183,11 +186,13 @@ class HeatingDemandGenerator: