[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: Whoops, I tested the wrong branch, getting a proper abort() now. :) -- ___ Python tracker ___ ___

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: The tests pass here on Linux with 3.8 (cc60cdd9c4) and a very low sys.setrecursionlimit(150). The fail properly with RecursionError at sys.setrecursionlimit(125). So I guess we'd need a gdb stack trace from OS X in case there's a CPython issue that is OS X

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: It can still be an issue in CPython, like in #14537. -- ___ Python tracker ___ ___ Python-bugs-list

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: This occurs when handling a recursion error uses more than 50 extra nested function calls: if (tstate->overflowed) { if (tstate->recursion_depth > recursion_limit + 50) { /* Overflowing while handling an overflow. Give up. */

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Rémi Lapeyre
when a RecursionError is not handled quickly enough. I suppose you just have a problem in Sympy. I also find suspicious that you reproducer change many lines in Sympy and would look at that first. -- nosy: +remi.lapeyre ___ Python tracker <ht

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-19 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: >From the stack trace it looks like some kind of recursion occurs on the tests >causing the crash. Sympy is not a part of stdlib. Can you please add a pure >Python reproducer or this is something that needs to be fixed by reporting to &g

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-19 Thread Aaron Meurer
New submission from Aaron Meurer : I am getting a Fatal Python error: Cannot recover from stack overflow. running the SymPy tests on a branch of mine where the tests fail. I have reproduced this in Python 3.6.7, as well as CPython master (fc96e5474a7bda1c5dec66420e4467fc9f7ca968). Here

how to override the solver function in sympy?

2016-12-03 Thread Ho Yeung Lee
how to override the solver function in sympy? -- https://mail.python.org/mailman/listinfo/python-list

Re: sympy

2016-03-31 Thread Oscar Benjamin
On 31 March 2016 at 22:33, Poul Riis <prii...@gmail.com> wrote: > Den onsdag den 30. marts 2016 kl. 13.17.33 UTC+2 skrev Poul Riis: >> Is it possible to transfer results from sympy to 'normal' python. >> >> In the case below I think my intention is clear enough but it do

Re: sympy

2016-03-31 Thread Poul Riis
Den onsdag den 30. marts 2016 kl. 13.17.33 UTC+2 skrev Poul Riis: > Is it possible to transfer results from sympy to 'normal' python. > > In the case below I think my intention is clear enough but it does not work > as intended. How can it be done? > > Poul Riis > > &

Re: sympy

2016-03-31 Thread Oscar Benjamin
On 31 March 2016 at 11:57, Poul Riis <prii...@gmail.com> wrote: > > ... However, the sympy way seems to be about 70 times slower than using the > derivative calculated 'by hand' (try the example below). > Can it be done in a more efficient way? > > Poul Riis > >

Re: sympy

2016-03-31 Thread Peter Otten
Chris Angelico wrote: > On Fri, Apr 1, 2016 at 1:55 AM, Peter Otten <__pete...@web.de> wrote: >> Hm, the two functions fmsympy() and fm() do not return the same value: >> >> $ python -i sympy_diff.py >> 1 evaluations with sympy : dt1 = 0.7178411483764648 &g

Re: sympy

2016-03-31 Thread Chris Angelico
On Fri, Apr 1, 2016 at 1:55 AM, Peter Otten <__pete...@web.de> wrote: > Hm, the two functions fmsympy() and fm() do not return the same value: > > $ python -i sympy_diff.py > 1 evaluations with sympy : dt1 = 0.7178411483764648 > 1 evaluations without sympy: dt2

Re: sympy

2016-03-31 Thread Peter Otten
Poul Riis wrote: > Den onsdag den 30. marts 2016 kl. 17.59.49 UTC+2 skrev Steven D'Aprano: >> On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: >> >> > What I intend to do is to let sympy find the derivative of some >> > welldefined function and next

Re: sympy

2016-03-31 Thread Poul Riis
Den onsdag den 30. marts 2016 kl. 17.59.49 UTC+2 skrev Steven D'Aprano: > On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: > > > What I intend to do is to let sympy find the derivative of some > > welldefined function and next define the foundation derivative as a normal > >

Re: sympy

2016-03-31 Thread Poul Riis
Den torsdag den 31. marts 2016 kl. 06.49.34 UTC+2 skrev Gregory Ewing: > Steven D'Aprano wrote: > > On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: > > > >>What I intend to do is to let sympy find the derivative of some > >>welldefined function and next define the

Re: sympy

2016-03-30 Thread Gregory Ewing
Steven D'Aprano wrote: On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: What I intend to do is to let sympy find the derivative of some welldefined function and next define the foundation derivative as a normal function py> ftext.evalf(subs={x:3}) -0.0600 Given all that, it lo

Re: sympy

2016-03-30 Thread Steven D'Aprano
On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: > What I intend to do is to let sympy find the derivative of some > welldefined function and next define the foundation derivative as a normal > function so that I can calculate numerical values or even make a graph. I'm glad you explained

Re: sympy

2016-03-30 Thread Robert Kern
On 2016-03-30 16:23, Poul Riis wrote: What I intend to do is to let sympy find the derivative of some welldefined function and next define the foundation derivative as a normal function so that I can calculate numerical values or even make a graph. http://docs.sympy.org/dev/modules/utilities

Re: sympy

2016-03-30 Thread Poul Riis
What I intend to do is to let sympy find the derivative of some welldefined function and next define the foundation derivative as a normal function so that I can calculate numerical values or even make a graph. -- https://mail.python.org/mailman/listinfo/python-list

Re: sympy

2016-03-30 Thread Steven D'Aprano
On Wed, 30 Mar 2016 10:17 pm, Poul Riis wrote: > Is it possible to transfer results from sympy to 'normal' python. > > In the case below I think my intention is clear enough but it does not > work as intended. How can it be done? How can what be done? Unfortunately, we're not able

Re: sympy

2016-03-30 Thread Ned Batchelder
On Wednesday, March 30, 2016 at 7:17:33 AM UTC-4, Poul Riis wrote: > Is it possible to transfer results from sympy to 'normal' python. Poul, welcome to the group. > In the case below I think my intention is clear enough but it does not work > as intended. How can it be done? >

Re: sympy

2016-03-30 Thread Ben Finney
Poul Riis <prii...@gmail.com> writes: > Is it possible to transfer results from sympy to 'normal' python. Is Sympy not “normal Python”? What transfer are you intending? > In the case below I think my intention is clear enough but it does not > work as intended. How can it

sympy

2016-03-30 Thread Poul Riis
Is it possible to transfer results from sympy to 'normal' python. In the case below I think my intention is clear enough but it does not work as intended. How can it be done? Poul Riis from sympy import * x=Symbol('x') ftext=diff(1/(x**2+1),x) def f(t): return ftext.subs(x,'t') print

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2014-10-10 Thread R. David Murray
R. David Murray added the comment: This code fragment doesn't seem to exist any more. Since there's no test case, I'm going to close this. I presume it is no longer a problem for SymPy, since there's been no followup. -- nosy: +brett.cannon, r.david.murray resolution: - out of date

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2014-10-10 Thread Aaron Meurer
Aaron Meurer added the comment: The OP describes how to get the original code. Anyway, the issue was definitely fixed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2014-10-10 Thread Aaron Meurer
Aaron Meurer added the comment: Or do you mean the code in CPython doesn't exist any more? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2014-10-10 Thread R. David Murray
R. David Murray added the comment: Yes, it appears that the code does not exist in import.c any more. When I said test case, I meant unit test, sorry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537

Re: Error after sympy lambdify function update using vector() dot.class

2014-07-12 Thread Chris Angelico
On Sat, Jul 12, 2014 at 3:33 AM, Niklas Troedsson niklastroeds...@yahoo.com.dmarc.invalid wrote: I am new to the forum and programming Python. Recently I updated both Canopy and its packages, I am now using Canopy 1.4.1.1975 and sympy 0.7.5-1. This is a general Python list, not Canopy

Error after sympy lambdify function update using vector() dot.class

2014-07-11 Thread Niklas Troedsson
I am new to the forum and programming Python. Recently I updated both Canopy and its packages, I am now using Canopy 1.4.1.1975 and sympy 0.7.5-1. In an earlier version my code to solve algebra and substitute a lot of constants and transfer functions with more than 1001 frequency points worked

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2014-02-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I didn't tested this patch with SymPy, but in general it LGTM. -- assignee: - haypo nosy: +serhiy.storchaka stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537

Debug (sympy-Function; lambdify)

2013-10-11 Thread Surbhi Gupta
This is the code I m trying to run: from sympy import * import numpy as np from sympy import symbols def deriv(x,t): a = array(x) for i in range(0,len(x)): temp = x[i] a[i] = temp[0].diff(t) return a def matrixmult (A, B): C = [[0 for row in range(len

Re: Debug (sympy-Function; lambdify)

2013-10-11 Thread Marco Buttu
On 10/11/2013 08:28 AM, Surbhi Gupta wrote: This is the code I m trying to run: from sympy import * import numpy as np from sympy import symbols def deriv(x,t): a = array(x) for i in range(0,len(x)): temp = x[i] a[i] = temp[0].diff(t) return a def matrixmult

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread Aaron Meurer
New submission from Aaron Meurer asmeu...@gmail.com: Recently, after a small seemingly unrelated refactoring, the SymPy test suite in Python 3 started dying with Fatal Python error: Cannot recover from stack overflow. Here's how to reproduce the error git clone git://github.com/sympy

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: It looks like an issue in SymPy, a stack overflow. Why did you report this issue on CPython bug tracker? Is there an infinite loop in a recursive function call? Can you try to get the full Python traceback using faulthandler? Use -X

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread Aaron Meurer
Aaron Meurer asmeu...@gmail.com added the comment: We do have a stack overflow, but this should be raising a RuntimeError, not killing Python. The way it is now, Python dies completely with abort trap 6 (hence the Mac OS X problem report). Sorry if I didn't make this clear in the OP.

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: SymPy uses a C extension, numpy. The problem may be related to numpy. CPython tries to catch segmentation fault, but when a C extension is used, CPython may fail to protect your program against stack overflow

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread Aaron Meurer
Aaron Meurer asmeu...@gmail.com added the comment: No it does not. SymPy is a pure Python library. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537

[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite

2012-04-09 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: The (first) Python stack overflow occurs at: --- (gdb) py-bt Traceback (most recent call first): File /home/haypo/issue14537/sympy/py3k-sympy/sympy/core/expr.py, line 2531, in expand from sympy.simplify.simplify import

sympy returns a dictionary sometimes, and sometimes a list of tuples...why?

2009-09-30 Thread Brian Blais
Hello, I wrote a very simple script using sympy, and things were working fine, except for one problem. So I have: from sympy import * x, y = symbols('x','y',real=True) alpha,beta,gamma=symbols('alpha','beta','gamma',real=True) alpha_p,beta_p,gamma_p=symbols('alpha_p','beta_p','gamma_p

Re: sympy returns a dictionary sometimes, and sometimes a list of tuples...why?

2009-09-30 Thread Robert Kern
Brian Blais wrote: Hello, I wrote a very simple script using sympy, and things were working fine, except for one problem. So I have: You will probably want to ask on the sympy mailing list: http://groups.google.com/group/sympy from sympy import * x, y = symbols('x','y',real=True

[issue4290] 2to3 fails with sympy

2008-11-10 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: You would like to replace from mptypes import ... by from .mptypes import Is it really a bug? Python is unable to guess if mptypes, functions or settings are global modules or relative modules. Why don't you patch your original code

[issue4290] 2to3 fails with sympy

2008-11-10 Thread Ondrej Certik
Ondrej Certik [EMAIL PROTECTED] added the comment: Hi Victor, thanks for the comments. I copied them to the issue 4292 where they belong and replied there. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4290

[issue4290] 2to3 fails with sympy

2008-11-10 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Second metaclass problem fixed in r67178. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4290

[issue4290] 2to3 fails with sympy

2008-11-10 Thread Ondrej Certik
Ondrej Certik [EMAIL PROTECTED] added the comment: I can confirm this is now fixed. Thanks very much! ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4290 ___ ___

[issue4290] 2to3 fails with sympy

2008-11-09 Thread Christian Heimes
Changes by Christian Heimes [EMAIL PROTECTED]: -- assignee: - benjamin.peterson components: +2to3 (2.x to 3.0 conversion tool) nosy: +benjamin.peterson priority: - normal stage: - test needed type: - behavior versions: +Python 2.6 ___ Python

[issue4290] 2to3 fails with sympy

2008-11-09 Thread Ondrej Certik
New submission from Ondrej Certik [EMAIL PROTECTED]: Download my branch of sympy from here: http://github.com/certik/sympy/tree/division3 and run the 2to3 tool with python2.5: $ python2.5 ../2to3/2to3 sympy/ [...] Traceback (most recent call last): File ../2to3/2to3, line 6, in module

[issue4290] 2to3 fails with sympy

2008-11-09 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: I've fixed the first problem in r67177, but I found another one in thirdparty/pyglet. Try running with -x metaclass. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4290

[issue4290] 2to3 fails with sympy

2008-11-09 Thread Ondrej Certik
Ondrej Certik [EMAIL PROTECTED] added the comment: Thanks, that was quick! You can delete the thirdparty/pyglet, it's not imported by default. Then the 2to3 passes. But I found another bug: issue 4292 ___ Python tracker [EMAIL PROTECTED]

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Robert Kern
Fredrik Lundh wrote: Mensanator wrote: I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time. Given that 2.5 explicitly warns about this specific change: as = 1 stdin:1: Warning: 'as' will become

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Fredrik Lundh
Robert Kern wrote: No warnings show up when importing the offending module: Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type help, copyright, credits or license for more information. from sympy.mpmath import specfun So what

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Terry Reedy
Fredrik Lundh wrote: Robert Kern wrote: (if someone wants to submit this to bugs.python.org, be my guest) http://bugs.python.org/issue3936 -- http://mail.python.org/mailman/listinfo/python-list

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-21 Thread Mensanator
On Sep 21, 4:37 am, Fredrik Lundh [EMAIL PROTECTED] wrote: Mensanator wrote: I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time. Given that 2.5 explicitly warns about this specific change

Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Mensanator
use as for a variable: for as in xrange(10): print as works just fine, although it shouldn't. Python 2.6 fixes this discrepency and now gives you a syntax error if you use as for a variable name. The upshot is code (such as sympy) written prior to 2.6 can crash now due to this fix if said code

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Guilherme Polo
noticed the warning you received in python 2.5 when using as as a name. The upshot is code (such as sympy) written prior to 2.6 can crash now due to this fix if said code inadverntently used what should have been a reserved word. I was able to fix the code for this as problem, but not the one

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Mensanator
a syntax error if you use as for a variable name. You should have noticed the warning you received in python 2.5 when using as as a name. I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time

Re: sympy: what's wrong with this picture?

2008-03-05 Thread Nanjundi
On Mar 4, 3:13 pm, Mensanator [EMAIL PROTECTED] wrote: On Mar 4, 12:32 pm, Nanjundi [EMAIL PROTECTED] wrote: Does seeding ( random.seed ) random with time fix this? It should. I suppose that depends on how long it takes factorint() to process a number. If the seed is reset before the next

Re: sympy: what's wrong with this picture?

2008-03-05 Thread Mensanator
have saved the state of my random number generator s=random.getstate() and then restored it after calling factorint(), random.setstate(s). import sympy # with RK's patch removed import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f

Re: sympy: what's wrong with this picture?

2008-03-05 Thread Nanjundi
it the right to mess with the state of the random number generator _I'm_ using. Had I actually known what was happening, I could have saved the state of my random number generator s=random.getstate() and then restored it after calling factorint(), random.setstate(s). import sympy # with RK's patch

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Erik Max Francis
Mensanator wrote: On Mar 3, 11:58 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: I'm not hard to please at all. No, of course not, since logically you must think all software is useless. Somehow, I expected better logic from people who call themselves programmers. So you

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Lie
On Mar 4, 1:12 pm, Mensanator [EMAIL PROTECTED] wrote: On Mar 3, 11:58 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: While we're on the subject of English, the word worthless means has no value. So, a program that doesn't work would generally be worthless. One that

Re: sympy: what's wrong with this picture?

2008-03-04 Thread castironpi
On Mar 4, 10:50 am, Lie [EMAIL PROTECTED] wrote: On Mar 4, 1:12 pm, Mensanator [EMAIL PROTECTED] wrote: On Mar 3, 11:58 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: While we're on the subject of English, the word worthless means has no value. So, a program

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Nanjundi
On Mar 3, 3:40 pm, Mensanator [EMAIL PROTECTED] wrote: Notice anything funny about the random choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f) print f1, f2 = random.choice(f) print f2, C

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 2:44 am, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: On Mar 3, 11:58 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: I'm not hard to please at all. No, of course not, since logically you must think all software is useless. Somehow, I expected

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 10:50 am, Lie [EMAIL PROTECTED] wrote: On Mar 4, 1:12 pm, Mensanator [EMAIL PROTECTED] wrote: On Mar 3, 11:58 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: While we're on the subject of English, the word worthless means has no value. So, a program

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 12:32 pm, Nanjundi [EMAIL PROTECTED] wrote: On Mar 3, 3:40 pm, Mensanator [EMAIL PROTECTED] wrote: Notice anything funny about the random choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10):   f1

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Istvan Albert
On Mar 4, 3:13 pm, Mensanator [EMAIL PROTECTED] wrote: But what if _I_ wanted to make a repeatable sequence for test purposes? Wouldn't factorint() destroy my attempt by reseeding on every call? Would it? It may just be that you are now itching to see a problem even where there isn't one.

Re: sympy: what's wrong with this picture?

2008-03-04 Thread bearophileHUGS
apatheticagnostic: I swear, this is one of the most polite-oriented groups I've ever seen. Not that that's a bad thing or anything, it's nice to be nice. Yep, and with lot more work it may even become a bit fit for women/ females too. Bye, bearophile --

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 3:00 pm, Istvan Albert [EMAIL PROTECTED] wrote: On Mar 4, 3:13 pm, Mensanator [EMAIL PROTECTED] wrote: But what if _I_ wanted to make a repeatable sequence for test purposes? Wouldn't factorint() destroy my attempt by reseeding on every call? Would it? I don't know, haven't

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 4:40 pm, Mensanator [EMAIL PROTECTED] wrote: On Mar 4, 3:00 pm, Istvan Albert [EMAIL PROTECTED] wrote: On Mar 4, 3:13 pm, Mensanator [EMAIL PROTECTED] wrote: But what if _I_ wanted to make a repeatable sequence for test purposes? Wouldn't factorint() destroy my attempt by

sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
Notice anything funny about the random choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f) print f1, f2 = random.choice(f) print f2, C = f1*f2 ff = None ff = sympy.factorint(C) print ff

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 3:40 pm, Mensanator [EMAIL PROTECTED] wrote: Notice anything funny about the random choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f) print f1, f2 = random.choice(f) print f2, C

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 2:49 pm, Carl Banks [EMAIL PROTECTED] wrote: On Mar 3, 3:40 pm, Mensanator [EMAIL PROTECTED] wrote: Notice anything funny about the random choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10):   f1

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: On Mar 3, 2:49 pm, Carl Banks [EMAIL PROTECTED] wrote: It's just a bug--probably sympy is messing with the internals of the random number generator. It would be a simple fix. Instead of bing about it, file a bug report. I did. Or better yet, submit a patch

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 4:47 pm, Mensanator [EMAIL PROTECTED] wrote: On Mar 3, 2:49 pm, Carl Banks [EMAIL PROTECTED] wrote: On Mar 3, 3:40 pm, Mensanator [EMAIL PROTECTED] wrote: Notice anything funny about the random choices? import sympy import time import random f = [i for i

Re: sympy: what's wrong with this picture?

2008-03-03 Thread apatheticagnostic
I swear, this is one of the most polite-oriented groups I've ever seen. Not that that's a bad thing or anything, it's nice to be nice. (This has been Captain Universal Truth, over and out) -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 4:08 pm, Robert Kern [EMAIL PROTECTED] wrote: Mensanator wrote: On Mar 3, 2:49 pm, Carl Banks [EMAIL PROTECTED] wrote: It's just a bug--probably sympy is messing with the internals of the random number generator.  It would be a simple fix.  Instead of bing about it, file

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: On Mar 3, 4:08 pm, Robert Kern [EMAIL PROTECTED] wrote: Mensanator wrote: On Mar 3, 2:49 pm, Carl Banks [EMAIL PROTECTED] wrote: It's just a bug--probably sympy is messing with the internals of the random number generator. It would be a simple fix. Instead of bing

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10):   f1 = random.choice(f)   print f1,   f2 = random.choice(f)   print f2,   C = f1*f2   ff = None   ff = sympy.factorint(C)   print ff ##  7307 7243

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
: Notice anything funny about the random choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f) print f1, f2 = random.choice(f) print f2, C = f1*f2 ff

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
recommending going and trying it out. That is why they're making it available, isn't it? For people to try out so they can get free testing? Aren't I doing my part? Should I just uninstall it and forget it? Finding the issue and reporting it to the sympy bug tracker is commendable. Coming here and un

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 6:21 pm, Robert Kern [EMAIL PROTECTED] wrote: Mensanator wrote: On Mar 3, 4:08 pm, Robert Kern [EMAIL PROTECTED] wrote: Mensanator wrote: On Mar 3, 2:49 pm, Carl Banks [EMAIL PROTECTED] wrote: It's just a bug--probably sympy is messing with the internals of the random number

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
it to the sympy bug tracker is commendable. Coming here and un-recommending sympy before the issue was resolved is not. Bad choice of words I guess. I'll try to keep that in mind. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma   that is made terrible

Re: sympy: what's wrong with this picture?

2008-03-03 Thread castironpi
All software has bugs. Good software has bugs. Therefore, good software is software. This makes sympy worse than worthless, as it f***s up other modules. What is it still good for? -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Erik Max Francis
Mensanator wrote: While we're on the subject of English, the word worthless means has no value. So, a program that doesn't work would generally be worthless. One that not only doesn't work but creates side effects that cause other programs to not work (which don't have bugs) would be worse

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 8:31 pm, [EMAIL PROTECTED] wrote: All software has bugs. Good software has bugs. Therefore, good software is software. This makes sympy worse than worthless, as it f***s up other modules. What is it still good for? Lots. The problem is when the total is less than the sum

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 11:58 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Mensanator wrote: While we're on the subject of English, the word worthless means has no value. So, a program that doesn't work would generally be worthless. One that not only doesn't work but creates side effects that cause

