cronian.feasible_consumption ============================ .. py:module:: cronian.feasible_consumption Functions --------- .. autoapisummary:: cronian.feasible_consumption.calculate_flex_store_bounds cronian.feasible_consumption.parse_flex_amount Module Contents --------------- .. py:function:: calculate_flex_store_bounds(fd_name, fd_profile: numpy.ndarray) -> tuple[numpy.ndarray, numpy.ndarray] Calculate the min/max bounds of flexible demand modelled as a store. Flexible demand is modeled as a store with deadlines on its energy consumption levels. The max consumption level is determined by assuming that the flex demand is shifted to an earlier time (ahead) as much as allowed by the number of snapshots it can be shifted `n` (from `flex+n`). Args: fd_name: Name of the flexible demand profile (e.g., 'flex+2') fd_profile: The values of the flexible demand profile. Returns: e_min: The minimum feasible consumption level of the flexible demand. e_max: The maximum feasible consumption level of the flexible demand. .. py:function:: parse_flex_amount(name: str) -> int | None Parse a demand name to extract the amount of flexibility if available. Args: name: Name of the flexible demand profile (e.g., 'flex+2') Returns: The amount of flexibility in hours if the name matches the pattern 'flex+{n:d}', otherwise None. Raises: ValueError: if the flexible demand name does not match the pattern 'flex+{n:d}'.