Skip to content

Commit 21a6db9

Browse files
author
Vasileios Karakasis
committed
More comments and PEP8 fixes
1 parent 146582d commit 21a6db9

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

reframe/utility/__init__.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,18 @@ def _delta_encode(seq):
648648
649649
The input list must be at least of size 1.
650650
651+
Example of delta encoding:
652+
653+
- Input list:
654+
1 2 5 6 7 8 9 125
655+
656+
- Output list:
657+
1 1 3 1 1 1 1 106
658+
^
659+
|
660+
First element
661+
of the original list.
662+
651663
:returns: the encoded list. The first element of the encoded sequence is
652664
the first element of the original sequence.
653665
@@ -667,6 +679,21 @@ def _rl_encode(seq):
667679
668680
The input list must be at least of size 1.
669681
682+
Example of run-length encoding:
683+
684+
- Original list:
685+
1 2 5 6 7 8 9 125
686+
687+
- Delta-encoded list:
688+
1 1 3 1 1 1 1 106
689+
690+
- Run-length-encoded list:
691+
692+
(1,1,2), (5,1,5), (125,1,1)
693+
694+
For convenience, in each RLE unit we use the first element of the original
695+
unit and not the delta value from the previous unit.
696+
670697
:returns: the encoded list. Each element of the list is a three-tuple
671698
containing the first element of the unit, the delta value of the unit
672699
and its length.
@@ -702,7 +729,7 @@ def _rl_encode(seq):
702729

703730

704731
def _parse_node(nodename):
705-
m = re.search('(^\D+)(\d+)', nodename)
732+
m = re.search(r'(^\D+)(\d+)', nodename)
706733
if m is None:
707734
basename = nodename
708735
width = 0

0 commit comments

Comments
 (0)