Re: [sympy] Is it possible to subclass Function that will create an UndefinedFunction?

2015-11-23 Thread Duane Nykamp
e) works. > > Aaron Meurer > > > On Mon, Nov 23, 2015 at 2:32 PM, Duane Nykamp > wrote: > > I'm trying to create a subclass of Symbol that returns a subclass of > > Function when called. The only reason is to customize the > is_commutative > >

[sympy] Is it possible to subclass Function that will create an UndefinedFunction?

2015-11-23 Thread Duane Nykamp
I'm trying to create a subclass of Symbol that returns a subclass of Function when called. The only reason is to customize the is_commutative property so that an expression like P(A)/P(Eq(x,1)) will output with the P(x=1) in the denominator rather than as P^-1(x=1), which might confuse my stu

Re: [sympy] Re: Slight change to Add gives infinite recursion on evalf

2015-11-09 Thread Duane Nykamp
> > >> That's definitely a bug. Subclassing any class without changing > >> anything shouldn't break anything. There are unfortunately several > >> instances of this issue (see > >> https://github.com/sympy/sympy/issues/6751). Probably somewhere

[sympy] Re: Slight change to Add gives infinite recursion on evalf

2015-11-09 Thread Duane Nykamp
OK, I'm pretty sure this is a bug. I don't have to change Add at all to get this infinite recursion, just create any subclass In [7]: Add(3,3,evaluate=False).evalf() Out[7]: 6.00 In [8]: class Add2(Add): ...: pass ...: In [9]: Add2(3,3,evaluate=False).evalf() RuntimeErro

[sympy] Slight change to Add gives infinite recursion on evalf

2015-11-08 Thread Duane Nykamp
I created an AddUnsort class that doesn't change the order of its argument. Now, I discovered I get an infinite recursion when I evalf. But, I'm having trouble figuring out how to prevent this infinite recursion. The still get the infinite recursion even with this stripped down class that doe

[sympy] Unable to determine truth value of a statement

2015-10-29 Thread Duane Nykamp
this behavior and the source of what appears to be a bug. Any ideas? Duane Nykamp -- 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 sympy+unsubs

Re: [sympy] Re: Boolean bug?

2015-05-15 Thread Duane Nykamp
Yes, it turned out to mess it up for my use case. It would just confuse folks using my application if And(a>2, a<3) ended up always being true when a is symbolic. My solution was to make a derived class off And and add the methods def __nonzero__(self): raise TypeError("cannot dete

[sympy] Re: Boolean bug?

2015-05-15 Thread Duane Nykamp
x27;t it have the same behavior as this form of the same condition? In [12]: a>2 and a<3 [snip] TypeError: cannot determine truth value of a > 2 On Thursday, May 14, 2015 at 8:42:27 PM UTC-5, Duane Nykamp wrote: > > I don't think this is the desired behavior. > > In [3]:

[sympy] Boolean bug?

2015-05-14 Thread Duane Nykamp
I don't think this is the desired behavior. In [3]: a=Symbol('a') In [4]: bool(And(2>a, a>2)) Out[4]: True -- 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 sympy+unsu

[sympy] Re: .as_terms and sort key broken for unevaluated terms

2015-04-01 Thread Duane Nykamp
else: ncpart.append(factor) On Tuesday, March 31, 2015 at 5:04:37 PM UTC-5, Duane Nykamp wrote: > > The sort key seems insufficient for sorting unevaluated expressions. > > In [37]: Add(x, Mul(x,x,x,evaluate=False), x, evaluate=False) > Out[37]: x + x⋅x⋅x + x > > With a

[sympy] .as_terms and sort key broken for unevaluated terms

2015-03-31 Thread Duane Nykamp
The sort key seems insufficient for sorting unevaluated expressions. In [37]: Add(x, Mul(x,x,x,evaluate=False), x, evaluate=False) Out[37]: x + x⋅x⋅x + x With a slight change, it works as expected: In [38]: Add(x, Mul(x,y,x,evaluate=False), x, evaluate=False) Out[38]: x⋅x⋅y + x + x It seems tha

[sympy] And/Or returns truth value even for expression with Symbols

2015-01-20 Thread Duane Nykamp
Comparisons that are undetermined depending on values of Symbols are not supposed to return a truth value. E.q., the following works correctly: In [2]: bool(Eq(x,5)) --- TypeError Traceback (

Re: [sympy] Strange round behavior

2014-12-29 Thread Duane Nykamp
issue as the break is occurring far away from the correct 5. Standard python rounding get it right: In [4]: round(123.6) Out[4]: 124.0 In [5]: round(-123.6) Out[5]: -124.0 Duane On Saturday, September 6, 2014 1:42:33 PM UTC-5, Duane Nykamp wrote: > > Thanks for fixing this! >

[sympy] Re: Point class repeatedly returns a hardcoded Point class

2014-12-06 Thread Duane Nykamp
p2, p3, p4) def is_collinear(*points): . points = [Point(a) for a in points] and, I'm not sure what to replace Point with in these cases. Duane On Saturday, December 6, 2014 4:17:15 PM UTC-6, Duane Nykamp wrote: > > The Point class, for numerous functions, such as .

[sympy] Point class repeatedly returns a hardcoded Point class

2014-12-06 Thread Duane Nykamp
The Point class, for numerous functions, such as .evalf, returns a hard coded Point class. This means that for a derived class, these functions end up returning the original Point class not the derived class. I assume there must be a way to code it differently so these functions return the de

Re: [sympy] latex printing bug for unevaluated expressions

2014-11-18 Thread Duane Nykamp
ing A and B to be commutative=False. > > Aaron Meurer > > On Tue, Nov 18, 2014 at 5:00 PM, Duane Nykamp > wrote: > >> I just posted this bug on github: >> >> https://github.com/sympy/sympy/issues/8470 >> >> Here's a horrible example that shows what c

[sympy] latex printing bug for unevaluated expressions

2014-11-18 Thread Duane Nykamp
I just posted this bug on github: https://github.com/sympy/sympy/issues/8470 Here's a horrible example that shows what can happen In [9]: latex(parse_expr("-B*A",evaluate=False)) Out[9]: 'A - B' Fixing this problem is urgent for me. I have students entering answers like this, and my website g

[sympy] Re: Distinguishing (1,2) from 1,2 using parse_expr

2014-11-18 Thread Duane Nykamp
; and then > foo.startswith("(") and foo.endswith(")") can be used with confidence. > > On Tuesday, November 18, 2014 11:43:02 AM UTC-6, Duane Nykamp wrote: >> >> In python, entering "1,2" or "(1,2)" gives a tuple, which is what happens >

[sympy] Distinguishing (1,2) from 1,2 using parse_expr

2014-11-18 Thread Duane Nykamp
In python, entering "1,2" or "(1,2)" gives a tuple, which is what happens for parse_expr. However, I am using sympy to parse student answers to questions. Sometimes, I want the answer to be a list of answers. For example if the solutions is x=1 or x=2, I write x = [[blank]] and I want them t

Re: [sympy] parse_expr bug with splitting symbols and undefined function

2014-10-24 Thread Duane Nykamp
; > On Fri, Oct 24, 2014 at 7:55 AM, Duane Nykamp > wrote: > > The following throws an error > > > > In [27]: f=Function('f') > > > > In [28]: parse_expr('af(t)', local_dict={'f': f }, > &

[sympy] parse_expr bug with splitting symbols and undefined function

2014-10-24 Thread Duane Nykamp
The following throws an error In [27]: f=Function('f') In [28]: parse_expr('af(t)', local_dict={'f': f }, transformations=(auto_symbol, auto_number, split_symbols, implicit_multiplication)) --- TypeError

Re: [sympy] Re: Sorting both numerical and symbol items reasonably

2014-10-20 Thread Duane Nykamp
uldn't be slower than the default, should it? Thanks, Duane On Monday, October 20, 2014 5:48:47 AM UTC-5, Mateusz Paprocki wrote: > > Hi, > > On 19 October 2014 05:40, Duane Nykamp > > wrote: > > Here's my solution for a customized sort key. Does this seem &g

[sympy] parse_expr with implicit_multiplication and member functions

2014-10-18 Thread Duane Nykamp
Given changes with booleans as discussed in https://groups.google.com/forum/#!topic/sympy/82ls0doW6Nk, I'm trying to develop a new approach to testing the number of True's in Tuple. With earlier versions of sympy, if thelist=Tuple(False, True, False) the following worked sum(thelist)==1

[sympy] Re: Sorting both numerical and symbol items reasonably

2014-10-18 Thread Duane Nykamp
mpify(item) except: pass else: if x.is_real: return ((1, 0, 'Number'), (0, ()), (), x) return default_sort_key(item,order) On Saturday, October 18, 2014 8:52:50 PM UTC-5, Duane Nykamp wrote: > > I was using sympy's default_sort_ord

[sympy] Sorting both numerical and symbol items reasonably

2014-10-18 Thread Duane Nykamp
I was using sympy's default_sort_order to sort objects. However, I realized that it does not sort numerical quantities in order: In [15]: sorted([-1, -1-sqrt(2),1+sqrt(2), pi, 4], key=default_sort_key) Out[15]: [-1, 4, pi, 1 + sqrt(2), -sqrt(2) - 1] The default sort key, lex, works in this case

Re: [sympy] Tuple behaves different for summation of logical

2014-10-18 Thread Duane Nykamp
Regards > Sudhanshu Mishra > > On Sun, Oct 19, 2014 at 5:36 AM, Duane Nykamp > wrote: > >> Is this intentional behavior? >> >> >> In [1]: from sympy import Tuple >> >> In [2]: sum(

[sympy] Tuple behaves different for summation of logical

2014-10-18 Thread Duane Nykamp
Is this intentional behavior? In [1]: from sympy import Tuple In [2]: sum( (True, False, False)) Out[2]: 1 In [3]: sum(Tuple(True, False, False)) --- TypeError Traceback (most recent call las

[sympy] Re: Minus sign changes bottom_up behavior of evalf

2014-10-07 Thread Duane Nykamp
another file in the same module in one case but not the other. I don't get it. But, hey, if this is fixed in the git version, all is well! Duane On Tuesday, October 7, 2014 4:47:22 PM UTC-5, Duane Nykamp wrote: > > I am mystified as to why a minus sign changes bottom_up behavior when

[sympy] Minus sign changes bottom_up behavior of evalf

2014-10-07 Thread Duane Nykamp
I am mystified as to why a minus sign changes bottom_up behavior when applying evalf. (I have modified bottom_up only by getting rid of the condition "if args != rv.args:" as otherwise it won't evalf integers. See below) With the function def initial_evalf(w): try: r

Re: [sympy] implicit definition of log

2014-10-02 Thread Duane Nykamp
and > alias it to log (and also change the printers to print "log"). This > way is probably simpler, though, as you only have to override the one > evalf method rather than several printer methods. > > Aaron Meurer > > On Sat, Sep 6, 2014 at 3:09 PM, Duane N

Re: [sympy] implicit definition of log

2014-09-06 Thread Duane Nykamp
:12 PM UTC-5, Aaron Meurer wrote: > > SymPy automatically defines evaluation based on mpmath function names. > I think you can get around it by defining an empty _eval_evalf(self, > prec) function. > > Aaron Meurer > > On Sat, Sep 6, 2014 at 1:50 PM, Duane Nykamp > wr

[sympy] implicit definition of log

2014-09-06 Thread Duane Nykamp
I really like the evaluate=False flag on parse_expr. But, since log(0.1) automatically evaluates to a float, I'm trying to create an unevaluated version of log. However, I'm getting strange results where log is implicitly defined. As shown below, once I define a function log that does nothi

Re: [sympy] Strange round behavior

2014-09-06 Thread Duane Nykamp
Thanks for fixing this! On Wednesday, September 3, 2014 8:32:34 PM UTC-5, Chris Smith wrote: > > It should work now in the most recent build. Thanks for reporting the > issue. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this

[sympy] Strange round behavior

2014-09-02 Thread Duane Nykamp
Is this the intended result of rounding to one decimal place? Sympy needs to go back to school on rounding. :) In [13]: S(0.06).round(1) Out[13]: 0.e-1 -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving

[sympy] Inconsistency between display and comparison on unevaluated operators

2014-04-29 Thread Duane Nykamp
I really like how unevaluated operators are working. However, one confusing aspect is that, on display, the operands are reordered to some standard order, but on comparison, the operator order matters. n [3]: Add(3,2,evaluate=False) Out[3]: 2 + 3 In [4]: Add(2,3,evaluate=False) Out[4]: 2 + 3

[sympy] Allowing bottom_up application of functions that may not change values

2014-03-31 Thread Duane Nykamp
I'd like to "fix" bottom_up so that the command bottom_up(sympify("2.0*x"), lambda w: w if not w.is_Number else Integer(w.round()), atoms=True) yields 2*x rather than 2.0*x. The problem is that for this case, the actual value is not changed so the modification is thrown out by the check

Re: [sympy] Print scientific notation using E rather than e

2013-10-26 Thread Duane Nykamp
; everywhere. There's no direct option > > to do this from the API, but since the printing system is completely > > extensible, and it's all open source, you can do what you want with > > little work. > > > > Aaron Meurer > > > > On Sat, Oct 2

[sympy] Print scientific notation using E rather than e

2013-10-26 Thread Duane Nykamp
I'm writing a sympy expression to a javascript snippet in an html page that is then interpreted by Geogebra to set parameters in an embedded applet. I'm just using the string printer, as I'm not having sympy actually output javascript code, just the mathematical expression like "3x**2+2." Un

[sympy] Splitting symbols and variable matching in parse_expr

2013-10-10 Thread Duane Nykamp
I'm using parse_expr to parse student input to online quizzes. Since I want them to be able to type in an answer as "xe^x" for x*exp(x) I have tried to do the following transformations. transformations=standard_transformations+(convert_xor, split_symbols, implicit_multiplication) The result i

[sympy] evalf keeping precision

2013-09-26 Thread Duane Nykamp
Is this intended behavior of evalf or N? It evaluates to the precision specified, but future calculations involving the number return to the previous precision. In [56]: x=Float("1.234567") In [57]: y=N(x,2) In [58]: y Out[58]: 1.2 In [59]: y*1.0 Out[59]: 1.234375 I was thinking it

[sympy] parse_expr and L for long int

2013-08-21 Thread Duane Nykamp
Is this the desired behavior of parse_expr? In [16]: parse_expr("2log(x)", transformations=(standard_transformations+ (implicit_multiplication,))) Out[16]: 2⋅og⋅x In [17]: parse_expr("2log(x)", transformations=(standard_transformations+ (implicit_multiplication_application,))) Out[17]: 2⋅g⋅o⋅x

Re: [sympy] controlling simplification

2013-05-06 Thread Duane Nykamp
AM, Aaron Meurer > > wrote: > >> The idea from https://code.google.com/p/sympy/issues/detail?id=3613 >> might also interest you. It's not simple to implement, but I think it >> wouldn't be too hard. >> >> Aaron Meurer >> >> On Wed, Mar 13, 2013

[sympy] Suggestions for parse_expr: global_dict, local_dict, and _implicit_application

2013-04-26 Thread Duane Nykamp
If implicit_application is included as a transformation, then _implicit_application checks the global_dict to see if a given token is a function before applying its logic. Is there a reason that it uses global_dict and not check first to see if a token is in local_dict? One might put a functi

Re: [sympy] Finding real roots of a polynomial, floats versus rational

2013-04-25 Thread Duane Nykamp
Thanks. On Thursday, April 25, 2013 9:51:46 AM UTC-5, smichr wrote: > > OK, here's something else that might be useful: > > >>> Poly(x**3-x+Rational('1/4')).real_roots() > [RootOf(4*x**3 - 4*x + 1, 0), RootOf(4*x**3 - 4*x + 1, 1), RootOf(4*x**3 - > 4*x + > 1, 2)] > >>> [w.n() for w in _] > [-1.1

[sympy] Finding real roots of a polynomial, floats versus rational

2013-04-25 Thread Duane Nykamp
Roots seems to work well finding real roots of polynomials with float coefficients. In [90]: roots(x**3-x+0.25, filter='R') Out[90]: {-1.10715987168877: 1, 0.269594436405445: 1, 0.837565435283323: 1} In [91]: roots(4*x**3-4*x+1., filter='R') Out[91]: {-1.10715987168877: 1, 0.269594436405445: 1,

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
Yes, combining bottom_up with Float-via-string does exactly what I need. Now, if a student types in the numbers as given in the solution, they will get that the answer is correct. That will lead to less grief. Thanks so much! Duane On Thursday, April 18, 2013 9:27:10 PM UTC-5, smichr wrote:

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
he first > 0. So h - h2 to 4 digits of precision is not 0. > > If you really want something like "2 decimal points", you should take > the difference and compare it against 1e-2 > > In [297]: abs(h - h2) < 1e-2 > Out[297]: True > > Aaron Meurer > >

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
> > A workaround would be to take out all Float instances, round them off > and substitute them: > > your_expression.subs([(orig_float, orig_float.evalf(3)) > for orig_float in expr.atoms(Float)]) > > On 18 April 2013 22:12, Duane Nyk

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
No, not at all. I guess I'm being unclear. ((5.333*x-1.234)*(2.251*x+5.234)).evalf(3) returns (2.25*x + 5.23)*(5.33*x - 1.23) which evaluates the numerical coefficients to a precision of three digits. So I was hoping that exp(5.3533*x).evalf(3) should return exp(5.35*x) which is the sam

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
On Thursday, April 18, 2013 1:19:11 PM UTC-5, Aaron Meurer wrote: > > On Thu, Apr 18, 2013 at 12:10 PM, Duane Nykamp > > > wrote: > > Another suggestion is to expose .evalf() on the Tuple class. Right now, > I > > have to treat it as a special case.

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
Another suggestion is to expose .evalf() on the Tuple class. Right now, I have to treat it as a special case. No big deal, but it would be consistent if a Tuple had an .evalf() method. if self._n_digits: try: if isinstance(expression,Tuple):

Re: [sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
Thanks for the suggestions. Silly me, since I think of evalf as converting to a float, I didn't think it would work for symbolic expressions. It seems to work fine with polynomials, but it doesn't recurse into functions like sin(x) and exp(x). In [14]: expr=3.21513*sin(2352.23432*x)+(x-3.2598

[sympy] Comparing expressions with floats to a given precision

2013-04-18 Thread Duane Nykamp
First of all, thanks for sympy and the help on this forum. I've been using sympy to create problems that automatically correct students answers. So far, it has been working pretty well, and I've succeeded in making questions such as these: http://mathinsight.org/assess/sample_questions I've

Re: [sympy] Latex format of one character function

2013-04-15 Thread Duane Nykamp
Great. That's good news. On Monday, April 15, 2013 12:24:16 PM UTC-5, Tom Bachmann wrote: > > This is actually just about to being fixed :-). > > https://github.com/sympy/sympy/pull/1981 > > On 15.04.2013 17:46, Duane Nykamp wrote: > > The latex printer formats

[sympy] Latex format of one character function

2013-04-15 Thread Duane Nykamp
The latex printer formats functions using "operatorname" even for functions of a single character. In [36]: f=Function('f') In [37]: x=Symbol('x') In [38]: latex(f(x)) Out[38]: '\\operatorname{f}{\\left (x \\right )}' which causes the f to be displayed so that it isn't italics. At least in t

Re: [sympy] parse_expr bugs

2013-04-08 Thread Duane Nykamp
I opened an issue at http://code.google.com/p/sympy/issues/detail?id=3738 On Monday, April 8, 2013 5:40:30 PM UTC-5, Aaron Meurer wrote: > > Yeah, they are bugs. Can you open an issue in our issue tracker for them? > > Aaron Meurer > > On Mon, Apr 8, 2013 at 11:3

[sympy] parse_expr bugs

2013-04-08 Thread Duane Nykamp
I think these are bugs in parse_expr. Sorry, my python expertise is insufficient to determine what is going on. In [80]: transformations=standard_transformations+(convert_xor,implicit_multiplication_application) In [81]: parse_expr("sin^2 (3x*E^(x))", transformations=transformations) Out[81]:

[sympy] Inconsistency of sympify/parse_expr for tuples

2013-04-06 Thread Duane Nykamp
If I enter ex1=sympify("(x,y)") then ex1 is a standard python tuple of sympy Symbols, which it gets from parse_expr However, if I apply sympify a second time to those results ex2=sympify(sympify("(x,y)")) then ex2 is a sympy Tuple, and I can do things like ex2.subs(Symbol('x'),3) It's easy enough

Re: [sympy] substitutions with unicode

2013-03-28 Thread Duane Nykamp
On Thursday, March 14, 2013 1:19:36 AM UTC-5, Aaron Meurer wrote: > > > You can also mimic a whitelist by blacklisting everything you don't > want. For example: > > all_names = {} > good_names = {'cos': cos, ...} > exec "from sympy import *" in all_names > bad_names_set = set(all_names.keys(

Re: [sympy] Delaying evaluation of functions

2013-03-26 Thread Duane Nykamp
Thanks, Duane On Tuesday, March 26, 2013 3:18:13 PM UTC-5, Mateusz Paprocki wrote: > > Hi, > > On 26 March 2013 21:00, Duane Nykamp > > wrote: > > I'd like to delay evaluation of functions like gcd so that I can have > users > > enter an expression like

[sympy] Delaying evaluation of functions

2013-03-26 Thread Duane Nykamp
I'd like to delay evaluation of functions like gcd so that I can have users enter an expression like gcd(a,b), where a and b will be replaced by numbers. If I just enter gcd(a,b), it finds the gcd of the polynomials a and b, which is one. Based on earlier feedback I receive here and by trial

Re: [sympy] Confused about equality with symbols

2013-03-26 Thread Duane Nykamp
to have folks enter. (I was quite confused for awhile as x < y didn't evaluate right away but x==y did. But, eventually, I realized I could use Eq(x,y), .) Thanks, Duane On Tuesday, March 26, 2013 2:17:51 PM UTC-5, Aaron Meurer wrote: > > On Tue, Mar 26, 2013 at 9:42 AM, Duane N

[sympy] Confused about equality with symbols

2013-03-26 Thread Duane Nykamp
I'm trying to understand how equality works with symbols. In particular, this behavior confuses me: In [70]: from sympy.abc import x In [71]: bool(x != x) Out[71]: False In [72]: bool(Not(x==x)) Out[72]: False In [73]: bool(Not(Eq(x,x))) Out[73]: True In [74]: bool(Eq(x,x)) Out[74]: True Wh

Re: [sympy] substitutions with unicode

2013-03-13 Thread Duane Nykamp
> > If you'd rather blacklist than whitelist, just manually convert any > name that you don't want to be mapped to the sympy function in your > locals dict, like > > parse_expr(expression, {'var': Symbol('var')}) > > (this is also how you hav

[sympy] substitutions with unicode

2013-03-13 Thread Duane Nykamp
This problem has vexed me for awhile, and I finally figured out the problem. The subs command treats unicode differently than strings, so unicode matching was giving strange results. I've been using parse_expr to allow input from entries in a web page. To allow folks to use strings like 'var'

Re: [sympy] controlling simplification

2013-03-13 Thread Duane Nykamp
11, 2013, at 10:58 PM, Duane Nykamp > > wrote: > > Getting closer. With > > class UnevaluatedAdd(Expr): > def _sympystr(self, printer): > return "%s + %s" % (printer._print(self.args[0]), > printer._print(self.args[1])) > > parse_expr("x+1&q

Re: [sympy] controlling simplification

2013-03-11 Thread Duane Nykamp
Aaron Meurer wrote: > > On Mon, Mar 11, 2013 at 9:38 PM, Duane Nykamp > > > wrote: > > Thanks for your responses. > > > > I was pretty sure parse_expr was secure, given how it tokenizes before > it > > uses an eval. > > > > The Unevalu

Re: [sympy] controlling simplification

2013-03-11 Thread Duane Nykamp
Thanks for your responses. I was pretty sure parse_expr was secure, given how it tokenizes before it uses an eval. The UnevaluatedLog example does exactly what I want for log. However, I cannot figure out how to extend it to an Add or Mul that I get from a parsed input. In many of the exam

[sympy] controlling simplification

2013-03-11 Thread Duane Nykamp
I just discovered sympy. The parse_expr function is just what I needed to allow folks to enter mathematics in a web page and have it be turned into math. Thanks a lot! I have a newbie question. How does one control the degree of simplification so that sympy doesn't automatically convert the