Coverage for src/signal_edges/signal/state_levels/definitions.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-04-21 11:16 +0000

1"""Definitions for signal state levels.""" 

2 

3from dataclasses import dataclass 

4from enum import IntEnum, auto 

5 

6 

7class Mode(IntEnum): 

8 """Mode that defines the algorithm to calculate the state levels.""" 

9 

10 #: Histograms with mode values. 

11 HISTOGRAM_MODE = auto() 

12 #: Histograms with mean values. 

13 HISTOGRAM_MEAN = auto() 

14 

15 

16@dataclass 

17class StateLevels: 

18 """Definition of the state levels of the signal, in the same units as the units of the values of the vertical 

19 axis of the signal from which they were calculated, refer to :meth:`~.StateLevelsMixin.state_levels` for details. 

20 

21 The values satisfy `lowest < low < low_runt < intermediate < high_runt < high < highest`. 

22 

23 The full range in this context refers to `highest - lowest`. 

24 

25 :param highest: Highest level, equal to `100%` of the full range. 

26 :param high: High level, maps to ``high_ref`` percentage value. 

27 :param high_runt: High runt level, maps to ``high_runt_ref`` percentage value. 

28 :param intermediate: Intermediate level, maps to ``intermediate_ref`` percentage value. 

29 :param low_runt: Low runt level, maps to ``low_runt_ref`` percentage value. 

30 :param low: Low level, maps to ``low_ref`` percentage value. 

31 :param lowest: Lowest level, equal to `0%` of the full range.""" 

32 

33 highest: float 

34 high: float 

35 high_runt: float 

36 intermediate: float 

37 low_runt: float 

38 low: float 

39 lowest: float