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 asint64; every other column isfloat64withNaNfor missing samples. Row count islen(window["t"]). ReturnedNonewhen 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¶
Supplies recent sensor data to the anomaly detector. |
|
Read recent sensor payloads from the Manager-owned |
Functions¶
|
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.emptyidiom.
- OzWrapper.OzAnomaly.data_provider.Window¶
- OzWrapper.OzAnomaly.data_provider.logger¶