Coverage for src/ipyvizzu/data/type_alias.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-02-26 10:12 +0000

1""" 

2This module provides typing aliases for data used in ipyvizzu. 

3""" 

4 

5from typing import Dict, List, Sequence, Union 

6 

7 

8DimensionValue = str 

9""" 

10Represents a value that can be either a string or a number, 

11but both will be treated as strings. 

12""" 

13 

14MeasureValue = Union[int, float] 

15""" 

16Represents a numerical value, which can be either an int or a float. 

17""" 

18 

19NestedMeasureValues = Union[MeasureValue, List["NestedMeasureValues"]] 

20""" 

21Represents a nested structure of MeasureValues. 

22It can be a single MeasureValue or a list containing other NestedMeasureValues. 

23""" 

24 

25RecordValue = Union[DimensionValue, MeasureValue] 

26""" 

27Represents a value that can be either a DimensionValue or a MeasureValue. 

28""" 

29 

30Record = Union[List[RecordValue], Dict[str, RecordValue]] 

31""" 

32Represents a Record, which is a collection of RecordValues. 

33A Record can be represented as either a list of RecordValues or a dictionary 

34where keys are series names and values are the corresponding RecordValues. 

35""" 

36 

37SeriesValues = Union[Sequence[DimensionValue], Sequence[MeasureValue]] 

38""" 

39Represents a collection of values for a Series. 

40It can be a list of DimensionValues or a list of MeasureValues. 

41""" 

42 

43Series = Dict[str, Union[str, SeriesValues]] 

44""" 

45Represents a Series in a dictionary format. 

46It consists of a name (string), an optional type (also a string), 

47and a values key which contains a SeriesValues. 

48"""