File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change 1515
1616def get_sublattice (
1717 lattice : AccLattice ,
18- start : Union [ int , str ] = None ,
19- stop : Union [ int , str ] = None ,
18+ start : int | str = None ,
19+ stop : int | str = None ,
2020) -> AccLattice :
21-
22- def get_index (argument : Union [int , str ], default : int = 0 ) -> int :
23- index = default
24- if type (argument ) is str :
25- name = argument
26- index = lattice .getNodeIndex (lattice .getNodeForName (node_name ))
27- else :
28- index = argument
29- return index
30-
31- start_index = get_index (start , default = 0 )
32- stop_index = get_index (stop , default = - 1 )
33- return lattice .getSubLattice (start_index , stop_index )
21+ if type (start ) is str :
22+ start = lattice .getNodeIndex (lattice .getNodeForName (start ))
23+ if type (stop ) is str :
24+ stop = lattice .getNodeIndex (lattice .getNodeForName (stop ))
25+ return lattice .getSubLattice (start , stop )
3426
3527
3628def split_node (node : AccNode , max_part_length : float = None ) -> AccNode :
You can’t perform that action at this time.
0 commit comments