Ask Your Question

digraphs.nauty_directg() missing in SageMath 8.6?

asked 2019-04-16 05:09:34 -0600

PepijnWissing gravatar image

updated 2019-04-17 01:58:04 -0600

slelievre gravatar image

Hello, I recently picked up SageMath to perform digraph computations regarding a research interest. I'm running into a strange issue regarding a function that should exist, judging by the documentation (link at the bottom of this post), but apparently does not. If I attempt to run a small test copied directly from said documentation:

gen = graphs.nauty_geng("-c 3")
dgs = list(digraphs.nauty_directg(gen))

the program fails to compile and yields

AttributeError                            Traceback (most recent call last)
<ipython-input-29-ae6a73f0fd49> in <module>()
      1 gen = graphs.nauty_geng("-c 3")
----> 2 dgs = list(digraphs.nauty_directg(gen))

/opt/sagemath-8.6/local/lib/python2.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__getattr__ (build/cythonized/sage/misc/lazy_import.c:3536)()
    320             True
    321         """
--> 322         return getattr(self.get_object(), attr)
    324     # We need to wrap all the slot methods, as they are not forwarded

AttributeError: DiGraphGenerators instance has no attribute 'nauty_directg'

Could anyone tell me whether I'm I making a horrible rookie mistake, or is this functionality is simply missing from SageMath 8.6? Or is there something else at play?

Thanks, Pepijn

Documentation at:

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-04-17 01:56:40 -0600

slelievre gravatar image

Thanks for reporting.

Fixing this issue is now tracked at Sage Trac ticket 27686.

To work around the issue for now, use:

sage: gen = graphs.nauty_geng("-c 3")
sage: dgs = list(sage.graphs.digraph_generators.digraphs.nauty_directg(gen))
edit flag offensive delete link more


Thanks for your answer.

I have tried running the proposed workaround in a SageMath 8.6 Notebook (on a Windows machine), but it still not compiling, with pretty much the same message as before:

AttributeError                            Traceback (most recent call last)
<ipython-input-3-1fca0f327f4f> in <module>()
      1 gen = graphs.nauty_geng("-c 3")
----> 2 dgs = list(sage.graphs.digraph_generators.digraphs.nauty_directg(gen))

AttributeError: DiGraphGenerators instance has no attribute 'nauty_directg'

On another note, the example provided before does run properly in a CoCalc worksheet, which (as far as I can tell) is running Sage 8.7.

PepijnWissing gravatar imagePepijnWissing ( 2019-04-17 03:29:15 -0600 )edit

Indeed. It was added in Sage Trac ticket #27231, which was merged in SageMath 8.7.beta4.

To figure out when it was added, I looked at the history of the file at

The commit that introduced it had the ticket number as part of the commit message. Then searching sage-release for this ticket number revealed the SageMath 8.7.beta4 announcement.

slelievre gravatar imageslelievre ( 2019-04-18 13:35:40 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-04-16 05:09:34 -0600

Seen: 95 times

Last updated: Apr 17 '19