windkit.validate_loss_table#

windkit.validate_loss_table(loss_table)[source]#

Perform several checks to ensure that the loss table DataFrame is valid.

Parameters:

loss_table (DataFrame) – The DataFrame containing the losses.

Raises:

ValueError –

  • If mandatory columns are missing, incorrectly defined, or contain missing values. - If the loss_percentage column contains invalid data types. - If loss_percentage values are outside the specified bounds.

Notes

  • The function assumes that the DataFrame columns are named exactly as specified in the mandatory columns list: MANDATORY_COLUMNS = [‘loss_name’, ‘loss_percentage’].

  • The ‘loss_percentage’ values must be within the range specified by ‘loss_lower_bound’ and ‘loss_upper_bound’ for each row, if these are present.

Examples

>>> loss_table = get_loss_table('dtu_default')
>>> validate_loss_table(loss_table)