ts-shape¤
ts-shape is a pandas library for manufacturing and IIoT time series. It works on
long-format signal data (systime, uuid, value_*) and provides loaders,
filters, feature extraction and event detectors for production, quality,
engineering, maintenance, energy and supply-chain questions: OEE, downtime,
SPC rules, setpoint response, drift and more. Every detector takes a DataFrame
and returns a DataFrame, and any detector output can be turned into an
OCEL 2.0 or XES event log for process mining.
pip install ts-shape
import ts_shape
# Synthetic data in the standard long format; use a loader or pandas for your own
df = ts_shape.make_timeseries(["press:temp"], n_points=2000, n_outliers=5)
print(ts_shape.profile(df).summary()) # signal kinds, gaps, resets, duplicates
outliers = ts_shape.OutlierDetectionEvents(df, value_column="value_double")
events = outliers.detect_outliers_zscore(threshold=4.0)
log = ts_shape.to_event_log(events, detector="OutlierDetectionEvents.detect_outliers_zscore")
print(log.events[["ocel:activity", "ocel:timestamp", "ts_shape:value"]])
Where to go next¤
- Installation and Quick start
- Data model and layers: the input format, detectors and output shapes
- Guides: loading, transforms, cycles and segments, object detection, production and OEE, quality and SPC, process engineering, pipelines, event logs
- Module reference: one page per detector class
- API reference: signatures and docstrings, generated from the source