sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.43k stars 479 forks source link

Meta-ticket: make graphs compatible with Python 3 #26640

Closed dcoudert closed 4 years ago

dcoudert commented 6 years ago

This ticket is used to keep track of the progress towards python3 in graphs.

Major issues

Needs work:

Needs review:

Done

Optional packages:

With #27628, #27811, #27948, #28108 and #28371 all failing doctests of the optional packages used in the graph module are fixed: benzene, bliss, buckygen, csdp, dot2tex and graphviz, gap_packages, igraph and python_igraph, mcqd, plantri, tdlib

CC: @tscrim @fchapoton @jhpalmieri @jfraymond

Component: graph theory

Author: David Coudert

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/26640

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -25,7 +25,7 @@
 - #27159   py3: fix doctests in `strongly_regular_db.pyx`
 - #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27165   py3: fix doctests in `c_graph.pyx`
-
+- #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`

 **Done**
 - #26274   avoid comparison of vertex labels in MIP - graph_coloring.py
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -26,6 +26,9 @@
 - #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27165   py3: fix doctests in `c_graph.pyx`
 - #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
+- #27167   py3: fix doctest in `distances_all_pairs.pyx`
+- #27170   py3: fix 14 doctests in `digraph.py`
+

 **Done**
 - #26274   avoid comparison of vertex labels in MIP - graph_coloring.py
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -28,6 +28,12 @@
 - #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
 - #27167   py3: fix doctest in `distances_all_pairs.pyx`
 - #27170   py3: fix 14 doctests in `digraph.py`
+- #27176   py3: fix doctest in `generic_graph` (part 1)
+- #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
+- #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
+- #27181   py3: fix doctest in `generic_graph` (part 4)
+- #27183   py3: fix doctest in `generic_graph` (part 5)
+- #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`

 **Done**
dcoudert commented 5 years ago
comment:51

With #26819, #27176, #27179, #27180, #27181, #27183 py3 and #27184, we fix 42 doctests in generic_graph.py !!!

The remainging issues are in relabel, is_isomorphic and graph_isom_equivalent_non_edge_labeled_graph.

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -34,6 +34,8 @@
 - #27181   py3: fix doctest in `generic_graph` (part 4)
 - #27183   py3: fix doctest in `generic_graph` (part 5)
 - #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
+- #27202   py3: fix doctests in random graphs generators
+- #27203   py3: fix 8 doctests in `generators/families.py`

 **Done**
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -14,28 +14,13 @@
 **Needs review**:
 - #26678   clean generic_graph.py (part 12) - meta-ticket for methods related to clustering, centrality and distances. Tickets are #26803, #26813, #26814, #26815, #26819, #26820, #26821, #26822, #26823, #26824, #26825, #26826
 - #26679   clean generic_graph.py (part 13) - searches and constructors
-- #27029   Avoid calling `.vertices()` in `graph_isom_equivalent_non_edge_labeled_graph()`
-- #27129   py3: fix other doctests in `graph.py`
-- #27144   py3: fix doctests in `connectivity.pyx`
-- #27147   py3: fix doctests in `dense_graph.pyx`, `sparse_graph.pyx`, `static_sparse_graph.pyx`
-- #27148   py3: fix doctests in `centrality.pyx`
-- #27149   py3: fix doctests in `comparability.pyx`
-- #27151   py3: fix doctests in `vertex_separation.pyx`
-- #27158   py3: fix doctests in `boost_graph.pyx`
-- #27159   py3: fix doctests in `strongly_regular_db.pyx`
 - #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27165   py3: fix doctests in `c_graph.pyx`
-- #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
-- #27167   py3: fix doctest in `distances_all_pairs.pyx`
 - #27170   py3: fix 14 doctests in `digraph.py`
 - #27176   py3: fix doctest in `generic_graph` (part 1)
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
-- #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
-- #27181   py3: fix doctest in `generic_graph` (part 4)
 - #27183   py3: fix doctest in `generic_graph` (part 5)
-- #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
 - #27202   py3: fix doctests in random graphs generators
-- #27203   py3: fix 8 doctests in `generators/families.py`

 **Done**
@@ -88,9 +73,24 @@
 - #27008   py3: avoid `.vertices()` in method `apex_vertices`
 - #27009   py3: avoid sorting vertices and edges in method treewidth
 - #27010   py3: avoid `.vertices()` in methods `_ford_fulkerson`, `edge_cut`, `bounded_outdegree_orientation` and `gomory_hu_tree`
