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

py3: fix doctest in generic_graph (part 5) #27183

Closed
dcoudert opened this issue Jan 31, 2019 · 11 comments
Closed

py3: fix doctest in generic_graph (part 5) #27183

dcoudert opened this issue Jan 31, 2019 · 11 comments

Comments

@dcoudert
Copy link
Contributor

Fix doctests in

  • lex_BFS: mark some doctests as py2 or py3
  • _color_by_label: mark some doctests as py2 or py3
  • layout_extend_randomly: mark a doctest as # random and add another test

CC: @jfraymond

Component: graph theory

Author: David Coudert

Branch/Commit: 78ba5cf

Reviewer: Jean-Florent Raymond

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

@dcoudert dcoudert added this to the sage-8.7 milestone Jan 31, 2019
@dcoudert
Copy link
Contributor Author

New commits:

df37258trac #27183: other doctests

@dcoudert
Copy link
Contributor Author

Branch: public/27183_generic_graph_5

@dcoudert
Copy link
Contributor Author

Commit: df37258

@jfraymond
Copy link

comment:2

Hello,

when running the tests on generic_graph.py I got:

**********************************************************************
File "src/sage/graphs/generic_graph.py", line 18636, in sage.graphs.generic_graph.GenericGraph.layout_extend_randomly
Failed example:
    H.layout_extend_randomly({('0', 0): (0, 0), ('1', 1): (1, 1)})  # py3
Expected:
    {('0', 0): (0, 0),
     ('0', 1): [0.1114..., 0.514...],
     ('1', 0): [0.0446..., 0.332...],
     ('1', 1): (1, 1)}
Got:
    {('0', 0): (0, 0),
     ('0', 1): [0.04468968524815642, 0.332490606442413],
     ('1', 0): [0.111439293741037, 0.5143475134191677],
     ('1', 1): (1, 1)}
**********************************************************************

It is not surprising as the results are supposed to be random.
Is there a way to specify this in the doctests? (or to set the random seed to a fixed value before running the tests?)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 13, 2019

Changed commit from df37258 to 78ba5cf

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 13, 2019

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

d0dc10atrac #27183: Merged with 8.7.beta3
78ba5cftrac #27183: better doctest in layout_extend_randomly

@dcoudert
Copy link
Contributor Author

comment:5

I changed the doctest to mark the output as random and added a test on the bounding box.

@dcoudert

This comment has been minimized.

@jfraymond
Copy link

Reviewer: Jean-Florent Raymond

@jfraymond
Copy link

comment:6

Thank you.

@vbraun
Copy link
Member

vbraun commented Feb 14, 2019

Changed branch from public/27183_generic_graph_5 to 78ba5cf

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