Feature/poi support - #79
Conversation
ran update-api-docs
Added missing poi in Source Basemodel
0d8e29b to
7b92d30
Compare
ran update-api-docs
Added missing poi in Source Basemodel
7b92d30 to
328c266
Compare
|
|
||
| --- | ||
|
|
||
| ## calculated_channels (optional) |
There was a problem hiding this comment.
why are we deleting the documentation of calculated channels? Please keep it :)
There was a problem hiding this comment.
no need to modify this file
There was a problem hiding this comment.
no need to modify this file
There was a problem hiding this comment.
it seems that your coding agent deleted everything related to calculated channels. I would like to keep the calculated channels example in the demo notebook. Is there a specific reason why this got deleted?
| def __init__(expr, | ||
| uses_alias: bool = False, | ||
| series_type: SeriesType = SeriesType.SAMPLE, | ||
| value_type: PoiValueType = PoiValueType.DOUBLE) |
There was a problem hiding this comment.
I would generalize the value type, maybe we will support in the future also SampleSeries of string type. Therefore, rather than naming the class PoiValueType, lets name it SeriesValueType
| if pd.notna(s[self._te_col].iloc[0]): | ||
| raise ValueError( | ||
| "POI channel series-type mismatch: poi_channel(...) resolved to a SAMPLE " | ||
| "channel (its rows carry a validity interval). Use channel(...) for SAMPLE " | ||
| "channels and poi_channel(...) for POINTS_IN_TIME channels." | ||
| ) |
There was a problem hiding this comment.
This assumption is too strong and I would remove this check (I thought already of having POI channels in the normal channels table with tstart == tend, which would then raise a ValueError here).
| values = values * factor | ||
| return SampleSeries(s[self._ts_col], s[self._te_col], values) | ||
|
|
||
| def _assert_poi_data(self, s, value_type) -> None: |
There was a problem hiding this comment.
Lets move this function into PointsInTimeSeries class and call it from the constructor of POISeries.
| F.col(cfg.poi_timestamp_col).alias(cfg.tstart_col), | ||
| F.lit(None).cast(T.LongType()).alias(cfg.tend_col), | ||
| F.col(cfg.poi_value_double_col).alias(cfg.value_col), | ||
| F.col(cfg.poi_value_string_col).alias(cfg.poi_value_string_col), |
Summary
Adds Points-in-Time (POI) series as a first-class silver-layer channel type:
a value defined only at its timestamp (no between-point validity), backed by
PointsInTimeSeries, sitting alongside the existing interval-valuedSampleSeries.The motivating case is ECU Diagnostic Trouble Codes (DTCs) — string-valued fault
events analyzed together with continuous signals ("RPM at the instant
DTC == P0301").Changes
poi_channelssilver table (POI_CHANNELS_SCHEMA); series type isdetermined by table membership (
channels⇒ SAMPLE,poi_channels⇒ POI) — noseries_typecolumn needed.PointsInTimeSeriesgains string-value support —==/!=and samplingfor strings; arithmetic/ordering/reductions raise for strings via a
@_numeric_onlyguard; value-type-aware
dtype().QueryBuilder.poi_channel(dtype=...)(accepts the enum or the plainstring
"double"/"string"); the selector carriesseries_type+value_typeandis the plan-time source of truth for series-type dispatch.
_prepare_channels_joinunionspoi_channelsafter RLE encoding(zero-duration points aren't merged);
TimeSeriesCache.load_blobbuilds the rightseries from the selector; a solve-time assertion rejects a declared-vs-actual mismatch.
poi_channels_uriwired throughMeasurementDBConfig,MeasurementDB.poi_channels(), and the reportingSourceconfig.mix-and-match, declared-vs-actual, backward-compat),
PointsInTimeSeriesstringunits,
poi_channel(dtype=...)coercion units, and a config-passthrough regression.reporting_pipeline.ipynbgains a DTC section — freeze-frame (RPM at eachP0301 misfire), per-recording fault counts, and a ±10 s window histogram around faults.
make update-api-docstarget added.Test Plan
Checklist