ts_shape.events.engineering.warmup_analysis
Classes
| Name | Description |
|---|---|
WarmUpCoolDownEvents | Engineering: Warm-Up / Cool-Down Analysis |
WarmUpCoolDownEvents
WarmUpCoolDownEvents(
dataframe: pd.DataFrame,
signal_uuid: str,
*,
event_uuid: str = "eng:warmup",
value_column: str = "value_double",
time_column: str = "systime"
) -> None
Bases: Base
Engineering: Warm-Up / Cool-Down Analysis
Detect and characterize warm-up and cool-down curves — common for ovens, extruders, molds, hydraulic systems. Analyzes the shape, consistency, and timing of monotonic temperature/pressure ramps.
Methods:
- detect_warmup: Intervals where signal rises by at least min_rise.
- detect_cooldown: Intervals where signal falls by at least min_fall.
- warmup_consistency: Compare warm-up durations and rates for consistency.
- time_to_target: Time from warmup start until target value is reached.
Functions
| Name | Description |
|---|---|
detect_warmup | Detect intervals where signal rises by at least min_rise. |
detect_cooldown | Detect intervals where signal falls by at least min_fall. |
warmup_consistency | Compare warm-up curves for consistency in duration and rate. |
time_to_target | Time from each ramp start until target value is reached. |
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
dataframe | DataFrame | Long-format timeseries frame (one row per sample, uuid identifies the signal). | required |
signal_uuid | str | UUID of the signal to analyze. | required |
event_uuid | str | UUID stamped on emitted events. | 'eng:warmup' |
value_column | str | Column holding the signal values. | 'value_double' |
time_column | str | Timestamp column. | 'systime' |
detect_warmup
detect_warmup(
min_rise: float, min_duration: str = "1min", *, max_pause: int = 0
) -> pd.DataFrame
Detect intervals where signal rises by at least min_rise.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
min_rise | float | Minimum total value increase to qualify. | required |
min_duration | str | Minimum duration of the ramp. | '1min' |
max_pause | int | Number of consecutive flat or reversed sample steps tolerated inside a ramp (default 0: any pause ends it). | 0 |
Returns
| Type | Description |
|---|---|
DataFrame | DataFrame with columns: start, end, uuid, source_uuid, is_delta, |
DataFrame | start_value, end_value, rise, duration_seconds, avg_rate. |
detect_cooldown
detect_cooldown(
min_fall: float, min_duration: str = "1min", *, max_pause: int = 0
) -> pd.DataFrame
Detect intervals where signal falls by at least min_fall.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
min_fall | float | Minimum total value decrease to qualify (positive number). | required |
min_duration | str | Minimum duration of the ramp. | '1min' |
max_pause | int | Number of consecutive flat or reversed sample steps tolerated inside a ramp (default 0: any pause ends it). | 0 |
Returns
| Type | Description |
|---|---|
DataFrame | DataFrame with columns: start, end, uuid, source_uuid, is_delta, |
DataFrame | start_value, end_value, fall, duration_seconds, avg_rate. |
warmup_consistency
warmup_consistency(min_rise: float, min_duration: str = '1min') -> pd.DataFrame
Compare warm-up curves for consistency in duration and rate.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
min_rise | float | Minimum total value increase for a warm-up, passed to :meth:detect_warmup. | required |
min_duration | str | Minimum warm-up duration (pandas offset string), passed to :meth:detect_warmup. | '1min' |
Returns
| Type | Description |
|---|---|
DataFrame | DataFrame with columns: start, end, duration_seconds, uuid, |
DataFrame | source_uuid, warmup_index, avg_rate, |
DataFrame | deviation_from_median_duration, |
DataFrame | deviation_from_median_duration_seconds. start / end are |
DataFrame | the warm-up's bounds; the deviation from the median warm-up |
DataFrame | duration is in seconds. |
DataFrame | Canonical twin columns: deviation_from_median_duration_seconds |
DataFrame | (after deviation_from_median_duration); it holds the same |
DataFrame | values as the deprecated column right before it, which is removed |
DataFrame | in the next major release. |
time_to_target
time_to_target(target_value: float, direction: str = 'rising') -> pd.DataFrame
Time from each ramp start until target value is reached.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
target_value | float | The target value to reach. | required |
direction | str | 'rising' or 'falling'. | 'rising' |
Returns
| Type | Description |
|---|---|
DataFrame | DataFrame with columns: start, end (= target_reached_at), |
DataFrame | duration_seconds, uuid, source_uuid, target_reached_at, |
DataFrame | time_to_target_seconds, overshoot. overshoot is how far the |
DataFrame | signal goes beyond the target (0 when it does not) from the |
DataFrame | time the target is reached until the next ramp starts, or the |
DataFrame | end of the data for the last ramp. |