-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
46 lines (32 loc) · 1.17 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from dataclasses import dataclass, field
@dataclass
class AppConfig():
"""Application configuration"""
serial_port: str
"""Serial port."""
baudrate: int
"""Baudrate"""
connection_timeout: float
"""Connection timeout in seconds"""
buffer_size: int
"""Number of samples to buffer"""
top_k_buffer_size: int
"""Sample buffer size for the top-k feature"""
nrows: int
"""Number of rows"""
ncols: int
"""Number of columns"""
sensor_shape: tuple = field(init=False)
"""Sensor dimension as tuple (#rows, #columns)."""
inverse_sensor_shape: tuple = field(init=False)
"""Inverted sensor shape to convert arrays back (#columns, #rows)."""
sensitivity: float
"""The sensitivity regarding noise filtering and is directly proportional to the aggressivness of filtering.
"""
log_data: bool
"""Set to true and define the logging directory to write data to CSV files."""
data_directory: str
"""Directory to store data files when log_data is enabled."""
def __post_init__(self):
self.inverse_sensor_shape = (self.ncols, self.nrows)
self.sensor_shape = (self.nrows, self.ncols)