-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from typing import Dict, Optional | ||
Check failure on line 1 in src/biopsykit/io/tfm.py GitHub Actions / test_lint (3.9)Ruff (D100)
|
||
|
||
import pandas as pd | ||
|
||
|
||
class TFMDataset: | ||
"""Class for loading and processing Task Force Monitor (TFM) data.""" | ||
|
||
CHANNEL_MAPPING = {} | ||
|
||
_tz: str | ||
|
||
def __init__( | ||
self, data_dict: Dict[str, pd.DataFrame], sampling_rate_dict: Dict[str, float], tz: Optional[str] = None | ||
): | ||
"""Initialize a TFM dataset. | ||
Parameters | ||
---------- | ||
data_dict : dict | ||
Dictionary containing TFM data. Keys are channel names, values are dataframes with the TFM data. | ||
tz : str, optional | ||
Timezone of the data. Default: None | ||
""" | ||
self._data = data_dict | ||
self._sampling_rate = sampling_rate_dict | ||
for name, data in data_dict.items(): | ||
setattr(self, name, data) | ||
for name, sampling_rate in sampling_rate_dict.items(): | ||
setattr(self, f"sampling_rate_hz_{name}", sampling_rate) | ||
setattr(self, "channels", list(self._data.keys())) | ||
|
||
self._tz = tz |