ebm.model.filter_scurve_params module
- class FilterScurveParams[source]
Bases:
objectA utility class for filtering S-curve parameters based on building category and condition.
This class provides a static method to filter a DataFrame containing S-curve parameters, extracting the relevant data for a specific building category and set of conditions.
- COL_BUILDING_CATEGORY = 'building_category'
- COL_BUILDING_CONDITION = 'condition'
- COL_EARLIEST_AGE = 'earliest_age_for_measure'
- COL_AVERAGE_AGE = 'average_age_for_measure'
- COL_LAST_AGE = 'last_age_for_measure'
- COL_RUSH_YEARS = 'rush_period_years'
- COL_RUSH_SHARE = 'rush_share'
- COL_NEVER_SHARE = 'never_share'
- static filter(building_category: BuildingCategory, scurve_condition_list: List[str], scurve_params: DataFrame) Dict[str, ScurveParameters][source]
Filters S-curve parameters by building category and condition.
This method filters a DataFrame containing S-curve parameters to extract data specific to the provided building category and conditions listed in scurve_condition_list. The filtered data is then converted into a dictionary of ScurveParameters dataclass instances, each representing the S-curve parameters for a particular condition.
Parameters: - building_category (BuildingCategory): The building category for which the S-curve parameters are being filtered. - scurve_condition_list (List[str]): A list of conditions (as strings) for which the S-curve parameters are needed. - scurve_params (pd.DataFrame): DataFrame containing the S-curve parameters, with columns for building category, condition, and various age-related metrics.
Returns: - filtered_scurve_params (Dict[str, ScurveParameters]): A dictionary where the keys are conditions (str) and the values
are ScurveParameters dataclass instances containing the corresponding S-curve parameters for each condition.
Raises: - KeyError: If the provided building category is not found in the S-curve parameters DataFrame.