Opened 4 years ago

Closed 4 years ago

#27144 closed enhancement (fixed)

py3: fix doctests in connectivity.pyx

Reported by: David Coudert Owned by:
Priority: major Milestone: sage-8.7
Component: graph theory Keywords: py3, graph
Cc: Travis Scrimshaw, Frédéric Chapoton Merged in:
Authors: David Coudert Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 99d7c79 (Commits, GitHub, GitLab) Commit: 99d7c79ac7efbc6c96efcdbd360406ca4a6b314b
Dependencies: Stopgaps:

Status badges

Description

Fix the doctests for Python3.

Change History (9)

comment:1 Changed 4 years ago by David Coudert

Branch: u/dcoudert/27144_connectivity
Cc: Travis Scrimshaw Frédéric Chapoton added
Commit: 98964ce95cbc0dc82f0fdb8cb96299179a06f664
Status: newneeds_review

I have marked all doctests of method print_triconnected_components() as Not tested. This method was useful during the development phase of this code, but it brings little information to the user.


New commits:

98964cetrac #27144: fix doctests in connectivity.pyx

comment:2 Changed 4 years ago by Travis Scrimshaw

Status: needs_reviewneeds_work

If this is useless, then we should remove it (after a deprecation). Otherwise we should try to fix it so it works on both py2 and py3.

comment:3 Changed 4 years ago by git

Commit: 98964ce95cbc0dc82f0fdb8cb96299179a06f664f48ada6cc222f0605ca195c614f793effe41a3e3

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

f48ada6trac #27144: remove not tested statements

comment:4 Changed 4 years ago by David Coudert

I have removed the "not tested" statements.

I don't know how to make the failing doctest (it's twice the same test in different parts of the code) work on both py2 and py3. It's not only the order in which the components are displayed that differs, but also the labels of virtual edges inside the components. The label of a virtual edge depends on the step of the algorithm at which it has been created, and this differs in py2 and py3.

The interest of class TriconnectivitySPQR is to decompose the graph using the linear time algorithm and build the SPQR-tree. It could directly return the SPQR-tree. The added value of method print_triconnected_components() is therefore very limited. So I'm in favor of removing this method after a deprecation. I will do that.

comment:5 Changed 4 years ago by Travis Scrimshaw

Three other options would be mark them as # random, mark the tests as # py2 and # py3, or use the ... to get rid of the stuff that changes.

comment:6 Changed 4 years ago by git

Commit: f48ada6cc222f0605ca195c614f793effe41a3e399d7c79ac7efbc6c96efcdbd360406ca4a6b314b

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

99d7c79trac #27144: mark some tests as py2 or py3

comment:7 Changed 4 years ago by David Coudert

Status: needs_workneeds_review

That's even better, thanks. I marked the tests as # py2 and added, inside method print_triconnected_components a doctest marked # py3.

comment:8 Changed 4 years ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review

Thanks. LGTM.

comment:9 Changed 4 years ago by Volker Braun

Branch: u/dcoudert/27144_connectivity99d7c79ac7efbc6c96efcdbd360406ca4a6b314b
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.