#26684 closed enhancement (fixed)
py3: fixing round in random graph generator
Reported by: | chapoton | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.5 |
Component: | python3 | Keywords: | |
Cc: | dcoudert | Merged in: | |
Authors: | Frédéric Chapoton | Reviewers: | David Coudert |
Report Upstream: | N/A | Work issues: | |
Branch: | 44f639c (Commits) | Commit: | |
Dependencies: | Stopgaps: |
Description
Change History (6)
comment:1 Changed 13 months ago by
- Branch set to u/chapoton/26684
- Commit set to 44f639ccd0f6618e98715f86479f56890a935225
- Status changed from new to needs_review
comment:2 Changed 13 months ago by
- Reviewers set to David Coudert
Why do we need to convert to float before rounding ?
comment:3 Changed 13 months ago by
because in python3, round
calls __round__
which only exists for float. Sigh.
comment:4 Changed 13 months ago by
- Status changed from needs_review to positive_review
Ok... I suspect that in Python4 we will have to declare types :P
LGTM
comment:5 Changed 13 months ago by
- Branch changed from u/chapoton/26684 to 44f639ccd0f6618e98715f86479f56890a935225
- Resolution set to fixed
- Status changed from positive_review to closed
comment:6 Changed 13 months ago by
- Commit 44f639ccd0f6618e98715f86479f56890a935225 deleted
I am getting this on 8.5.b6:
sage -t --long --warn-long 55.0 src/sage/graphs/generators/random.py ********************************************************************** File "src/sage/graphs/generators/random.py", line 907, in sage.graphs.generators.random.connecting_nodes Failed example: S = connecting_nodes(T, 5) Exception raised: Traceback (most recent call last): File "/home/chapoton/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/chapoton/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1086, in compile_and_execute exec(compiled, globs) File "<doctest sage.graphs.generators.random.connecting_nodes[2]>", line 1, in <module> S = connecting_nodes(T, Integer(5)) File "/home/chapoton/sage/local/lib/python2.7/site-packages/sage/graphs/generators/random.py", line 973, in connecting_nodes S.append(Ti) UnboundLocalError: local variable 'Ti' referenced before assignment
Version 0, edited 13 months ago
by
(next)
Note: See
TracTickets for help on using
tickets.
New commits:
py3: fixing round in random graph generator