0

I have a .spyx file that i'm running with using sage.

I have this:

from sage.all import *

which has been handling built-in sage functions like: complement(), clique_number(), and graph(). BUT, it absolutely does not recognize chromatic_number(), even thought it is part of the sage library package.

I have also tried:

from sage.graphs import *

Which is redundant, and not working.

What do I do?

Niles Bernoulli
  • 127
  • 1
  • 3
  • 9
  • I couldn't even get it to recognize `graphs`, but I would wonder if maybe something needs to be `cimport`ed? – kcrisman Nov 05 '13 at 17:17
  • I'm not sure. I was under the assumption that: from sage.all import * imports the entire sage library. – Niles Bernoulli Nov 05 '13 at 22:54
  • Right, but you are using a Cython-ish file there. You may find http://ask.sagemath.org/question/289/compiling-spyx-files. Although actually you shouldn't need to `import *` in an *s*pyx file, only in a pyx file. – kcrisman Nov 06 '13 at 02:55
  • It's working now...somehow? I had commented out a redundant line `from sage.graphs.graph_coloring import chromatic_number` that I had put in after some frustrating errors saying it doesn't understand chromatic_number(). – Niles Bernoulli Nov 06 '13 at 23:54
  • Great! (?) Can you put a minimal (non)-working example of this, just for future visitors to this question? – kcrisman Nov 07 '13 at 00:26
  • I figured it out. I guess I used `attach myfile.spyx` and then used vi to edit in `chromatic_number()`. What you apparently have to do is do `load myfile.spyx` again or reattach it. I hope that is a good enough answer/example for those incoming. – Niles Bernoulli Nov 08 '13 at 02:26

0 Answers0