forked from respec/HSPsquared
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocols.py
51 lines (41 loc) · 1.09 KB
/
protocols.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
47
48
49
50
51
from typing import Protocol, Dict, Any, List, Union, runtime_checkable
from collections import defaultdict
import pandas as pd
import numpy as np
from enum import Enum
from HSP2.uci import UCI
TimeSeriesDict = Dict[str,np.float64]
class Category(Enum):
RESULTS = 'RESULT'
INPUTS = 'INPUT'
@runtime_checkable
class SupportsReadUCI(Protocol):
def read_uci(self) -> UCI:
...
@runtime_checkable
class SupportsWriteUCI(Protocol):
def write_uci(self, UCI) -> None:
...
@runtime_checkable
class SupportsReadTS(Protocol):
def read_ts(self,
category:Category,
operation:Union[str,None]=None,
segment:Union[str,None]=None,
activity:Union[str,None]=None) -> pd.DataFrame:
...
@runtime_checkable
class SupportsWriteTS(Protocol):
def write_ts(self,
data_frame:pd.DataFrame,
category:Category,
operation:Union[str,None]=None,
segment:Union[str,None]=None,
activity:Union[str,None]=None) -> None:
...
@runtime_checkable
class SupportsWriteLogging(Protocol):
def write_log(self, hsp2_log:pd.DataFrame) -> None:
...
def write_versioning(self, versions:pd.DataFrame) -> None:
...