v1.9.1
·
21 commits
to atspm-package
since this release
Version 1.9.1 (March 4, 2025)
Bug Fixes / Improvements:
Filling in missing time periods for detectors with zero actuations didn't work for incremental processing, this has been fixed by tracking a list of known detectors between each run, similar to the unmatched event tracking. So how it works is you provide a dataframe or file path of known detectors, it will filter out detectors last seen more than n days ago, and then will fill in missing time periods with zeros for the remaining detectors.
known_detectors_df='path/to/known_detectors.csv'
# or supply Pandas DataFrame directly
from src.atspm import SignalDataProcessor, sample_data
# Set up all parameters
params = {
# Global Settings
'raw_data': sample_data.data,
'bin_size': 15,
# Performance Measures
'aggregations': [
{'name': 'actuations', 'params': {
'fill_in_missing': True,
'known_detectors_df_or_path': known_detectors_df,
'known_detectors_max_days_old': 2
}}
]
}After you run the processor, here's how to query the known detectors table:
processor = SignalDataProcessor(**params)
processor.load()
processor.aggregate()
# get all table names from the database
known_detectors_df = processor.conn.query("SELECT * FROM known_detectors;").df()Here's what the known detectors table could look like:
| DeviceId | Detector | LastSeen |
|---|---|---|
| 1 | 1 | 2025-03-04 00:00:00 |
| 1 | 2 | 2025-03-04 00:00:00 |
| 2 | 1 | 2025-03-04 00:00:00 |