1- """
2- A SerialHierarchy represents a hierarchy of transformations
1+ """module serial_hierarchy. A SerialHierarchy represents a hierarchy of transformations
32that are applied one after the other
3+
44"""
55
66from typing import List , Any
7- from src .utils .hierarchy_base import HierarchyBase
8-
9-
10- class SerialtHierarchyIterator (object ):
11- """
12- SerialtHierarchyIterator class. Helper class to iterate over a
13- SerialHierarchy object
14- """
15-
16- def __init__ (self , values : List ):
17- self .current_position = 0
18- self .values = values
19-
20- @property
21- def at (self ) -> Any :
22- """
23- Returns the value of the iterator at the current position
24- without incrementing the position of the iterator
25- :return: Any
26- """
27- return self .values [self .current_position ]
28-
29- @property
30- def finished (self ) -> bool :
31- """
32- Returns true if the iterator is exhausted
33- :return:
34- """
35- return self .current_position >= len (self .values )
36-
37- def __next__ (self ):
38-
39- if self .current_position < len (self .values ):
40- result = self .values [self .current_position ]
41- self .current_position += 1
42- return result
43-
44- raise StopIteration
45-
46- def __len__ (self ):
47- """
48- Returns the total number of items in the iterator
49- :return:
50- """
51- return len (self .values )
527
538
54- class SerialHierarchy (HierarchyBase ):
9+ class SerialHierarchy (object ):
5510
5611 """
5712 A SerialHierarchy represents a hierarchy of transformations
@@ -66,7 +21,6 @@ def __init__(self, values: dict) -> None:
6621 list of the ensuing transformations.
6722 :param values:
6823 """
69- super (SerialHierarchy , self ).__init__ ()
7024 self .hierarchy : dict = values
7125
7226 def __getitem__ (self , item ):
0 commit comments