File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -313,19 +313,19 @@ def path_ids_list(
313
313
raise NodeNotReachableException
314
314
return path
315
315
316
- def shortest_path (self , target_node , directional = True ):
316
+ def shortest_path (self , target_node , directional = True , max_depth = 20 ):
317
317
"""
318
318
Returns a queryset of the shortest path
319
319
"""
320
320
return self .filter_order_ids (
321
- self .path_ids_list (target_node , directional = directional )[0 ]
321
+ self .path_ids_list (target_node , directional = directional , max_depth = max_depth )[0 ]
322
322
)
323
323
324
- def distance (self , target_node , directional = True ):
324
+ def distance (self , target_node , directional = True , max_depth = 20 ):
325
325
"""
326
326
Returns the shortest hops count to the target node
327
327
"""
328
- return len (self .path_ids_list (target_node , directional = directional )[0 ]) - 1
328
+ return len (self .path_ids_list (target_node , directional = directional , max_depth = max_depth )[0 ]) - 1
329
329
330
330
def is_root (self ):
331
331
"""
Original file line number Diff line number Diff line change 3
3
import os
4
4
from setuptools import setup
5
5
6
- version = '0.0.7 '
6
+ version = '0.0.8 '
7
7
8
8
classifiers = [
9
9
"Development Status :: 3 - Alpha" ,
You can’t perform that action at this time.
0 commit comments