Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
gh-35250: Fix doctests for nauty 2.8.6 output changes
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

See #35157 and #34133.

This changes doctests to accomodate to changes in nauty output (which
are only used for debug purposes).

OTOH, there is a bug in the released nauty 2.8.6 which causes another
doctest failure reported in #35157. On a system with patched nauty 2.8.6
the current PR is good enough.

Leave #35157 open. To fix it a good option might be running `gentreeg 2`
at configure time and check the bug is not present so it's possible to
use 2.8.6 from system if it's been patched. In case it's useful, the
patch I'm using is https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-
mathematics/nauty/files/nauty-2.8.6-gentreeg-gentourng.patch

<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes #1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [x] I have made sure that the title is self-explanatory and the
description concisely explains the PR.
- [x] I have linked an issue or discussion.

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: #35250
Reported by: Gonzalo Tornaría
Reviewer(s): David Coudert
  • Loading branch information
Release Manager committed Mar 31, 2023
2 parents 6332899 + f2e1399 commit dc05f71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sage/graphs/generators/families.py
Original file line number Diff line number Diff line change
Expand Up @@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
sage: gen = graphs.nauty_gentreeg("4", debug=True)
sage: print(next(gen))
>A ...gentreeg Z=2:3 D=3 n=4
>A ...gentreeg ...
sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
sage: next(gen)
''
Expand All @@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
sage: list(graphs.nauty_gentreeg("3", debug=True))
['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
['>A ...gentreeg ...\n', Graph on 3 vertices]
"""
import shlex
from sage.features.nauty import NautyExecutable
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def nauty_geng(self, options="", debug=False):
...
ValueError: wrong format of parameter option
sage: list(graphs.nauty_geng("-c3", debug=True))
['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
['>E Usage: ...geng ...\n']
sage: list(graphs.nauty_geng("-c 3", debug=True))
['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
"""
Expand Down

0 comments on commit dc05f71

Please sign in to comment.