sympy: nifty, but... (was: How about adding rational fraction to Python?)

2008-03-02 Thread Mensanator
On Mar 1, 12:29 pm, Anand Patil [EMAIL PROTECTED] wrote: Not sure if this is common knowledge yet but Sympy,http://code.google.com/p/sympy, has a rational type. I hadn't heard of this before, thanks for the link. Very nifty, lots of goodies not found in gmpy (although it seems to lack

Help with sympy, please

2007-11-18 Thread Dick Moores
from __future__ import division Here's what I'm trying to do, but using sympy: = from math import e n = 1 prod = 1 k = 0 while k 1000: k += 1 term = (e**(1.0/n))/(e**(1.0/(n+1))) prod *= term n += 2 print prod, term

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
At 03:42 PM 11/18/2007, Dennis Lee Bieber wrote: On Sun, 18 Nov 2007 13:02:01 -0800, Dick Moores [EMAIL PROTECTED] declaimed the following in comp.lang.python: This gets: Traceback (most recent call last): File E:\PythonWork\Untitled 5.py, line 20, in module term =

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
in sympy.numerics.functions instead to compute e**x. Basically, sympy.numerics is an old version of mpmath. The sympy.numerics module is not very well integrated in SymPy, slower than mpmath, and has a couple bugs that have subsequently been fixed in mpmath. In sympycore (http://code.google.com/p/sympycore

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
does not implement ** for fractional numbers. You could use the exp function in sympy.numerics.functions instead to compute e**x. Thanks, Fredrik, but I get the same error using either exp or power: from __future__ import division from sympy import * from sympy import

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
At 04:26 PM 11/18/2007, Fredrik Johansson wrote: Basically, sympy.numerics is an old version of mpmath. The sympy.numerics module is not very well integrated in SymPy, slower than mpmath, and has a couple bugs that have subsequently been fixed in mpmath. In sympycore (http://code.google.com/p

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
: from __future__ import division from sympy import * from sympy import Rational as R from sympy.numerics import * from sympy.numerics.functions import power, exp prec = 50 Float.setdps(prec) e = evalf(E) n = 1 m = n + 1 k = 0 n = evalf(R(n,1)) m = evalf(R(m,1)) prod = evalf(R(1,1

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
On Nov 19, 2007 2:09 AM, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 18 Nov 2007 16:05:15 -0800, Dick Moores [EMAIL PROTECTED] declaimed the following in comp.lang.python: TypeError: unsupported operand type(s) for /: 'float' and 'Float' blinkblink What restrictive

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
On Nov 19, 2007 2:23 AM, Dick Moores [EMAIL PROTECTED] wrote: OK, I tried mpmath again, and to my surprise, it went well! === #!/usr/bin/env python #coding=utf-8 from mpmath import * mpf.dps = 50 n = 1 k = 0 prod = mpf(1) while k 10: k += 1

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
error using either exp or power: from __future__ import division from sympy import * from sympy import Rational as R from sympy.numerics import * from sympy.numerics.functions import power, exp prec = 50 Float.setdps(prec) e = evalf(E) n = 1 m = n

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
At 05:33 PM 11/18/2007, Fredrik Johansson wrote: On Nov 19, 2007 2:23 AM, Dick Moores [EMAIL PROTECTED] wrote: OK, I tried mpmath again, and to my surprise, it went well! === #!/usr/bin/env python #coding=utf-8 from mpmath import * mpf.dps = 50 n = 1