[sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Paul Royik
I noticed this issue with simplify function. Is this possible? -- 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+unsubscr...@googlegroups.com. To post to this group

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Ondřej Čertík
On Mon, Nov 23, 2015 at 10:31 AM, Paul Royik wrote: > I noticed this issue with simplify function. > Is this possible? It's possible, e.g. maybe you use a different Python or SymPy versions, perhaps you executed things differently, or perhaps there is some hardware difference that causes Python t

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Paul Royik
Python 2.7, last version of sympy. Code is absolutely the same. How to detect hardware difference? How to clear cache? What info should I post? On Monday, November 23, 2015 at 7:42:58 PM UTC+2, Ondřej Čertík wrote: > > On Mon, Nov 23, 2015 at 10:31 AM, Paul Royik > wrote: > > I noticed this is

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Ondřej Čertík
Is it running the the exact same hardware? Cache is clear when you start it a script. You can also clear it by hand: https://github.com/sympy/sympy/wiki/Faq#how-do-i-clear-the-cache Send a minimal script that hangs, and we can try it on different computers and see if we can reproduce the issue.

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Paul Royik
minimal script is simplify(3*b**(1/Integer(3))-3, fu=True) On Monday, November 23, 2015 at 8:53:45 PM UTC+2, Ondřej Čertík wrote: > > Is it running the the exact same hardware? > > Cache is clear when you start it a script. You can also clear it by hand: > > https://github.com/sympy/sympy/wiki/F

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Ondřej Čertík
I had to also execute var("b"): In [1]: var("b") Out[1]: b In [2]: simplify(3*b**(1/Integer(3))-3, fu=True) Out[2]: 3 ___ 3⋅╲╱ b - 3 It return immediately. Can you run this on your remote machine, let it run for a while in an IPython notebook and then hit ctrl-c? It should print a stacktrace

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Ondřej Čertík
On Mon, Nov 23, 2015 at 12:01 PM, Ondřej Čertík wrote: > I had to also execute var("b"): > > In [1]: var("b") > Out[1]: b > > In [2]: simplify(3*b**(1/Integer(3))-3, fu=True) > Out[2]: > 3 ___ > 3⋅╲╱ b - 3 > > > It return immediately. Can you run this on your remote machine, let it > run for a

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Aaron Meurer
What are the different results that you get? And how is b defined (are there any assumptions on it)? Aaron Meurer On Mon, Nov 23, 2015 at 12:56 PM, Paul Royik wrote: > minimal script is simplify(3*b**(1/Integer(3))-3, fu=True) > > On Monday, November 23, 2015 at 8:53:45 PM UTC+2, Ondřej Čertík w

Re: [sympy] Re: [sage-support] Fwd: [sage-release] Bug in limit?

2015-11-23 Thread Aaron Meurer
(note, I am not on the sage list or gms list, so this probably won't make it there unless someone forwards it) SymPy's limit primarily uses the Gruntz algorithm, which is fairly capable. I'm not an expert on it, so others will be able to comment in more detail, but as far as I know, it's mostly re

[sympy] Re: [sage-support] Fwd: [sage-release] Bug in limit?

2015-11-23 Thread Ondřej Čertík
On Mon, Nov 23, 2015 at 12:20 PM, Dima Pasechnik wrote: > > > On Monday, 23 November 2015 00:43:02 UTC, William wrote: >> >> This definitely looks like a bug. In the meantime, a workaround is to >> use sympy: >> >> sage: var('m a0') >> (m, a0) >> sage: x=2/5*((3/4)^m - 1)*(a0 - 100) + 1/5*(3*

[sympy] Problem of function libraries in lambdify

2015-11-23 Thread Emile59
Hello, I am currently developping a python program to tranform a symbolic expression computed by `sympy` into a `numpy` array containing all the numerical values. I instantiate the symbolic expression with the `sympy.lambdify` function. Some of the symbolic expressions contain Bessel function

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Paul Royik
Found code that doesn't work: simplify(parse_expr('3*b**(333/1000) - 3'),fu=True) This hangs on remote. When I hit Ctrl+C, it gives /home/simamura/lib/python2.7/sympy/polys/polytools.pyc in cancel(f, *gens, **args) 6228 6229 try: -> 6230 (F, G), opt = p

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Paul Royik
On my local machine I got overflowerror that is silently ignored. On Monday, November 23, 2015 at 9:03:10 PM UTC+2, Aaron Meurer wrote: > > What are the different results that you get? And how is b defined (are > there any assumptions on it)? > > Aaron Meurer > > On Mon, Nov 23, 2015 at 12:56 P

[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

[sympy] Re: [sage-support] Fwd: [sage-release] Bug in limit?

2015-11-23 Thread William Stein
On Mon, Nov 23, 2015 at 12:17 PM, Dima Pasechnik wrote: > > > On Monday, 23 November 2015 19:38:39 UTC, Ondrej Certik wrote: >> >> On Mon, Nov 23, 2015 at 12:20 PM, Dima Pasechnik wrote: >> > >> > >> > On Monday, 23 November 2015 00:43:02 UTC, William wrote: >> >> >> >> This definitely looks like

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Aaron Meurer
It's likely a memory difference. SymPy is trying to use a dense representation to represent a degree 333 polynomial, i.e., create a list with 333 elements. This is going to fail no matter what machine you run it on. This is really an issue with SymPy (it should be using a sp

Re: [sympy] Is it possible that code works on local machine but hangs on remote?

2015-11-23 Thread Paul Royik
On my local machine I got OverflowError can convert to python long... On Monday, November 23, 2015 at 10:46:44 PM UTC+2, Aaron Meurer wrote: > > It's likely a memory difference. SymPy is trying to use a dense > representation to represent a degree 333 polynomial, i.e., > create a lis

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

2015-11-23 Thread Aaron Meurer
Function("P") is just syntactic sugar. As you can see from the constructor, it's the same as UndefinedFunction("P"). If you want to customize the behavior, you should subclass UndefinedFunction. However, in this case, it looks like UndefinedFunction("P", is_commutative=True) works. Aaron Meurer

Re: [sympy] Problem of function libraries in lambdify

2015-11-23 Thread Aaron Meurer
On Mon, Nov 23, 2015 at 1:38 PM, Emile59 wrote: > Hello, > > I am currently developping a python program to tranform a symbolic > expression computed by `sympy` into a `numpy` array containing all the > numerical values. I instantiate the symbolic expression with the > `sympy.lambdify` function. >

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

2015-11-23 Thread Duane Nykamp
Yeah, I was stuck in a rut so that it took me until I stepped away for a bit to realize the same conclusion! I didn't realize I could just add the is_commutative flag to UndefinedFunction, so I like your solution better than mine, where I had ended up subclassing AppliedUndef (as that is the su