Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set positions in butterfly digraph generator #33749

Closed
dcoudert opened this issue Apr 23, 2022 · 16 comments
Closed

set positions in butterfly digraph generator #33749

dcoudert opened this issue Apr 23, 2022 · 16 comments

Comments

@dcoudert
Copy link
Contributor

We improve the butterfly digraph generator and set the positions of the vertices.

Component: graph theory

Author: David Coudert

Branch/Commit: 3efef4c

Reviewer: Travis Scrimshaw

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

@dcoudert dcoudert added this to the sage-9.7 milestone Apr 23, 2022
@dcoudert
Copy link
Contributor Author

Commit: 04ca0ae

@dcoudert
Copy link
Contributor Author

Branch: public/graphs/33749_butterfly

@dcoudert
Copy link
Contributor Author

comment:1

on the way, we set position of vertices in method Circuit.


New commits:

04ca0aetrac #33749: improve butterfly digraph generator

@tscrim
Copy link
Collaborator

tscrim commented Apr 25, 2022

comment:2

I don't think we should have this doctest:

sage: digraphs.ButterflyGraph(3).show()  # long time

It doesn't fundamentally do anything for testing. I would have a test that outputs the information you want, the position of the vertices for plotting.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 25, 2022

Changed commit from 04ca0ae to 8ebbe46

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 25, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

8ebbe46trac #33749: doctest on position dictionary

@dcoudert
Copy link
Contributor Author

comment:4

Let's try this.

@tscrim
Copy link
Collaborator

tscrim commented Apr 25, 2022

comment:5

Thanks. LGTM.

@tscrim
Copy link
Collaborator

tscrim commented Apr 25, 2022

Reviewer: Travis Scrimshaw

@vbraun
Copy link
Member

vbraun commented May 22, 2022

comment:7
sage -t --long --warn-long 47.0 --random-seed=123 src/sage/graphs/digraph_generators.py
**********************************************************************
File "src/sage/graphs/digraph_generators.py", line 260, in sage.graphs.digraph_generators.DiGraphGenerators.ButterflyGraph
Failed example:
    digraphs.ButterflyGraph(2).get_pos()
Expected:
    {('11', 0): (0, 0),
     ('11', 1): (2, 0),
     ('11', 2): (4, 0),
     ('10', 0): (0, 1),
     ('10', 1): (2, 1),
     ('10', 2): (4, 1),
     ('01', 0): (0, 2),
     ('01', 1): (2, 2),
     ('01', 2): (4, 2),
     ('00', 0): (0, 3),
     ('00', 1): (2, 3),
     ('00', 2): (4, 3)}
Got:
    {('00', 0): (0, 3),
     ('00', 1): (2, 3),
     ('00', 2): (4, 3),
     ('01', 0): (0, 2),
     ('01', 1): (2, 2),
     ('01', 2): (4, 2),
     ('10', 0): (0, 1),
     ('10', 1): (2, 1),
     ('10', 2): (4, 1),
     ('11', 0): (0, 0),
     ('11', 1): (2, 0),
     ('11', 2): (4, 0)}
**********************************************************************
1 item had failures:
   1 of   6 in sage.graphs.digraph_generators.DiGraphGenerators.ButterflyGraph
    [151 tests, 1 failure, 3.19 s]
----------------------------------------------------------------------
sage -t --long --warn-long 47.0 --random-seed=123 src/sage/graphs/digraph_generators.py  # 1 doctest failed
----------------------------------------------------------------------

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 22, 2022

Changed commit from 8ebbe46 to 3efef4c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 22, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

777fb19trac #33749: merge with 9.7.beta0
3efef4ctrac #33740: simpler doctest

@dcoudert
Copy link
Contributor Author

comment:9

Let's avoid sorting issues with a simpler test.

@tscrim
Copy link
Collaborator

tscrim commented May 22, 2022

comment:10

Okay. Although I am slightly surprised that there was an issue but a green patchbot. Usually this is sorted correctly and consistently when running the doctests...

@dcoudert
Copy link
Contributor Author

comment:11

I agree this is very surprising. Let's hope we will not hope such issue in other places.

@vbraun
Copy link
Member

vbraun commented May 26, 2022

Changed branch from public/graphs/33749_butterfly to 3efef4c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants