Hullo List,
I have a fairly small expression (~500 variables). When I create a
Relation with it, Python informs me that Sympy has exceeded the max
recursion depth. Is there an intentional limit to expression sizes in
Sympy?
Please find attached a mini-script that highlights the issue I'm
encountering. You should be able to just run it:
$ python recreate_sympy_recursion_issue.py
Thanks,
Kevin
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sympy/-/YPHoqiYIUuYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.
import sys
from sympy import Symbol, Add
noVars = 500
try:
noVars = int(sys.argv[1])
except ValueError:
print( "Could not determine number from command line." )
except IndexError:
pass # no command line number passed
print( "Creating summation of {} variables".format(noVars) )
x = Add(*(
Symbol('x[%03d]' %i, nonnegative=True )
for i in range(1, noVars +1)
))
y = Symbol( 'y[1]', nonnegative=True )
try:
x <= y
except RuntimeError as e:
print( "Runtime Error has occurred! <-------------------------------------" )
print( "Exception text: {}".format(e) )
print( "About to relate sum(x) and y (sum(x) <= y):" )
print( " ****** x ******" )
print( x )
print( "\n y: {}".format(y) )
raw_input("And the comparison of sum(x) <= y (push Enter): ")
print( x <= y )