Closed dimpase closed 1 year ago
@dcoudert - do you understand why these deprecations are popping up, despite sort=
not being used anywhere in the code here? (By the way, time to remove them from Sage, they have been on for long enough)
The current default behavior is to raise a deprecation warning when parameter sort
is not specified. This is ticket https://trac.sagemath.org/ticket/22349 which has been merged only 3 months ago.
however, https://trac.sagemath.org/27408 has been merged in Sage 9.0, and it still pops up.
@SeaGriff could hopefully tell more about the need for an explicit ordering of edges and vertices in the graphs there.
For some reason, the deprecation warning introduced in https://trac.sagemath.org/27408 was not visible. Do you think we should proceed with the removal of the warning ?
@SeaGriff in your code, use G.order()
instead of len(G.vertices())
. It avoids to first create the list of vertices and then get the length of this list. The graph knows its number of vertices. Similarly, use G.size()
instead of len(G.edges())
.
the deprecation warning introduced in https://trac.sagemath.org/27408 was not visible
as we see here, it is visible in this case. So I don't quite get what you mean by "was not visible".
The deprecation warning had no effect before https://trac.sagemath.org/ticket/22349
The deprecation warning had no effect before https://trac.sagemath.org/ticket/22349
oops, I see. OK, then indeed we'd wait till late summer 2023 with removal, I suppose.
At least the beginning of next summer.
I can't recall any reason that information needs to be sorted, and I can't find any in the code, and everything seems to work just as well with the sort flag set to False. This and the optimization @dcoudert mentioned are now on the main branch. thank you!!!
the next step would be to add Sage-style doctests to all public functions in .py files.
See
https://doc.sagemath.org/html/en/developer/doctesting.html#beyond-the-sage-library
on how to run such tests, once they are there.
ok, done
here with Sage 9.8.beta3: