@@ -36,10 +36,8 @@ Methods
36
36
37
37
from memory_allocator cimport MemoryAllocator
38
38
from sage.sets.disjoint_set cimport DisjointSet_of_hashables
39
- from sage.misc.decorators import rename_keyword
40
39
41
40
42
- @ rename_keyword (deprecation = 32805 , wfunction = ' weight_function' )
43
41
def kruskal (G , by_weight = True , weight_function = None , check_weight = False , check = False ):
44
42
r """
45
43
Minimum spanning tree using Kruskal's algorithm.
@@ -243,19 +241,11 @@ def kruskal(G, by_weight=True, weight_function=None, check_weight=False, check=F
243
241
Traceback ( most recent call last) :
244
242
...
245
243
ValueError: the input graph must be undirected
246
-
247
- Rename warning for parameter ``wfunction`` ( :trac:`32805`) ::
248
-
249
- sage: kruskal( Graph( 1) , wfunction=lambda e: 2)
250
- doctest:... : DeprecationWarning: use the option 'weight_function' instead of 'wfunction'
251
- See https://github. com/sagemath/sage/issues/32805 for details.
252
- []
253
244
"""
254
245
return list (kruskal_iterator(G, by_weight = by_weight, weight_function = weight_function,
255
246
check_weight = check_weight, check = check))
256
247
257
248
258
- @ rename_keyword (deprecation = 32805 , wfunction = ' weight_function' )
259
249
def kruskal_iterator (G , by_weight = True , weight_function = None , check_weight = False , bint check = False ):
260
250
"""
261
251
Return an iterator implementation of Kruskal algorithm.
@@ -323,13 +313,6 @@ def kruskal_iterator(G, by_weight=True, weight_function=None, check_weight=False
323
313
Traceback (most recent call last):
324
314
...
325
315
ValueError: the input graph must be undirected
326
-
327
- Rename warning for parameter ``wfunction`` (:trac:`32805`)::
328
-
329
- sage: list(kruskal_iterator(Graph(1), wfunction=lambda e: 2))
330
- doctest:...: DeprecationWarning: use the option 'weight_function' instead of 'wfunction'
331
- See https://github.com/sagemath/sage/issues/32805 for details.
332
- []
333
316
"""
334
317
from sage.graphs.graph import Graph
335
318
if not isinstance (G, Graph):
@@ -357,7 +340,6 @@ def kruskal_iterator(G, by_weight=True, weight_function=None, check_weight=False
357
340
check_weight = False )
358
341
359
342
360
- @ rename_keyword (deprecation = 32805 , weighted = ' by_weight' )
361
343
def kruskal_iterator_from_edges (edges , union_find , by_weight = True ,
362
344
weight_function = None , check_weight = False ):
363
345
"""
@@ -400,18 +382,6 @@ def kruskal_iterator_from_edges(edges, union_find, by_weight=True,
400
382
sage: union_set = DisjointSet(G)
401
383
sage: next(kruskal_iterator_from_edges(G.edges(sort=False), union_set, by_weight=G.weighted()))
402
384
(1, 6, 10)
403
-
404
- TESTS:
405
-
406
- Rename warning for parameter ``weighted`` (:trac:`32805`)::
407
-
408
- sage: from sage.graphs.spanning_tree import kruskal_iterator_from_edges
409
- sage: G = Graph([(0, 1)])
410
- sage: union_set = DisjointSet(G)
411
- sage: next(kruskal_iterator_from_edges(G.edges(sort=True), union_set, weighted=False))
412
- doctest:...: DeprecationWarning: use the option 'by_weight' instead of 'weighted'
413
- See https://github.com/sagemath/sage/issues/32805 for details.
414
- (0, 1, None)
415
385
"""
416
386
# We sort edges, as specified.
417
387
if weight_function is not None :
@@ -698,7 +668,6 @@ def filter_kruskal_iterator(G, threshold=10000, by_weight=True, weight_function=
698
668
stack.append((begin, i - 1 ))
699
669
700
670
701
- @ rename_keyword (deprecation = 32805 , wfunction = ' weight_function' )
702
671
def boruvka (G , by_weight = True , weight_function = None , check_weight = True , check = False ):
703
672
r """
704
673
Minimum spanning tree using Boruvka's algorithm.
@@ -807,13 +776,6 @@ def boruvka(G, by_weight=True, weight_function=None, check_weight=True, check=Fa
807
776
Traceback ( most recent call last) :
808
777
...
809
778
ValueError: the input graph must be undirected
810
-
811
- Rename warning for parameter ``wfunction`` ( :trac:`32805`) ::
812
-
813
- sage: boruvka( Graph( 1) , wfunction=lambda e: 2)
814
- doctest:... : DeprecationWarning: use the option 'weight_function' instead of 'wfunction'
815
- See https://github. com/sagemath/sage/issues/32805 for details.
816
- []
817
779
"""
818
780
from sage.graphs.graph import Graph
819
781
if not isinstance (G, Graph):
0 commit comments