55import rustworkx as nx
66
77from .arch import ArchSpec
8- from .encoding import Direction , EncodingType , InterMove , IntraMove , MoveType
8+ from .encoding import Direction , InterMove , IntraMove , MoveType
99
1010
1111@dataclass (frozen = True )
@@ -56,7 +56,7 @@ def __post_init__(self):
5656 lane_addr ,
5757 )
5858
59- def extract_lanes_from_path (self , path : list [int ], encoding : EncodingType ):
59+ def extract_lanes_from_path (self , path : list [int ]):
6060 """Given a path as a list of node indices, extract the lane addresses."""
6161 if len (path ) < 2 :
6262 raise ValueError ("Path must have at least two nodes to extract lanes." )
@@ -67,15 +67,14 @@ def extract_lanes_from_path(self, path: list[int], encoding: EncodingType):
6767
6868 lane : MoveType = self .site_graph .get_edge_data (src , dst )
6969
70- lanes .append (lane .get_address (encoding ))
70+ lanes .append (lane .get_address (self . spec . encoding ))
7171 return lanes
7272
7373 def find_path (
7474 self ,
7575 start : tuple [int , int ],
7676 end : tuple [int , int ],
7777 occupied : frozenset [tuple [int , int ]] = frozenset (),
78- encoding : EncodingType = EncodingType .BIT64 ,
7978 path_heuristic : Callable [[list [tuple [int , int ]]], float ] = lambda _ : 0.0 ,
8079 ):
8180 """Find a path from start to end avoiding occupied sites.
@@ -114,7 +113,7 @@ def find_path(
114113 path_nodes ,
115114 key = lambda p : path_heuristic ([self .physical_addresses [n ] for n in p ]),
116115 )
117- lanes = self .extract_lanes_from_path (path , encoding )
116+ lanes = self .extract_lanes_from_path (path )
118117 return lanes , occupied .union (
119118 frozenset (self .physical_addresses [n ] for n in path )
120119 )
0 commit comments