[sympy] Re: __str__ and __repr__ confusion

2008-06-20 Thread Pearu Peterson
On Jun 20, 11:42 am, Ondrej Certik [EMAIL PROTECTED] wrote: Also, let's get rid of set_repr_level()? This is quite an important change, so I'd like to hear opinions of others as well. We already had this discussion in the past: http://code.google.com/p/sympy/issues/detail?id=697 And

[sympy] Re: performance benchmarks

2008-06-10 Thread Pearu Peterson
On Jun 9, 11:13 pm, Gary Furnish [EMAIL PROTECTED] wrote: After Pearu suggested I give the microbenchmark on sympycore a try, I can't seem to get more then 9000 expands on recent hardware. I am running: In [54]: a,b,c = Rational(1,2), Rational(2,3), Rational(4,5) In [64]: %timeit (3*(a*x +

[sympy] Re: sympify and matrices

2008-06-09 Thread Pearu Peterson
Hi, Just a quick note that could be relevant to the discussion: check also out http://code.google.com/p/sympycore/wiki/MatrixSupportIdeas that contains ideas how to deal with mutable matrices in operations where they should be immutable, all in a very efficient way. The idea is based on using

Re: Constant factors

2008-02-18 Thread Pearu Peterson
Hi! I hope you don't mind if I will explain how things work in sympycore regarding this issue which seem to come up again and again. On Feb 17, 9:36 pm, Mateusz Paprocki [EMAIL PROTECTED] wrote: Is it a bad thing? This can be changed if needed. This is at least a bit inconsistent: In

Re: Constant factors

2008-02-18 Thread Pearu Peterson
On Feb 18, 5:34 pm, Mateusz Paprocki [EMAIL PROTECTED] wrote: Nice list Pearu. After analyzing all of the rules, the only questionable one is 2*(x+y) (as it was usually in the history) or more generally speaking eg: 2*(x**2-2)*(x+1) and similar. Currently we have the following behavior:

Re: python question

2008-02-05 Thread Pearu Peterson
On Feb 5, 3:04 pm, Alan Bromborsky [EMAIL PROTECTED] wrote: This is for the python experts. In some sample python code I downloaded I see '@' preceding some lines in the .py file. I have searched my python books and the web an cannot find a reference (probably because I don't know how to

Updated performance results

2008-01-23 Thread Pearu Peterson
Hi, The sympy/sympycore comparision page http://code.google.com/p/sympycore/wiki/Performance has been updated. Speedups for varios tasks start with 18x and go up to 380x when using the new sympycore with algebra backend. Best regards, Pearu

Performance history of SymPy and Sympy Core projects

2008-01-03 Thread Pearu Peterson
Hi all! The following page reports how the performance of SymPy and Sympy Core has changed during the development of the sympy package: http://code.google.com/p/sympycore/wiki/PerformanceHistory Note that the used test case measures mostly the efficiency of the creation of symbolic expressions

Re: numpy problem

2008-01-02 Thread Pearu Peterson
On Jan 2, 6:29 pm, Alan Bromborsky [EMAIL PROTECTED] wrote: I thought the below was a work around to the numpy sympy interaction problem. I guess it was not. from numpy import * from sympy import * x = Symbol('a') print x a X = array([x],dtype=object) print X [] Hmm,

Re: Problem with numpy and sympy

2008-01-01 Thread Pearu Peterson
On Jan 1, 12:26 am, Alan Bromborsky [EMAIL PROTECTED] wrote: Do we have a problem here? Can we make a numpy array of sympy symbols? import swiginac import numpy a = swiginac.symbol('AB') a AB A = numpy.array([a]) A array([AB], dtype=object) import sympy a =

Re: Sympy.core

2007-12-30 Thread Pearu Peterson
On Dec 31, 6:55 am, Goutham D L [EMAIL PROTECTED] wrote: I came across many places where there is code like Basic.Zero() , Basic.Add(), Basic.Integer() etc. However, None of these seem to be defined in the Basic class (or in the metaclass). Am i missing something? The attributes

Re: Possible bug in SymPy

2007-12-29 Thread Pearu Peterson
On Dec 29, 4:03 pm, David [EMAIL PROTECTED] wrote: The following code produces an AssertionError: two = Rational(2) if two: doSomething() Using this idiom with sympy objects is not recommended and the error is raised to avoid using it from the beggining (the error message should be

Re: :backmultiplication with sympy objects

2007-12-28 Thread Pearu Peterson
On Dec 28, 9:11 am, kent-and [EMAIL PROTECTED] wrote: class Foo: def __init__(self): self.field = 1.0 def __mul__(self, other): print Multiplication in Foo from right self.field = self.field * other def __rmul__(self, other): print

Re: :backmultiplication with sympy objects

2007-12-28 Thread Pearu Peterson
On Dec 28, 10:12 am, Ondrej Certik [EMAIL PROTECTED] wrote: On Dec 28, 2007 10:18 AM, Pearu Peterson [EMAIL PROTECTED] wrote: Try deriving Foo from sympy.Basic. Actually the __mul__ code in sympy is broken as it should return NotImplemented when it gets an unknown (to sympy) object

Re: some thoughts on object oriented design in C

2007-12-27 Thread Pearu Peterson
On Dec 27, 8:20 pm, Ondrej Certik [EMAIL PROTECTED] wrote: And when one doesn't neet the whole machinery (it's probably an overkill for our purposes), one can just use structs with function pointers, as described in my previous email. I think that even writing sympy in C/C++ is an overkill.

Re: Writing the core in C++

2007-11-13 Thread Pearu Peterson
Here's a status report of sympycore project: The sympycore sympy.core package is quite stable, It is about 1016 lines of code and has 94% of tests coverage. I am currently working on sympy.artithmetics package to make Add, Mul instances iterable efficiently, in fact, at the moment I expect