Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nauty_geng is naughty #14068

Closed
sagetrac-azi mannequin opened this issue Feb 6, 2013 · 15 comments
Closed

nauty_geng is naughty #14068

sagetrac-azi mannequin opened this issue Feb 6, 2013 · 15 comments

Comments

@sagetrac-azi
Copy link
Mannequin

sagetrac-azi mannequin commented Feb 6, 2013

I think nauty_geng should not ignore geng's return value and return an exception if the returned value is not 0. Consider the following:

def find_counterexample(n):
   for G in graphs.nauty_geng("-c" + str(n)):
     if is_counterexample(G):
        print 'Yeees, there is a counterexample'
        return 
   print 'No counterexamples! Conjecture holds'

the code appears to be just fine but it has a bug! Namely it tries to run the program geng with the parameter "-cn" instead of "-c n". Hence geng returns an error and instead of getting an error in Sage, it simply does not generate any graphs.

The branch implements the catching of geng's error.
We also clean up the code of graph_generators a bit.



CC: @dimpase

Component: graph theory

Author: David Coudert, Dima Pasechnik

Branch/Commit: 93edfb0

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/14068

@sagetrac-azi sagetrac-azi mannequin added this to the sage-5.11 milestone Feb 6, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@dcoudert
Copy link
Contributor

Author: David Coudert

@dcoudert
Copy link
Contributor

comment:5

A possible fix is to raise an error only when parameter debug is False and that something goes wrong.

When debug is True, the behavior remains the same as before and so we continue to display the message output by geng in stderr.


New commits:

759fab2trac #14068: check input when debug is False

@dcoudert
Copy link
Contributor

Branch: public/graphs/14068_nauty

@dcoudert
Copy link
Contributor

Commit: 759fab2

@dcoudert
Copy link
Contributor

comment:6

I don't understand the reported pyflakes error with sage.graphs.strongly_regular_db. Other modules are imported the same way without causing pyflakes errors.

@dimpase
Copy link
Member

dimpase commented Sep 21, 2019

comment:8

Replying to @dcoudert:

I don't understand the reported pyflakes error with sage.graphs.strongly_regular_db. Other modules are imported the same way without causing pyflakes errors.

perhaps pyflakes is confused by staticmethod() thing.
The only place where a method from strongly_regular_db is used is

strongly_regular_graph = staticmethod(sage.graphs.strongly_regular_db.strongly_regular_graph)

by the way, I don't understand why it's not written as

from . import strongly_regular_db
...
strongly_regular_graph = staticmethod(strongly_regular_db.strongly_regular_graph)

Is it cause this code pre-dates from . syntax?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 22, 2019

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

93edfb0refactoring using 'from .' syntax

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 22, 2019

Changed commit from 759fab2 to 93edfb0

@dimpase
Copy link
Member

dimpase commented Sep 22, 2019

comment:10

OK, otherwise looks good. let's see if this commit makes pyflakes happy

@dcoudert
Copy link
Contributor

comment:11

pyflakes is now happy !

@dimpase
Copy link
Member

dimpase commented Sep 22, 2019

Changed author from David Coudert to David Coudert, Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Sep 22, 2019

Reviewer: Dima Pasechnik

@dimpase

This comment has been minimized.

@fchapoton
Copy link
Contributor

comment:13

moving milestone to 9.0 (after release of 8.9)

@fchapoton fchapoton modified the milestones: sage-8.9, sage-9.0 Sep 30, 2019
@vbraun
Copy link
Member

vbraun commented Oct 3, 2019

Changed branch from public/graphs/14068_nauty to 93edfb0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants