Disaggregation
Pipeline
- heatpro.disaggregation.pipeline.compose(functions: list[Callable]) Callable [source]
Compose a list of functions into a single function.
This function takes a list of functions and returns a new function that applies each function in the list sequentially.
- Parameters:
functions (list[Callable]) – A list of functions to be composed.
- Returns:
A composed function that applies each function in the list.
- Return type:
Callable
- heatpro.disaggregation.pipeline.disaggregate_temporal_demand(input_aggregate_demand: TemporalHeatDemand, functions: list[Callable[[TemporalHeatDemand], TemporalHeatDemand]]) TemporalHeatDemand [source]
Disaggregate temporal heat demand using a list of functions.
This function applies a list of functions to disaggregate a given temporal heat demand. If the list of functions is empty, the original demand is returned unchanged.
- Parameters:
input_aggregate_demand (TemporalHeatDemand) – The input aggregate demand to be disaggregated.
functions (list[Callable[[TemporalHeatDemand],TemporalHeatDemand]]) – A list of functions to be applied for disaggregation.
- Returns:
The disaggregated temporal heat demand.
- Return type:
Weighted Disaggregation
- heatpro.disaggregation.weighted_disaggregation.daily_weighted_dissagregate(monthly_demand: MonthlyHeatDemand, weights: DataFrame, keep_month_data: bool = True) DailyHeatDemand [source]
Disaggregate monthly heat demand into daily values using weights.
- Parameters:
monthly_demand (MonthlyHeatDemand) – The input monthly heat demand to be disaggregated.
weights (pd.DataFrame) – DataFrame containing weights for each day.
keep_month_data (bool, optional) – If True, include monthly data in the output. Defaults to True.
- Raises:
ValueError – If monthly_demand is not an instance of MonthlyHeatDemand.
ValueError – If the weight format is not valid.
ValueError – If weights and monthly_demand do not match the same months.
- Returns:
The disaggregated daily heat demand.
- Return type:
- heatpro.disaggregation.weighted_disaggregation.hourly_weighted_dissagregate(daily_demand: DailyHeatDemand, weights: DataFrame, keep_month_data: bool = True) HourlyHeatDemand [source]
Disaggregate daily heat demand into hourly values using weights.
- Parameters:
daily_demand (DailyHeatDemand) – The input daily heat demand to be disaggregated.
weights (pd.DataFrame) – DataFrame containing weights for each hour.
keep_month_data (bool, optional) – If True, include monthly data in the output. Defaults to True.
- Raises:
ValueError – If daily_demand is not an instance of DailyHeatDemand.
ValueError – If the weight format is not valid.
ValueError – If weights and daily_demand do not match the same months.
- Returns:
The disaggregated hourly heat demand.
- Return type:
- heatpro.disaggregation.weighted_disaggregation.monthly_weighted_disaggregate(yearly_demand: YearlyHeatDemand, weights: DataFrame, keep_year_data: bool = True) MonthlyHeatDemand [source]
Disaggregate yearly heat demand into monthly values using weights.
- Parameters:
yearly_demand (YearlyHeatDemand) – The input yearly heat demand to be disaggregated.
weights (pd.DataFrame) – DataFrame containing weights for each month.
keep_year_data (bool, optional) – If True, include yearly data in the output. Defaults to True.
- Raises:
ValueError – If yearly_demand is not an instance of YearlyHeatDemand.
ValueError – If the weight format is not valid.
ValueError – If there are duplicate months in the weights index.
ValueError – If yearly_demand and weights do not overlap on the same year.
- Returns:
The disaggregated monthly heat demand.
- Return type:
- heatpro.disaggregation.weighted_disaggregation.weekly_weighted_disaggregate(monthly_demand: MonthlyHeatDemand, weights: DataFrame, keep_year_data: bool = True) HourlyHeatDemand [source]
Disaggregate monthly heat demand into hourly values using weights.
- Parameters:
monthly_demand (MonthlyHeatDemand) – The input monthly heat demand to be disaggregated.
weights (pd.DataFrame) – DataFrame containing weights for each week.
keep_year_data (bool, optional) – If True, include yearly data in the output. Defaults to True.
- Raises:
ValueError – If monthly_demand is not an instance of MonthlyHeatDemand.
ValueError – If the weight format is not valid.
ValueError – If weights and monthly_demand do not match the same months.
- Returns:
The disaggregated hourly heat demand.
- Return type: