Opened 2 years ago
Closed 2 years ago
#27183 closed enhancement (fixed)
py3: fix doctest in generic_graph (part 5)
Reported by: | dcoudert | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.7 |
Component: | graph theory | Keywords: | py3, graph |
Cc: | gh-jfraymond | Merged in: | |
Authors: | David Coudert | Reviewers: | Jean-Florent Raymond |
Report Upstream: | N/A | Work issues: | |
Branch: | 78ba5cf (Commits, GitHub, GitLab) | Commit: | 78ba5cf18db16b04fb0139fd7cb2c89e5c6647de |
Dependencies: | Stopgaps: |
Description (last modified by )
Fix doctests in
lex_BFS
: mark some doctests aspy2
orpy3
_color_by_label
: mark some doctests aspy2
orpy3
layout_extend_randomly
: mark a doctest as# random
and add another test
Change History (7)
comment:1 Changed 2 years ago by
- Branch set to public/27183_generic_graph_5
- Commit set to df372582a521ae1c6d3de025a0074bf813b855bf
- Status changed from new to needs_review
comment:2 Changed 2 years ago by
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?)
comment:3 Changed 2 years ago by
- Cc gh-jfraymond added
comment:4 Changed 2 years ago by
- Commit changed from df372582a521ae1c6d3de025a0074bf813b855bf to 78ba5cf18db16b04fb0139fd7cb2c89e5c6647de
comment:5 Changed 2 years ago by
- Description modified (diff)
I changed the doctest to mark the output as random and added a test on the bounding box.
comment:6 Changed 2 years ago by
- Reviewers set to Jean-Florent Raymond
- Status changed from needs_review to positive_review
Thank you.
comment:7 Changed 2 years ago by
- Branch changed from public/27183_generic_graph_5 to 78ba5cf18db16b04fb0139fd7cb2c89e5c6647de
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
trac #27183: other doctests