Coverage for src/foapy/core/_mode.py: 100%
9 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-17 20:45 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-17 20:45 +0000
1class mode:
2 """
3 Mode enumeration used to determinate handling the intervals at the sequence boundaries.
5 Examples
6 ----------
8 See [foapy.intervals()][foapy.intervals] function for code examples using modes.
10 Example how different modes handle intervals are extracted when binding.start
12 === "mode.normal"
14 | | b | a | b | c | b |
15 |:------:|:--:|:--:|:--:|:--:|:--:|
16 | b | 1 | -> | 2 | -> | 2 |
17 | a | -> | 2 | | | |
18 | c | -> | -> | -> | 4 | |
19 | result | 1 | 2 | 2 | 4 | 2 |
21 === "mode.cycle"
23 | | transition | a | b | c | b | b | transition |
24 |:------:|:----------:|:--:|:--:|:--:|:--:|:--:|:----------:|
25 | b | (1) | 1 | -> | 2 | -> | 2 | (1) |
26 | a | (2) | -> | 5 | -> | -> | -> | (2) |
27 | c | (3) | -> | -> | -> | 5 | -> | (3) |
28 | result | | 1 | 5 | 2 | 5 | 2 | |
30 === "mode.lossy"
32 | | b | a | b | c | b |
33 |:------:|:--:|:--:|:--:|:--:|:--:|
34 | b | x | -> | 2 | -> | 2 |
35 | a | -> | x | | | |
36 | c | -> | -> | -> | x | |
37 | result | | | 2 | | 2 |
39 === "mode.redundant"
41 | | a | b | c | b | b | end |
42 |:------:|:--:|:--:|:--:|:--:|:--:|:-----:|
43 | b | 1 | -> | 2 | -> | 2 | 1 |
44 | a | -> | 2 | -> | -> | -> | 4 |
45 | c | -> | -> | -> | 4 | -> | 2 |
46 | result | 1 | 2 | 2 | 4 | 2 | 1 4 2 |
49 """ # noqa: E501
51 lossy: int = 1
52 """
53 Ignore boundary intervals
54 """
56 normal: int = 2
57 """
58 Include first/last boundary interval based on binding
59 """
61 cycle: int = 3
62 """
63 Sumarize boundary intervals as one cyclic interval
64 """
66 redundant: int = 4
67 """
68 Include both (first and last) boundary intervals
69 """