sage icon indicating copy to clipboard operation
sage copied to clipboard

fix the output of method `acyclic_orientations`

Open dcoudert opened this issue 1 year ago • 8 comments
trafficstars

This PR fixes the issue with the output of method acyclic_orientations reported in https://ask.sagemath.org/question/79427/the-acyclic-orientations-function-behaves-unexpectedly/. Now the method outputs digraphs with the correct orientation of the arcs.

:memo: Checklist

  • [x] The title is concise and informative.
  • [x] The description explains in detail what this PR is about.
  • [x] I have linked a relevant issue or discussion.
  • [x] I have created tests covering the changes.
  • [x] I have updated the documentation and checked the documentation preview.

:hourglass: Dependencies

dcoudert avatar Oct 03 '24 09:10 dcoudert

Documentation preview for this PR (built with commit 8e7f772a23aeaa23c94ea7e9dc1518aa61557c42; changes) is ready! :tada: This preview will update shortly after each push to this PR.

github-actions[bot] avatar Oct 03 '24 09:10 github-actions[bot]

Not checking asksage, I've opened https://github.com/sagemath/sage/issues/38758 to consider a bigger change.

dimpase avatar Oct 03 '24 12:10 dimpase

can we have a shorter doctest - there is no need to list all these 18 things. Instead, something like

sage: g = Graph([(0,1),(1,2),(2,3),(3,0),(0,2)])
sage: len(set([tuple(d.edges(labels=false)) for d in g.acyclic_orientations()]))
18

dimpase avatar Oct 03 '24 13:10 dimpase

can we have a shorter doctest - there is no need to list all these 18 things. Instead, something like

sage: g = Graph([(0,1),(1,2),(2,3),(3,0),(0,2)])
sage: len(set([tuple(d.edges(labels=false)) for d in g.acyclic_orientations()]))
18

(I have edited my answer): yes, we can do that

dcoudert avatar Oct 03 '24 13:10 dcoudert

other than that, good to go

dimpase avatar Oct 03 '24 13:10 dimpase

apart from a shorter doctest, could you also put the link to askbot in the commit message, and a short explainer?

I'm not sure to get what you ask for. I can ask a link to this PR :issue:`38757` or to issue #38758 in the doctest. Do you want something more ?

dcoudert avatar Oct 03 '24 13:10 dcoudert

apart from a shorter doctest, could you also put the link to askbot in the commit message, and a short explainer?

I'm not sure to get what you ask for. I can ask a link to this PR :issue:`38757` or to issue #38758 in the doctest. Do you want something more ?

perhaps also something like "return a properly relabeled digraph, not just the arc labeling to describe the orientation" ? Needless to say, this, and issue #38758 (no need for rst markup), goes after the 2nd line of the commit message.

dimpase avatar Oct 03 '24 13:10 dimpase

regarding the commit message, I meant the attached, to replace the branch here withcommitmessage.patch.txt

dimpase avatar Oct 03 '24 15:10 dimpase