Check

Check data format

heatpro.check.check_data_format.check_datetime_index(dataframe: DataFrame) bool[source]

Check if the index of a DataFrame is in datetime format.

Parameters:

dataframe (pd.DataFrame) – data

Returns:

True if the index is in datetime format, False otherwise.

heatpro.check.check_data_format.check_energy_feature(dataframe: DataFrame) bool[source]

Check if the DataFrame contains a column with energy information.

Parameters:

dataframe (pd.DataFrame) – data

Returns:

True if column ENERGY_FEATURE_NAME is present, False otherwise

Return type:

bool

heatpro.check.check_data_format.find_duplicate_days(datetime_index: DatetimeIndex)[source]

Find and return a DataFrame containing (year, month, day) tuples that appear more than once in the given DatetimeIndex.

Parameters:

datetime_index – pd.DatetimeIndex

Returns:

DataFrame with columns ‘Year’, ‘Month’, ‘Day’ representing (year, month, day) tuples with multiple appearances.

heatpro.check.check_data_format.find_duplicate_hours(datetime_index: DatetimeIndex)[source]

Find and return a DataFrame containing (year, month, day, hour) tuples that appear more than once in the given DatetimeIndex.

Parameters:

datetime_index – pd.DatetimeIndex

Returns:

DataFrame with columns ‘Year’, ‘Month’, ‘Day’, ‘Hour’ representing (year, month, day, hour) tuples with multiple appearances.

heatpro.check.check_data_format.find_duplicate_months(datetime_index: DatetimeIndex)[source]

Find and return a DataFrame containing (year, month) tuples that appear more than once in the given DatetimeIndex.

Parameters:

datetime_index – pd.DatetimeIndex

Returns:

DataFrame with columns ‘Year’, ‘Month’ representing (year, month) tuples with multiple appearances.

heatpro.check.check_data_format.find_duplicate_years(datetime_index: DatetimeIndex) list[source]
heatpro.check.check_data_format.find_xor_dates(df_left: DataFrame, df_right: DataFrame) DataFrame[source]

Find dates that are not in both index

Parameters:
  • df_left (pd.DataFrame) – left DataFrame

  • df_right (pd.DataFrame) – right DataFrame

Returns:

Dataframe showing of dates that are not in both index

Return type:

pd.DataFrame

heatpro.check.check_data_format.find_xor_hour(df_left: DataFrame, df_right: DataFrame) DataFrame[source]

Find hours that are not in both index

Parameters:
  • df_left (pd.DataFrame) – left DataFrame

  • df_right (pd.DataFrame) – right DataFrame

Returns:

Dataframe showing of hours that are not in both index

Return type:

pd.DataFrame

heatpro.check.check_data_format.find_xor_months(df_left: DataFrame, df_right: DataFrame) DataFrame[source]

Find month that are not in both index

Parameters:
  • df_left (pd.DataFrame) – left DataFrame

  • df_right (pd.DataFrame) – right DataFrame

Returns:

Dataframe showing of month that are not in both index

Return type:

pd.DataFrame

Check weight format

heatpro.check.check_weight_format.check_weight_format(weights: DataFrame) None[source]

Verify that DataFrame format is correct to be used as weight for potentially future disaggregation.

Parameters:

weights (pd.DataFrame) – DataFrame having to role of containing weights

Raises:
  • ValueError – Should have DatetimeIndex

  • ValueError – Should contain WEIGHT_NAME_REQUIRED column