Skip to content

Commit a00ac4f

Browse files
author
Release Manager
committed
gh-36075: Remove rename warning in spanning_tree.pyx We remove the rename warning introduced in #32805 to clean the use of weights in `spanning_tree.pyx`. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36075 Reported by: David Coudert Reviewer(s): Frédéric Chapoton
2 parents 35ac035 + c1eba1e commit a00ac4f

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

src/sage/graphs/spanning_tree.pyx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ Methods
3636

3737
from memory_allocator cimport MemoryAllocator
3838
from sage.sets.disjoint_set cimport DisjointSet_of_hashables
39-
from sage.misc.decorators import rename_keyword
4039

4140

42-
@rename_keyword(deprecation=32805, wfunction='weight_function')
4341
def kruskal(G, by_weight=True, weight_function=None, check_weight=False, check=False):
4442
r"""
4543
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
243241
Traceback (most recent call last):
244242
...
245243
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-
[]
253244
"""
254245
return list(kruskal_iterator(G, by_weight=by_weight, weight_function=weight_function,
255246
check_weight=check_weight, check=check))
256247

257248

258-
@rename_keyword(deprecation=32805, wfunction='weight_function')
259249
def kruskal_iterator(G, by_weight=True, weight_function=None, check_weight=False, bint check=False):
260250
"""
261251
Return an iterator implementation of Kruskal algorithm.
@@ -323,13 +313,6 @@ def kruskal_iterator(G, by_weight=True, weight_function=None, check_weight=False
323313
Traceback (most recent call last):
324314
...
325315
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-
[]
333316
"""
334317
from sage.graphs.graph import Graph
335318
if not isinstance(G, Graph):
@@ -357,7 +340,6 @@ def kruskal_iterator(G, by_weight=True, weight_function=None, check_weight=False
357340
check_weight=False)
358341

359342

360-
@rename_keyword(deprecation=32805, weighted='by_weight')
361343
def kruskal_iterator_from_edges(edges, union_find, by_weight=True,
362344
weight_function=None, check_weight=False):
363345
"""
@@ -400,18 +382,6 @@ def kruskal_iterator_from_edges(edges, union_find, by_weight=True,
400382
sage: union_set = DisjointSet(G)
401383
sage: next(kruskal_iterator_from_edges(G.edges(sort=False), union_set, by_weight=G.weighted()))
402384
(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)
415385
"""
416386
# We sort edges, as specified.
417387
if weight_function is not None:
@@ -698,7 +668,6 @@ def filter_kruskal_iterator(G, threshold=10000, by_weight=True, weight_function=
698668
stack.append((begin, i - 1))
699669

700670

701-
@rename_keyword(deprecation=32805, wfunction='weight_function')
702671
def boruvka(G, by_weight=True, weight_function=None, check_weight=True, check=False):
703672
r"""
704673
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
807776
Traceback (most recent call last):
808777
...
809778
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-
[]
817779
"""
818780
from sage.graphs.graph import Graph
819781
if not isinstance(G, Graph):

0 commit comments

Comments
 (0)