+- #27029   Avoid calling `.vertices()` in `graph_isom_equivalent_non_edge_labeled_graph()`
 - #27059   py3: improve doctests in `spanning_tree.pyx`
 - #27123   bliss `automorphism_group()` shouldn't sort vertices
 - #27125   py3: fix some doctests in `graph.py`
 - #27127   py3: avoid `.vertices()` in method `ear_decomposition`
+- #27129   py3: fix other doctests in `graph.py`
+- #27144   py3: fix doctests in `connectivity.pyx`
+- #27147   py3: fix doctests in `dense_graph.pyx`, `sparse_graph.pyx`, `static_sparse_graph.pyx`
+- #27148   py3: fix doctests in `centrality.pyx`
+- #27149   py3: fix doctests in `comparability.pyx`
+- #27151   py3: fix doctests in `vertex_separation.pyx`
+- #27158   py3: fix doctests in `boost_graph.pyx`
+- #27159   py3: fix doctests in `strongly_regular_db.pyx`
+- #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
+- #27167   py3: fix doctest in `distances_all_pairs.pyx`
+- #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
+- #27181   py3: fix doctest in `generic_graph` (part 4)
+- #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
+- #27203   py3: fix 8 doctests in `generators/families.py`
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -20,7 +20,7 @@
 - #27176   py3: fix doctest in `generic_graph` (part 1)
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
 - #27183   py3: fix doctest in `generic_graph` (part 5)
-- #27202   py3: fix doctests in random graphs generators
+- #27242   py3: strengthen a doctest in `vertex_separation.pyx`

 **Done**
@@ -91,6 +91,7 @@
 - #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
 - #27181   py3: fix doctest in `generic_graph` (part 4)
 - #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
+- #27202   py3: fix doctests in random graphs generators
 - #27203   py3: fix 8 doctests in `generators/families.py`
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -21,6 +21,10 @@
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
 - #27183   py3: fix doctest in `generic_graph` (part 5)
 - #27242   py3: strengthen a doctest in `vertex_separation.pyx`
+- #27243   py3: fix doctests in `generic_graph` (part 7) -- relabel 
+- #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
+- #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
+- #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`

 **Done**
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -9,6 +9,7 @@

 **Needs work**:
 - #26800   py3: bug with canonical_label
+- #27232   `is_permutation_of` broken for matrices over cyclotomic fields -- this is due to `is_isomorphic` in graphs.

 **Needs review**:
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -13,7 +13,6 @@

 **Needs review**:
-- #26678   clean generic_graph.py (part 12) - meta-ticket for methods related to clustering, centrality and distances. Tickets are #26803, #26813, #26814, #26815, #26819, #26820, #26821, #26822, #26823, #26824, #26825, #26826
 - #26679   clean generic_graph.py (part 13) - searches and constructors
 - #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27165   py3: fix doctests in `c_graph.pyx`
@@ -21,11 +20,8 @@
 - #27176   py3: fix doctest in `generic_graph` (part 1)
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
 - #27183   py3: fix doctest in `generic_graph` (part 5)
-- #27242   py3: strengthen a doctest in `vertex_separation.pyx`
 - #27243   py3: fix doctests in `generic_graph` (part 7) -- relabel 
-- #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
-- #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`

 **Done**
@@ -56,6 +52,7 @@
 - #26666   clean generic_graph.py (part 9) - edge and vertex handlers
 - #26672   clean generic_graph.py (part 10) - degree
 - #26675   clean generic_graph.py (part 11) - substructures
+- #26678   clean generic_graph.py (part 12) - meta-ticket for methods related to clustering, centrality and distances. Tickets are #26803, #26813, #26814, #26815, #26819, #26820, #26821, #26822, #26823, #26824, #26825, #26826
 - #26680   clean generic_graph.py (part 14) - visualization
 - #26711   avoid `.vertices()` in graph_coloring.py
 - #26712   avoid `.vertices()` in independent_sets.pyx
@@ -98,5 +95,8 @@
 - #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
 - #27202   py3: fix doctests in random graphs generators
 - #27203   py3: fix 8 doctests in `generators/families.py`
+- #27242   py3: strengthen a doctest in `vertex_separation.pyx`
+- #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
+- #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -13,14 +13,9 @@

 **Needs review**:
-- #26679   clean generic_graph.py (part 13) - searches and constructors
 - #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
