OzWrapper.OzAnomaly.data_provider

Abstract data source for the anomaly detector.

The detector doesn’t read from InfluxDB or any other remote store; it asks a DataProvider for the last N hours of sensor data.

Window shape returned by get_window():

Dict[str, np.ndarray] — one numpy array per parameter code, all the same length. Indexed by parameter ("g1", "hum", "t", …). The "t" column is ms-epoch as int64; every other column is float64 with NaN for missing samples. Row count is len(window["t"]). Returned None when the cache is unavailable, empty, or holds no records inside the requested window.

The production implementation is OzCacheProvider, which wraps the Redis-backed payload buffer that Manager.sendData populates as a side effect of normal publishing.

Attributes

Classes

DataProvider

Supplies recent sensor data to the anomaly detector.

OzCacheProvider

Read recent sensor payloads from the Manager-owned OzCache.

Functions

is_empty(→ bool)

Return True when the window has no rows or doesn't exist.

Module Contents

OzWrapper.OzAnomaly.data_provider.is_empty(window: Window | None) bool[source]

Return True when the window has no rows or doesn’t exist.

Used by every check function as the first guard, replacing the pandas df is None or df.empty idiom.

OzWrapper.OzAnomaly.data_provider.Window
OzWrapper.OzAnomaly.data_provider.logger