On Sat, Jul 20, 2013 at 7:19 AM, David Joyner <[email protected]> wrote: > On Sat, Jul 20, 2013 at 5:40 AM, Mary Clark <[email protected]> wrote: >> >>> >>> Looks like the "c" in list(c) is a Python int, so if you do list(c), >>> it returns an error. What is this line supposed to do? >>> >>> Does this happen when you run this doctest locally? That's the best >>> way to debug it. >>> >>> Ondrej >> >> >> Unfortunately, I don't seem to be able to run the doctest locally. When I >> try, the following is displayed: >> >> >> sympy/liealgebras/type_a.py[?] Failed to import >> [FAIL] >> >> I don't understand this error or how to fix it, so currently I am reliant on >> Travis to run the doctests. >> >> On the topic of the error: when I run type(c) to test the type, it returns >> str. c is args, it's the input. so c is "A4" or "A3" or whatever. I guess >> I don't understand why the doctest gives this error, if the actually code >> runs fine, if that makes sense. Surely if c was an int, the tests of type_A >> would fail as well, if that makes sense. >>> >>> > > One thing I do (and I think is good practice in general) is that if > you know you want > inputs n and c to be int and str, put > n = int(n) > c = str(c) > at the top of your code. > > Regarding > sympy/liealgebras/type_a.py[?] Failed to import > are there other modules in liealgebras which are loaded, but > the module type_a is not? Also, if this is during a test, so from a > command in the tests > subdirectory, try inserting print statements. For example, in the > ntheory test module, between > > from sympy.ntheory.factor_ import smoothness, smoothness_p > from sympy.ntheory.generate import cycle_length > > insert a print > > from sympy.ntheory.factor_ import smoothness, smoothness_p > print "Hi Mary" > from sympy.ntheory.generate import cycle_length > > See where the failure lies. There are lots of debugging tools > around. I don't use any of them. I just insert print statements. > *Lots* of them:-)
+1, I also just use print statements to be honest. It's simple and robust. Mary, please let us know if you can't figure it out. I tried it on my computer and there I get: https://gist.github.com/certik/6045437 Ondrej -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
