Coverage for skema/gromet/execution_engine/types/defined_types.py: 100%

21 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-30 17:15 +0000

1import numpy 

2from typing import Union, List, Tuple, Dict, Set, Any 

3from dataclasses import dataclass 

4 

5 

6@dataclass(frozen=True) 

7class Field: 

8 name: str 

9 type: str 

10 variatic: bool = False 

11 default_val: Any = None 

12 

13 

14@dataclass 

15class RecordField: 

16 name: str 

17 value_type: type 

18 value: Any 

19 

20 

21@dataclass 

22class Record(object): 

23 name: str 

24 fields: "list[RecordField]" 

25 

26 

27Sequence = Union[range, List, numpy.ndarray, Tuple] 

28Iterable = Union[Set, Sequence, Dict] 

29Indexable = Union[Sequence, Dict, Record]