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:
Returns:

The disaggregated temporal heat demand.

Return type:

TemporalHeatDemand

Weighted Disaggregation

heatpro.disaggregation.weighted_disaggregation.monthly_weighted_disaggregate(yearly_demand: Series, weights: Series) Series[source]

Disaggregate yearly heat demand into monthly values using weights.

Parameters:
  • yearly_demand (pd.Series) – The input yearly heat demand to be disaggregated.

  • weights (pd.Series) – Series containing weights for each month.

  • keep_year_data (bool, optional) – If True, include yearly data in the output. Defaults to True.

Raises:
  • 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:

pd.Series

heatpro.disaggregation.weighted_disaggregation.weekly_weighted_disaggregate(monthly_demand: Series, weights: Series, keep_year_data: bool = True) HourlyHeatDemand[source]

Disaggregate monthly heat demand into hourly values using weights.

Parameters:
  • monthly_demand (pd.Series) – 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 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:

HourlyHeatDemand