-- #27165   py3: fix doctests in `c_graph.pyx`
 - #27170   py3: fix 14 doctests in `digraph.py`
-- #27176   py3: fix doctest in `generic_graph` (part 1)
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
-- #27183   py3: fix doctest in `generic_graph` (part 5)
-- #27243   py3: fix doctests in `generic_graph` (part 7) -- relabel 
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`

@@ -53,6 +48,7 @@
 - #26672   clean generic_graph.py (part 10) - degree
 - #26675   clean generic_graph.py (part 11) - substructures
 - #26678   clean generic_graph.py (part 12) - meta-ticket for methods related to clustering, centrality and distances. Tickets are #26803, #26813, #26814, #26815, #26819, #26820, #26821, #26822, #26823, #26824, #26825, #26826
+- #26679   clean generic_graph.py (part 13) - searches and constructors
 - #26680   clean generic_graph.py (part 14) - visualization
 - #26711   avoid `.vertices()` in graph_coloring.py
 - #26712   avoid `.vertices()` in independent_sets.pyx
@@ -88,14 +84,18 @@
 - #27151   py3: fix doctests in `vertex_separation.pyx`
 - #27158   py3: fix doctests in `boost_graph.pyx`
 - #27159   py3: fix doctests in `strongly_regular_db.pyx`
+- #27165   py3: fix doctests in `c_graph.pyx`
 - #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
 - #27167   py3: fix doctest in `distances_all_pairs.pyx`
+- #27176   py3: fix doctest in `generic_graph` (part 1)
 - #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
 - #27181   py3: fix doctest in `generic_graph` (part 4)
+- #27183   py3: fix doctest in `generic_graph` (part 5)
 - #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
 - #27202   py3: fix doctests in random graphs generators
 - #27203   py3: fix 8 doctests in `generators/families.py`
 - #27242   py3: strengthen a doctest in `vertex_separation.pyx`
+- #27243   py3: fix doctests in `generic_graph` (part 7) -- relabel 
 - #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
dcoudert commented 5 years ago
comment:59

We have now drastically reduced the dependency to .vertices() and .edges() in the graph module (except in doctests, but we can specify sort=True/False).

We must now identify the tasks to do and schedule the work.

Some issues to take care of in the graph module:

And of course, changes done here will certainly break many methods in other modules...

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -2,17 +2,22 @@

 **Major issues**
-- methods `.vertices()` and `.edges()` use sort by default
+- #22349 Deprecate sorting of methods `.vertices()` and `.edges()`
 - direct comparison of vertex labels (e.g., in method `iterator_edges` of `base/sparse_graph.pyx`)
-- all `min_spanning_tree` methods sort edges before returning the result - #26940 is attempt to stop sorting returned list of edges
+- methods using matrices: `adjacency_matrix`, `distance_matrix`, etc. For all these methods, we can now give as input an ordering of the vertices that will be used to order rows and columns. Currently, we use `.vertices()` by default. If we switch to `list(G)` by default, we have to check that it's not breaking algorithms using these matrices.
+- sort used in methods for checking isomorphisms w/wo edge labels

 **Needs work**:
-- #26800   py3: bug with canonical_label
+- #22349   Deprecate sorting of Graph vertices and edges by default
+- #26800   py3: bug with `canonical_label`
 - #27232   `is_permutation_of` broken for matrices over cyclotomic fields -- this is due to `is_isomorphic` in graphs.

 **Needs review**:
+- #27135   pep8 in `digraph_generators.py` (part 2)
+- #27137   pep8 in `digraph_generators.py` (part 4)
+- #27138   pep8 in `digraph_generators.py` (part 5)
 - #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27170   py3: fix 14 doctests in `digraph.py`
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -12,15 +12,14 @@
 - #22349   Deprecate sorting of Graph vertices and edges by default
 - #26800   py3: bug with `canonical_label`
 - #27232   `is_permutation_of` broken for matrices over cyclotomic fields -- this is due to `is_isomorphic` in graphs.
+- `sage.graphs.graph_database`: there is a failing doctest in py3 with `interactive_query`...

 **Needs review**:
 - #27135   pep8 in `digraph_generators.py` (part 2)
 - #27137   pep8 in `digraph_generators.py` (part 4)
 - #27138   pep8 in `digraph_generators.py` (part 5)
-- #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27170   py3: fix 14 doctests in `digraph.py`
-- #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`

