Opened 5 months ago

Closed 4 months ago

#27144 closed enhancement (fixed)

py3: fix doctests in connectivity.pyx

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

Description

Fix the doctests for Python3.

Change History (9)

comment:1 Changed 5 months ago by dcoudert

  • Branch set to u/dcoudert/27144_connectivity
  • Cc tscrim chapoton added
  • Commit set to 98964ce95cbc0dc82f0fdb8cb96299179a06f664
  • Status changed from new to needs_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 5 months ago by tscrim

  • Status changed from needs_review to needs_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 5 months ago by git

  • Commit changed from 98964ce95cbc0dc82f0fdb8cb96299179a06f664 to f48ada6cc222f0605ca195c614f793effe41a3e3

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

f48ada6trac #27144: remove not tested statements

comment:4 Changed 5 months ago by dcoudert

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 5 months ago by tscrim

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 5 months ago by git

  • Commit changed from f48ada6cc222f0605ca195c614f793effe41a3e3 to 99d7c79ac7efbc6c96efcdbd360406ca4a6b314b

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

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

comment:7 Changed 5 months ago by dcoudert

  • Status changed from needs_work to needs_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 5 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Thanks. LGTM.

comment:9 Changed 4 months ago by vbraun

  • Branch changed from u/dcoudert/27144_connectivity to 99d7c79ac7efbc6c96efcdbd360406ca4a6b314b
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.