Open dkrenn opened 12 years ago
Moreover, there are arguments named "by_weight" in distance, shortest_path, shortest_path_length…
I would go for single argument "by_weight" with following semantics of its values:
I think this would be easy to remember. On the other side, it is quite a radical change that would require long transition period.
What do you think?
I'm turning this ticket to a task since it requires a long transition period.
Description changed:
---
+++
@@ -9,4 +9,19 @@
Since both ways of calling are good (`use_edge_labels` simple and easy, `weight_function` more flexible), either should be possible for each function.
-I would guess, that there are more functions, which are affected...
+
+
+A first step is to **unify the use of parameters `by_weight`, `weight_function` and `check_weight`**
+- #32723 Helper function to avoid duplicated code when using weights
+-
+
+
+We also have to **deprecate `use_edge_labels`** and use instead `by_weight`, etc.
+-
+-
+
+
+and check methods silently using ìf self.weighted()`
+-
+-
+
Description changed:
---
+++
@@ -13,6 +13,7 @@
A first step is to **unify the use of parameters `by_weight`, `weight_function` and `check_weight`**
- #32723 Helper function to avoid duplicated code when using weights
+- #32798 Clean the use of weights in `generic_graph.py` - part 1
-
Description changed:
---
+++
@@ -14,7 +14,10 @@
A first step is to **unify the use of parameters `by_weight`, `weight_function` and `check_weight`**
- #32723 Helper function to avoid duplicated code when using weights
- #32798 Clean the use of weights in `generic_graph.py` - part 1
--
+- #32800 Clean the use of weights in `generic_graph.py` - part 2
+- #32801 Clean the use of weights in `generic_graph.py` - part 3
+- #32802 Clean the use of weights in `graph.py`
+- #32803 Clean the use of weights in `digraph.py`
We also have to **deprecate `use_edge_labels`** and use instead `by_weight`, etc.
Description changed:
---
+++
@@ -18,6 +18,7 @@
- #32801 Clean the use of weights in `generic_graph.py` - part 3
- #32802 Clean the use of weights in `graph.py`
- #32803 Clean the use of weights in `digraph.py`
+- #32804 Clean the use of weights in `path_enumeration.pyx `
We also have to **deprecate `use_edge_labels`** and use instead `by_weight`, etc.
Description changed:
---
+++
@@ -18,7 +18,8 @@
- #32801 Clean the use of weights in `generic_graph.py` - part 3
- #32802 Clean the use of weights in `graph.py`
- #32803 Clean the use of weights in `digraph.py`
-- #32804 Clean the use of weights in `path_enumeration.pyx `
+- #32804 Clean the use of weights in `path_enumeration.pyx`
+- #32805 Clean the use of weights in `spanning_tree.pyx`
We also have to **deprecate `use_edge_labels`** and use instead `by_weight`, etc.
Description changed:
---
+++
@@ -20,6 +20,8 @@
- #32803 Clean the use of weights in `digraph.py`
- #32804 Clean the use of weights in `path_enumeration.pyx`
- #32805 Clean the use of weights in `spanning_tree.pyx`
+- `c_graph.pyx` - depends on #32798, #32800, #32801, #32802
+- `boost_graph.pyx` - depends on #32798, #32800, #32801, #32802
We also have to **deprecate `use_edge_labels`** and use instead `by_weight`, etc.
Description changed:
---
+++
@@ -29,7 +29,7 @@
-
-and check methods silently using ìf self.weighted()`
+and check methods silently using `if self.weighted()`
-
-
Description changed:
---
+++
@@ -19,7 +19,7 @@
- #32802 Clean the use of weights in `graph.py`
- #32803 Clean the use of weights in `digraph.py`
- #32804 Clean the use of weights in `path_enumeration.pyx`
-- #32805 Clean the use of weights in `spanning_tree.pyx`
+- #32805 Clean the use of weights in `spanning_tree.pyx`. Method `random_spanning_tree` in #30566.
- `c_graph.pyx` - depends on #32798, #32800, #32801, #32802
- `boost_graph.pyx` - depends on #32798, #32800, #32801, #32802
Description changed:
---
+++
@@ -20,8 +20,8 @@
- #32803 Clean the use of weights in `digraph.py`
- #32804 Clean the use of weights in `path_enumeration.pyx`
- #32805 Clean the use of weights in `spanning_tree.pyx`. Method `random_spanning_tree` in #30566.
-- `c_graph.pyx` - depends on #32798, #32800, #32801, #32802
-- `boost_graph.pyx` - depends on #32798, #32800, #32801, #32802
+- `c_graph.pyx` - depends on other tickets
+- `boost_graph.pyx` - depends on other tickets
We also have to **deprecate `use_edge_labels`** and use instead `by_weight`, etc.
Help is more than welcome for reviewing the open tickets listed in this meta-ticket.
Description changed:
---
+++
@@ -30,6 +30,6 @@
and check methods silently using `if self.weighted()`
--
+- #33562 Bad error message for weighted adjacency matrix
-
Description changed:
---
+++
@@ -31,5 +31,5 @@
and check methods silently using `if self.weighted()`
- #33562 Bad error message for weighted adjacency matrix
--
+- `distance_graph` - requires to add parameters `by_weights`, ...
Consider the following example:
In the last two lines, the functions are called differently, which is annoying, since one always has to look up the doc, to find out, which one is the correct.
Since both ways of calling are good (
use_edge_labels
simple and easy,weight_function
more flexible), either should be possible for each function.A first step is to unify the use of parameters
by_weight
,weight_function
andcheck_weight
32723 Helper function to avoid duplicated code when using weights
32798 Clean the use of weights in
generic_graph.py
- part 132800 Clean the use of weights in
generic_graph.py
- part 232801 Clean the use of weights in
generic_graph.py
- part 332802 Clean the use of weights in
graph.py
32803 Clean the use of weights in
digraph.py
32804 Clean the use of weights in
path_enumeration.pyx
32805 Clean the use of weights in
spanning_tree.pyx
. Methodrandom_spanning_tree
in #30566.c_graph.pyx
- depends on other ticketsboost_graph.pyx
- depends on other ticketsWe also have to deprecate
use_edge_labels
and use insteadby_weight
, etc.and check methods silently using
if self.weighted()
33562 Bad error message for weighted adjacency matrix
distance_graph
- requires to add parametersby_weights
, ...CC: @sagetrac-brunellus @fchapoton @tscrim
Component: graph theory
Keywords: weight graph
Issue created by migration from https://trac.sagemath.org/ticket/13112