@@ -89,10 +88,12 @@
 - #27151   py3: fix doctests in `vertex_separation.pyx`
 - #27158   py3: fix doctests in `boost_graph.pyx`
 - #27159   py3: fix doctests in `strongly_regular_db.pyx`
+- #27160   py3: fix doctests in `hyperbolicity` and `graph_coloring`
 - #27165   py3: fix doctests in `c_graph.pyx`
 - #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
 - #27167   py3: fix doctest in `distances_all_pairs.pyx`
 - #27176   py3: fix doctest in `generic_graph` (part 1)
+- #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
 - #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
 - #27181   py3: fix doctest in `generic_graph` (part 4)
 - #27183   py3: fix doctest in `generic_graph` (part 5)
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -19,8 +19,7 @@
 - #27135   pep8 in `digraph_generators.py` (part 2)
 - #27137   pep8 in `digraph_generators.py` (part 4)
 - #27138   pep8 in `digraph_generators.py` (part 5)
-- #27170   py3: fix 14 doctests in `digraph.py`
-- #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
+- #27408   Edge view for graphs

 **Done**
@@ -92,6 +91,7 @@
 - #27165   py3: fix doctests in `c_graph.pyx`
 - #27166   remove deprecated classes `NetworkXGraphDeprecated` and `NetworkXDiGraphDeprecated`
 - #27167   py3: fix doctest in `distances_all_pairs.pyx`
+- #27170   py3: fix 14 doctests in `digraph.py`
 - #27176   py3: fix doctest in `generic_graph` (part 1)
 - #27179   py3: fix doctest in `generic_graph` (part 2) -- cycle_basis
 - #27180   py3: fix doctest in `generic_graph` (part 3) -- _build_flow_graph
@@ -103,6 +103,7 @@
 - #27242   py3: strengthen a doctest in `vertex_separation.pyx`
 - #27243   py3: fix doctests in `generic_graph` (part 7) -- relabel 
 - #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
+- #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
dcoudert commented 5 years ago
comment:62

Proposal for an EdgeView for graphs in #27408.

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -5,21 +5,20 @@
 - #22349 Deprecate sorting of methods `.vertices()` and `.edges()`
 - direct comparison of vertex labels (e.g., in method `iterator_edges` of `base/sparse_graph.pyx`)
 - methods using matrices: `adjacency_matrix`, `distance_matrix`, etc. For all these methods, we can now give as input an ordering of the vertices that will be used to order rows and columns. Currently, we use `.vertices()` by default. If we switch to `list(G)` by default, we have to check that it's not breaking algorithms using these matrices.
