Modularization fixes in sage.graphs
mkoeppe opened this issue · 16 comments
mkoeppe commented
This is for #32601 (sagemath-standard-no-symbolics).
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: 4803982
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/32916
mkoeppe commented
mkoeppe commented
Last 10 new commits:
1c95e82 | sage.graphs.graph_decompositions.tree_decomposition.treelength_lowerbound: Avoid ceil from sage.functions, remove workaround for python 2 integer div |
df49677 | src/sage/graphs/graph_latex.py: Mark doctests # optional - sage.symbolic |
8d7b7cd | src/sage/graphs/generic_graph_pyx.pyx: In doctest, use math.pi with polar_plot |
d062a72 | src/sage/graphs/matchpoly.pyx: Mark a doctest # optional - sage.symbolic |
db13d3f | src/sage/graphs/bipartite_graph.py: Mark some doctests # optional - sage.symbolic |
bab8600 | src/sage/graphs/generators/families.py: Avoid using sage.functions.trig |
7b7b4cd | src/sage/graphs/graph.py: In doctests, use integer_ceil instead of ceil |
d2ada01 | GenericGraph.laplacian_matrix: Import sqrt only when needed, add # optional - sage.symbolic |
a6a3d4c | src/sage/graphs/generators/distance_regular.pyx: Avoid use of sage.functions.trig |
9fa5543 | src/sage/graphs/generic_graph.py: Replace use of symbolic callable expression in doctest by lambda |
mkoeppe commented
Author: Matthias Koeppe
mkoeppe commented
Description changed:
---
+++
@@ -1 +1,2 @@
+This is for #32601 (**sagemath-standard-no-symbolics**).
sagetrac-git commented
sagetrac-git commented
sagetrac-git commented
sagetrac-git commented
dcoudert commented
Reviewer: David Coudert
dcoudert commented
comment:6
I disagree with this change in generic_graph.py as it changes the label of edges
- sage: f(x) = -1 / x
- sage: g(x) = 1 / (x + 1)
+ sage: f = lambda x: -1 / x
+ sage: g = lambda x: 1 / (x + 1)
sage: G = DiGraph()
sage: G.add_edges((i, f(i), f) for i in (1, 2, 1/2, 1/4))
sage: G.add_edges((i, g(i), g) for i in (1, 2, 1/2, 1/4))The current behavior gives
sage: G.edges()
[(1/4, -4, x |--> -1/x), (1/4, 4/5, x |--> 1/(x + 1)), (1/2, -2, x |--> -1/x), (1/2, 2/3, x |--> 1/(x + 1)), (1, -1, x |--> -1/x), (1, 1/2, x |--> 1/(x + 1)), (2, -1/2, x |--> -1/x), (2, 1/3, x |--> 1/(x + 1))]
which can be nicely converted to latex, while the new behavior gives
sage: G.edges()
[(1/4, -4, <function <lambda> at 0x174ac63a0>), (1/4, 4/5, <function <lambda> at 0x174ac6820>), (1/2, -2, <function <lambda> at 0x174ac63a0>), (1/2, 2/3, <function <lambda> at 0x174ac6820>), (1, -1, <function <lambda> at 0x174ac63a0>), (1, 1/2, <function <lambda> at 0x174ac6820>), (2, -1/2, <function <lambda> at 0x174ac63a0>), (2, 1/3, <function <lambda> at 0x174ac6820>)]
which can obviously not be nicely converted.
All other changes looks good to me.
sagetrac-git commented
sagetrac-git commented
dcoudert commented
comment:9
LGTM.
mkoeppe commented
comment:10
Thanks!
vbraun commented
Changed branch from u/mkoeppe/modularization_fixes_in_sage_graphs to 4803982