Metadata-Version: 2.4
Name: artopal
Version: 0.1.0
Summary: Online monitor features for physiological time series
Author: Florian Dorfhuber
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21
Requires-Dist: pandas>=1.3
Dynamic: license-file

# Opal

Opal converts one or more chronologically ordered numeric signals into the
online monitor features used by the OPAL preparation pipeline.
Be aware that this code expects you to submit data case wise. 
Thus no monitor reset would be performed if multiple cases are in the submitted series.

## Installation

Install the local project with:

```bash
python -m pip install ./library
```

The same directory can be built into wheel and source distributions with:

```bash
python -m build library
```

## Usage

Pass a `pandas.Series` directly:

```python
from opal import monitor_features

features = monitor_features(frame["hr"])
```

Or select one or more columns from a dataframe:

```python
features = monitor_features(frame, "hr")

features = monitor_features(
    frame,
    ["hr", "quot"],
)
```

For each selected signal using the default monitors the result contains these five columns, in this order:

- `<signal>_angle`
- `<signal>_slope`
- `<signal>_angle_20`
- `<signal>_gauss_20`
- `<signal>_gauss_100`
Signal prefixes and feature names are lower-case.
Other monitors cann be supplied as monitor_supplier parameter.
A path-like signal name such as 
`Solar8000/HR` becomes `hr`. 
The returned frame retains the corresponding input index; the input is not modified.

If a dataframe contains exactly one column, its selector can be omitted. A selector is required for wider dataframes so timestamp, identifier, or target columns are not monitored accidentally.
