Skip to content

rate_of_change

rate_of_change ¤

RateOfChangeEvents ¤

RateOfChangeEvents(
    dataframe: DataFrame,
    signal_uuid: str,
    *,
    event_uuid: str = "eng:rate_of_change",
    value_column: str = "value_double",
    time_column: str = "systime"
)

Bases: Base

Engineering: Rate of Change Events

Detect rapid changes and step jumps in a numeric signal.

Methods: - detect_rapid_change: Flag intervals where rate of change exceeds threshold. - rate_statistics: Per-window rate of change statistics. - detect_step_changes: Sudden value jumps within a short duration.

detect_rapid_change ¤

detect_rapid_change(
    threshold: float, window: str | None = None
) -> pd.DataFrame

Flag intervals where rate of change exceeds threshold.

Each run of consecutive samples whose absolute rate is at or above threshold becomes one interval.

Parameters:

Name Type Description Default
threshold float

Minimum absolute rate (units/second) to flag.

required
window str | None

Deprecated and not used: the rate is always computed between consecutive samples. Passing any value emits a DeprecationWarning. Filter the result on duration_seconds to drop short intervals.

None

Returns:

Type Description
DataFrame

DataFrame with columns: start, end, duration_seconds, uuid,

DataFrame

source_uuid, max_rate, direction.

rate_statistics ¤

rate_statistics(window: str = '1h') -> pd.DataFrame

Per-window rate of change statistics.

Parameters:

Name Type Description Default
window str

Resample window.

'1h'

Returns:

Type Description
DataFrame

DataFrame with columns: start, end, duration_seconds, mean_rate,

DataFrame

std_rate, max_rate, min_rate. end is start + window.

detect_step_changes ¤

detect_step_changes(
    min_delta: float, max_duration: str = "5s"
) -> pd.DataFrame

Detect sudden value jumps within a short duration.

Parameters:

Name Type Description Default
min_delta float

Minimum absolute value change to qualify.

required
max_duration str

Maximum time window for the step to occur.

'5s'

Returns:

Type Description
DataFrame

DataFrame with columns: systime, uuid, source_uuid, time, start,

DataFrame

end, value_before, value_after, delta, duration,

DataFrame

duration_seconds. systime and end equal time (the

DataFrame

instant after the jump; time is a deprecated twin), start

DataFrame

is the sample before the jump, and duration_seconds is the

DataFrame

float-seconds twin of the Timedelta duration.