-- sort used in methods for checking isomorphisms w/wo edge labels
+- sort used in methods for checking isomorphisms w/wo edge labels (see also #27232 and #26800). Sorting of lists of possibly unhashable objects is needed here, or may be  a method for checking that there is a permutation from one list to the other could be enough ?

 **Needs work**:
 - #22349   Deprecate sorting of Graph vertices and edges by default
 - #26800   py3: bug with `canonical_label`
 - #27232   `is_permutation_of` broken for matrices over cyclotomic fields -- this is due to `is_isomorphic` in graphs.
-- `sage.graphs.graph_database`: there is a failing doctest in py3 with `interactive_query`...
-
+- #27435   py3: failing doctest in `graph_database.py` with `interactive_query`

 **Needs review**:
 - #27135   pep8 in `digraph_generators.py` (part 2)
 - #27137   pep8 in `digraph_generators.py` (part 4)
 - #27138   pep8 in `digraph_generators.py` (part 5)
-- #27408   Edge view for graphs
+- #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.

 **Done**
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -11,13 +11,13 @@
 **Needs work**:
 - #22349   Deprecate sorting of Graph vertices and edges by default
 - #26800   py3: bug with `canonical_label`
-- #27232   `is_permutation_of` broken for matrices over cyclotomic fields -- this is due to `is_isomorphic` in graphs.
 - #27435   py3: failing doctest in `graph_database.py` with `interactive_query`

 **Needs review**:
 - #27135   pep8 in `digraph_generators.py` (part 2)
 - #27137   pep8 in `digraph_generators.py` (part 4)
 - #27138   pep8 in `digraph_generators.py` (part 5)
+- #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
jhpalmieri commented 5 years ago
comment:65

I don't know if this is a good idea or not, but see #27452 for a branch which fixes the last doctest failures in src/homology. This bypasses an issue with graphs, as mentioned above:

sage: S1 = simplicial_complexes.Sphere(1)
sage: g = S1.wedge(S1).graph()
sage: g
Graph on 5 vertices
sage: g.vertices()
...
TypeError: '<' not supported between instances of 'int' and 'str'

The branch at #27452 relabels the graph of a simplicial complex so that the vertices are sortable, before trying to compute its minimal spanning tree. Is this just sweeping things under the rug, or is it okay?

tscrim commented 5 years ago
comment:66

I think it is one way forward. It does suffer in large cases because you have to make a full copy of the simplicial complex's graph, but I don't think it is simply sweeping it under the rug. Perhaps for that a user should know better than to have complicated labels for such tests?

dcoudert commented 5 years ago
comment:67

An alternative is to (optionally) make spanning tree methods return a Graph, in which case there is no need to sort end vertices.

tscrim commented 5 years ago
comment:68

Replying to @dcoudert:

An alternative is to (optionally) make spanning tree methods return a Graph, in which case there is no need to sort end vertices.

My gut reaction was that seems heavy handed. It would make sense, but I suspect the reason we don't is because it would be too expensive (relatively) to return a (Di)Graph. I haven't looked into this (it is too late for me to do so tonight), but just a thought.

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -14,12 +14,11 @@
 - #27435   py3: failing doctest in `graph_database.py` with `interactive_query`

 **Needs review**:
-- #27135   pep8 in `digraph_generators.py` (part 2)
 - #27137   pep8 in `digraph_generators.py` (part 4)
 - #27138   pep8 in `digraph_generators.py` (part 5)
 - #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
-
+- #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`

 **Done**
 - #26274   avoid comparison of vertex labels in MIP - graph_coloring.py
dcoudert commented 5 years ago
comment:70

Some doctests are failing with bliss (not related to #27571)

sage -t src/sage/graphs/generators/families.py
**********************************************************************
File "src/sage/graphs/generators/families.py", line 3191, in sage.graphs.generators.families.MathonPseudocyclicStronglyRegularGraph
Failed example:
    G3x3.automorphism_group(algorithm="bliss").order() # optional - bliss
Expected:
    27
Got:
    3
**********************************************************************
File "src/sage/graphs/generators/families.py", line 3196, in sage.graphs.generators.families.MathonPseudocyclicStronglyRegularGraph
Failed example:
    G9.automorphism_group(algorithm="bliss").order() # optional - bliss
Expected:
    9
Got:
    3
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -19,6 +19,7 @@
 - #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
 - #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
+- #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3

 **Done**
 - #26274   avoid comparison of vertex labels in MIP - graph_coloring.py
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -10,11 +10,9 @@

 **Needs work**:
 - #22349   Deprecate sorting of Graph vertices and edges by default
-- #26800   py3: bug with `canonical_label`
 - #27435   py3: failing doctest in `graph_database.py` with `interactive_query`

 **Needs review**:
-- #27137   pep8 in `digraph_generators.py` (part 4)
 - #27138   pep8 in `digraph_generators.py` (part 5)
 - #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
@@ -59,6 +57,7 @@
 - #26762   py3: fix `HortonGraph` generator
 - #26763   py3: fix `SzekeresSnarkGraph` generator
 - #26779   py3: fix `graph_input.py` and `hypergraph_generators.py`
+- #26800   py3: bug with `canonical_label` fixed by #27695 
 - #26801   py3: change sorting of neighbors labels in `static_sparse_graph.pyx`
 - #26812   py3: fix doctest in `graph_generators.py`
 - #26846        for graph isomorphism
@@ -79,6 +78,7 @@
 - #27125   py3: fix some doctests in `graph.py`
 - #27127   py3: avoid `.vertices()` in method `ear_decomposition`
 - #27129   py3: fix other doctests in `graph.py`
+- #27137   pep8 in `digraph_generators.py` (part 4)
 - #27144   py3: fix doctests in `connectivity.pyx`
 - #27147   py3: fix doctests in `dense_graph.pyx`, `sparse_graph.pyx`, `static_sparse_graph.pyx`
 - #27148   py3: fix doctests in `centrality.pyx`
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -12,12 +12,12 @@
 - #22349   Deprecate sorting of Graph vertices and edges by default
 - #27435   py3: failing doctest in `graph_database.py` with `interactive_query`

+
 **Needs review**:
-- #27138   pep8 in `digraph_generators.py` (part 5)
 - #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
 - #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
-- #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3
+

 **Done**
 - #26274   avoid comparison of vertex labels in MIP - graph_coloring.py
@@ -79,6 +79,7 @@
 - #27127   py3: avoid `.vertices()` in method `ear_decomposition`
 - #27129   py3: fix other doctests in `graph.py`
 - #27137   pep8 in `digraph_generators.py` (part 4)
+- #27138   pep8 in `digraph_generators.py` (part 5)
 - #27144   py3: fix doctests in `connectivity.pyx`
 - #27147   py3: fix doctests in `dense_graph.pyx`, `sparse_graph.pyx`, `static_sparse_graph.pyx`
 - #27148   py3: fix doctests in `centrality.pyx`
@@ -104,5 +105,6 @@
 - #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
+- #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -11,12 +11,12 @@
 **Needs work**:
 - #22349   Deprecate sorting of Graph vertices and edges by default
 - #27435   py3: failing doctest in `graph_database.py` with `interactive_query`
-
+- #28108   py3: ValueError in graph_generators doctests with plantri optional package (follow up of #27948)

 **Needs review**:
 - #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
-- #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
+- #27948   py3: fix doctests with optional package plantri 

 **Done**
@@ -106,5 +106,6 @@
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
 - #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3
+- #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
dcoudert commented 5 years ago
comment:75

We are almost done. We have currently 3 open tickets for the remaining failing doctests.

Needs work (contributors are more than welcome):

Needs review / help / comment:

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -16,7 +16,6 @@
 **Needs review**:
 - #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
-- #27948   py3: fix doctests with optional package plantri 

 **Done**
@@ -105,7 +104,8 @@
 - #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
+- #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
 - #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3
-- #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
+- #27948   py3: fix doctests with optional package plantri 
jhpalmieri commented 5 years ago
comment:76

Replying to @dcoudert:

We are almost done. We have currently 3 open tickets for the remaining failing doctests.

Needs work (contributors are more than welcome):

  • 27435: failing doctest in graph_database.py with interactive_query.

For this one, I would be tempted to label it # py2 since it seems to rely on the legacy Sage notebook. I can open a ticket if that sounds like a valid approach.

dcoudert commented 5 years ago
comment:77
  • 27435: failing doctest in graph_database.py with interactive_query.

For this one, I would be tempted to label it # py2 since it seems to rely on the legacy Sage notebook. I can open a ticket if that sounds like a valid approach.

It is related to sage notebook, but doctests are failing only with py3... So I don't know which is the best approach. Should we try to make a little change to sagenb to make #27435 fixing the issue, although sagenb will be removed in the future (but when?) ?

jhpalmieri commented 5 years ago
comment:78

I apologize, my comments really belong on #27435. I'll continue the discussion there.

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -10,11 +10,9 @@

 **Needs work**:
 - #22349   Deprecate sorting of Graph vertices and edges by default
-- #27435   py3: failing doctest in `graph_database.py` with `interactive_query`
 - #28108   py3: ValueError in graph_generators doctests with plantri optional package (follow up of #27948)

 **Needs review**:
-- #27232   is_isomorphic broken with keyword edge_labels=True
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.

@@ -99,11 +97,13 @@
 - #27184   py3: fix doctests in `generic_graph` (part 6) -- `graphviz_string`
 - #27202   py3: fix doctests in random graphs generators
 - #27203   py3: fix 8 doctests in `generators/families.py`
+- #27232   is_isomorphic broken with keyword edge_labels=True
 - #27242   py3: strengthen a doctest in `vertex_separation.pyx`
 - #27243   py3: fix doctests in `generic_graph` (part 7) -- relabel 
 - #27244   py3: fix doctests in `generic_graph` (part 8) -- `coarsest_equitable_refinement`
 - #27245   py3: fix doctests in `generic_graph` (part 9) -- `automorphism_group`
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
+- #27435   py3: failing doctest in `graph_database.py` with `interactive_query`
 - #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
 - #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3
 - #27948   py3: fix doctests with optional package plantri 
dcoudert commented 5 years ago
comment:79

All doctests in the standard graphs module are now fixed ! Thanks to all of you for your great help.

We can now check all optional packages. For instance, plantri has 2 failing doctests (#28108).

dcoudert commented 5 years ago
comment:80

The last failing doctests of the optional packages (benzene, bliss, buckygen, csdp, dot2tex and graphviz, gap_packages, igraph and python_igraph, mcqd, plantri, tdlib) are fixed with #27948, #28108 and #28371.

dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -5,15 +5,14 @@
 - #22349 Deprecate sorting of methods `.vertices()` and `.edges()`
 - direct comparison of vertex labels (e.g., in method `iterator_edges` of `base/sparse_graph.pyx`)
 - methods using matrices: `adjacency_matrix`, `distance_matrix`, etc. For all these methods, we can now give as input an ordering of the vertices that will be used to order rows and columns. Currently, we use `.vertices()` by default. If we switch to `list(G)` by default, we have to check that it's not breaking algorithms using these matrices.
-- sort used in methods for checking isomorphisms w/wo edge labels (see also #27232 and #26800). Sorting of lists of possibly unhashable objects is needed here, or may be  a method for checking that there is a permutation from one list to the other could be enough ?

 **Needs work**:
 - #22349   Deprecate sorting of Graph vertices and edges by default
-- #28108   py3: ValueError in graph_generators doctests with plantri optional package (follow up of #27948)

 **Needs review**:
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
+- #28371   py3: errors with optional package CSDP

 **Done**
@@ -105,7 +104,16 @@
 - #27246   py3: fix doctests in `generic_graph` (part 10) -- `is_isomorphic`
 - #27435   py3: failing doctest in `graph_database.py` with `interactive_query`
 - #27571   some changes in `automorphism_group` and fix one doctest in `MathonPseudocyclicStronglyRegularGraph`
+- #27628   py3: fix doctest with igraph
 - #27695   try to sort vertices to produce consistent graph6 and dig6 strings in Python3
+- #27811   fix doctest with igraph
 - #27948   py3: fix doctests with optional package plantri 
+- #28108   py3: ValueError in graph_generators doctests with plantri optional package (follow up of #27948)

+**Optional packages:**
+
+With  #27628, #27811, #27948, #28108  and #28371 all failing doctests of the optional packages used in the graph module are fixed: benzene, bliss, buckygen, csdp, dot2tex and graphviz, gap_packages, igraph and python_igraph, mcqd, plantri, tdlib
+
+
+
dcoudert commented 5 years ago

Description changed:

--- 
+++ 
@@ -4,7 +4,7 @@
 **Major issues**
 - #22349 Deprecate sorting of methods `.vertices()` and `.edges()`
 - direct comparison of vertex labels (e.g., in method `iterator_edges` of `base/sparse_graph.pyx`)
-- methods using matrices: `adjacency_matrix`, `distance_matrix`, etc. For all these methods, we can now give as input an ordering of the vertices that will be used to order rows and columns. Currently, we use `.vertices()` by default. If we switch to `list(G)` by default, we have to check that it's not breaking algorithms using these matrices.
+- methods using matrices: `adjacency_matrix`, `distance_matrix`, etc. For all these methods, we can now give as input an ordering of the vertices (and edges) that will be used to order rows and columns. Currently, we use `.vertices()` and `.edges()` by default. If we switch to `list(G)` by default, we have to check that it's not breaking algorithms using these matrices.

 **Needs work**:
@@ -12,7 +12,7 @@

 **Needs review**:
 - #27408   Edge view for graphs -- introduce deprecation warning for `sort=None` as the plan is to set `sort=False` by default.
-- #28371   py3: errors with optional package CSDP
+- #27513   Allow custom order for edges as well as vertices for incidence matrix

 **Done**
@@ -109,6 +109,7 @@
 - #27811   fix doctest with igraph
 - #27948   py3: fix doctests with optional package plantri 
 - #28108   py3: ValueError in graph_generators doctests with plantri optional package (follow up of #27948)
+- #28371   py3: errors with optional package CSDP

 **Optional packages:**
@@ -116,4 +117,3 @@
 With  #27628, #27811, #27948, #28108  and #28371 all failing doctests of the optional packages used in the graph module are fixed: benzene, bliss, buckygen, csdp, dot2tex and graphviz, gap_packages, igraph and python_igraph, mcqd, plantri, tdlib

-
dcoudert commented 4 years ago
comment:82

it's time to close this ticket.

dcoudert commented 4 years ago

Author: David Coudert

jhpalmieri commented 4 years ago
comment:83

Yes, I agree.

jhpalmieri commented 4 years ago

Reviewer: John Palmieri