Re: [Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Charles R Harris
Hi Dan, Did you finally get numpy installed as 64 bits? Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Robin
On Tue, Jun 24, 2008 at 4:23 AM, Dan Yamins <[EMAIL PROTECTED]> wrote: > 3) Finally: (and this is slightly off topic) -- I've just installed SciPy > for the first time. In the readme.txt for the download it mentioned > something about having LAPACK and ATLAS installed. However, on the scipy > ins

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Robert Kern
On Mon, Jun 23, 2008 at 22:53, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/6/23 Michael Abshoff <[EMAIL PROTECTED]>: >> Correct, but so far Carl has hooked into six out of the many random >> number generators in the various components of Sage. This way we can set >> a global seed and also mor

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Anne Archibald
2008/6/23 Michael Abshoff <[EMAIL PROTECTED]>: > Charles R Harris wrote: >> >> >> On Mon, Jun 23, 2008 at 5:58 PM, Michael Abshoff >> <[EMAIL PROTECTED] > >> wrote: >> >> Stéfan van der Walt wrote: >> > 2008/6/24 Stéfan van der Walt <[EMAIL PROTECTED] >>

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Anne Archibald
2008/6/23 Stéfan van der Walt <[EMAIL PROTECTED]>: > 2008/6/24 Stéfan van der Walt <[EMAIL PROTECTED]>: >> It should be fairly easy to execute the example code, just to make >> sure it runs. We can always work out a scheme to test its validity >> later. > > Mike Hansen just explained to me that th

Re: [Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Nathan Bell
On Mon, Jun 23, 2008 at 10:23 PM, Dan Yamins <[EMAIL PROTECTED]> wrote: > > 1) Does your commend imply that the current version of scipy does _not_ have > an eigensolver? (I installed it but can't find an eigensolver in it ... ) That's correct, SciPy 0.6 does not have a sparse eigensolver. > > 2

Re: [Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Dan Yamins
> > > > > The next version of SciPy will include two sparse eigensolvers: ARPACK > and LOBPCG > > > http://scipy.org/scipy/scipy/browser/trunk/scipy/sparse/linalg/eigen > OK, so I then I have three questions: 1) Does your commend imply that the current version of scipy does _not_ have an eigen

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Michael Abshoff
Charles R Harris wrote: > > > On Mon, Jun 23, 2008 at 5:58 PM, Michael Abshoff > <[EMAIL PROTECTED] > > wrote: > > Stéfan van der Walt wrote: > > 2008/6/24 Stéfan van der Walt <[EMAIL PROTECTED] > >: > >> It should be fairly

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Charles R Harris
On Mon, Jun 23, 2008 at 5:58 PM, Michael Abshoff < [EMAIL PROTECTED]> wrote: > Stéfan van der Walt wrote: > > 2008/6/24 Stéfan van der Walt <[EMAIL PROTECTED]>: > >> It should be fairly easy to execute the example code, just to make > >> sure it runs. We can always work out a scheme to test its v

Re: [Numpy-discussion] ndarray methods vs numpy module functions

2008-06-23 Thread Robert Kern
On Mon, Jun 23, 2008 at 19:35, Ryan May <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: >> On Mon, Jun 23, 2008 at 18:10, Sebastian Haase <[EMAIL PROTECTED]> wrote: >>> On Mon, Jun 23, 2008 at 10:31 AM, Bob Dowling <[EMAIL PROTECTED]> wrote: [ I'm new here and this has the feel of an FAQ but I

Re: [Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Nathan Bell
On Mon, Jun 23, 2008 at 3:36 PM, Dan Yamins <[EMAIL PROTECTED]> wrote: > I'm wondering if there is a currently-available Sparse-Matrix package for > numpy? If so, how do I get it?And, if there is a good sparse-matrix > package, does it include an eigenvalue-computation algorithm? How would a

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Fernando Perez
On Mon, Jun 23, 2008 at 5:26 PM, Michael Abshoff <[EMAIL PROTECTED]> wrote: > I am not the author, so I need to find out who wrote the code, but I am > sure it can be made BSD. We are also working on "doctest+timeit" to hunt > for performance regressions, but that one is not ready for prime time y

Re: [Numpy-discussion] ndarray methods vs numpy module functions

2008-06-23 Thread Ryan May
Robert Kern wrote: > On Mon, Jun 23, 2008 at 18:10, Sebastian Haase <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 23, 2008 at 10:31 AM, Bob Dowling <[EMAIL PROTECTED]> wrote: >>> [ I'm new here and this has the feel of an FAQ but I couldn't find >>> anything at http://www.scipy.org/FAQ . If I should h

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Michael Abshoff
Fernando Perez wrote: > On Mon, Jun 23, 2008 at 4:58 PM, Michael Abshoff > <[EMAIL PROTECTED]> wrote: Hi Fernando, >>> a) Random variables >> we have some small extensions to the doctesting framework that allow us >> to mark doctests as "#random" so that the result it not checked. Carl >> Witty w

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Fernando Perez
On Mon, Jun 23, 2008 at 4:58 PM, Michael Abshoff <[EMAIL PROTECTED]> wrote: >> a) Random variables > > we have some small extensions to the doctesting framework that allow us > to mark doctests as "#random" so that the result it not checked. Carl > Witty wrote some code that makes the random numbe

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Michael Abshoff
Stéfan van der Walt wrote: > 2008/6/24 Stéfan van der Walt <[EMAIL PROTECTED]>: >> It should be fairly easy to execute the example code, just to make >> sure it runs. We can always work out a scheme to test its validity >> later. Hi, > Mike Hansen just explained to me that the Sage doctest syste

Re: [Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Stéfan van der Walt
Hi Dan 2008/6/23 Dan Yamins <[EMAIL PROTECTED]>: > I'm wondering if there is a currently-available Sparse-Matrix package for > numpy? If so, how do I get it?And, if there is a good sparse-matrix > package, does it include an eigenvalue-computation algorithm? How would a > sparse-matrix packa

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Stéfan van der Walt
2008/6/24 Stéfan van der Walt <[EMAIL PROTECTED]>: > It should be fairly easy to execute the example code, just to make > sure it runs. We can always work out a scheme to test its validity > later. Mike Hansen just explained to me that the Sage doctest system sets the random seed before executing

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Stéfan van der Walt
2008/6/23 Michael McNeil Forbes <[EMAIL PROTECTED]>: > One can usually do #3 -> #1 or #2 by just leave bare assignments > without printing a result (the user can always execute them and look > at the result if they want). > > >>> r = np.random.rand(3,2,4) > > which is cleaner than adding any flags

Re: [Numpy-discussion] ndarray methods vs numpy module functions

2008-06-23 Thread Robert Kern
On Mon, Jun 23, 2008 at 18:10, Sebastian Haase <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 10:31 AM, Bob Dowling <[EMAIL PROTECTED]> wrote: >> [ I'm new here and this has the feel of an FAQ but I couldn't find >> anything at http://www.scipy.org/FAQ . If I should have looked >> somewhere

Re: [Numpy-discussion] ndarray methods vs numpy module functions

2008-06-23 Thread Sebastian Haase
On Mon, Jun 23, 2008 at 10:31 AM, Bob Dowling <[EMAIL PROTECTED]> wrote: > [ I'm new here and this has the feel of an FAQ but I couldn't find > anything at http://www.scipy.org/FAQ . If I should have looked > somewhere else a URL would be gratefully received. ] > > > What's the reasoning behind fu

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Robert Kern
On Mon, Jun 23, 2008 at 16:51, Michael McNeil Forbes <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 23, 2008 at 4:51 PM, Robert Kern >> <[EMAIL PROTECTED]> wrote: >>> random_array = np.random.rand(3,4) >>> random_array.shape (3,4) >>> random_array.max() < 1 True >>> random_arra

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Michael McNeil Forbes
> On Mon, Jun 23, 2008 at 4:51 PM, Robert Kern > <[EMAIL PROTECTED]> wrote: >> random_array = np.random.rand(3,4) >> random_array.shape >>> (3,4) >> random_array.max() < 1 >>> True >> random_array.min() > 0 >>> True >> >> Yes, this makes it doctestable, but you've destroyed the ex

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 4:51 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> I agree that this can be awkward sometimes, and should certainly not >> be policy, but one can usually get around this. Instead of printing >> the result, you can use it, or demonstrate porperties: >> >> >>> random_array =

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Robert Kern
On Mon, Jun 23, 2008 at 15:44, Michael McNeil Forbes <[EMAIL PROTECTED]> wrote: > On 23 Jun 2008, at 1:28 PM, Anne Archibald wrote: > >> 2008/6/23 Michael McNeil Forbes <[EMAIL PROTECTED]>: >>> Thus, one can argue that all examples should also be doctests. This >>> generally makes things a little

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Michael McNeil Forbes
On 23 Jun 2008, at 1:28 PM, Anne Archibald wrote: > 2008/6/23 Michael McNeil Forbes <[EMAIL PROTECTED]>: >> Thus, one can argue that all examples should also be doctests. This >> generally makes things a little more ugly, but much less ambiguous. > > This is a bit awkward. How do you give an exam

[Numpy-discussion] Sparse Matrices in Numpy -- (with eigenvalue algorithms if possible)

2008-06-23 Thread Dan Yamins
I'm wondering if there is a currently-available Sparse-Matrix package for numpy? If so, how do I get it?And, if there is a good sparse-matrix package, does it include an eigenvalue-computation algorithm? How would a sparse-matrix package interact with something like numpy.linalg.eig, or for t

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Anne Archibald
2008/6/23 Michael McNeil Forbes <[EMAIL PROTECTED]>: >> On 23 Jun 2008, at 12:37 PM, Alan McIntyre wrote: >>> Ugh. That just seems like a lot of unreadable ugliness to me. If >>> this comment magic is the only way to make that stuff execute >>> properly >>> under doctest, I think I'd rather just

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 4:07 PM, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > Another idea (in addition to whitelisting): how easy would it be to > subclass doctest.DocTestParser so that it would eg. automatically +IGNORE > any doctest lines containing ">>> plt."? I'll play around with that and see

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 3:57 PM, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > "Schematic" code (such as that currently in numpy.bmat) that doesn't run > probably shouldn't be written with >>>, and for it the ReST block quote > syntax is also looks OK. > > But I'm personally not in favor of a distinc

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Pauli Virtanen
Mon, 23 Jun 2008 15:53:55 -0400, Anne Archibald wrote: > 2008/6/23 Alan McIntyre <[EMAIL PROTECTED]>: >> On Mon, Jun 23, 2008 at 3:21 PM, Stéfan van der Walt <[EMAIL PROTECTED]> >> wrote: >>> Another alternative is to replace +SKIP with something like +IGNORE. >>> That way, the statement is still

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Michael McNeil Forbes
> On 23 Jun 2008, at 12:37 PM, Alan McIntyre wrote: >> Ugh. That just seems like a lot of unreadable ugliness to me. If >> this comment magic is the only way to make that stuff execute >> properly >> under doctest, I think I'd rather just skip it in favor of clean, >> uncluttered, non-doctestab

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Pauli Virtanen
Mon, 23 Jun 2008 10:03:28 +0200, Stéfan van der Walt wrote: > 2008/6/23 Alan McIntyre <[EMAIL PROTECTED]>: >> Some docstrings have examples of how to use the function that aren't >> executable code (see numpy.core.defmatrix.bmat for an example) in their >> current form. Should these examples have

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Anne Archibald
2008/6/23 Alan McIntyre <[EMAIL PROTECTED]>: > On Mon, Jun 23, 2008 at 3:21 PM, Stéfan van der Walt <[EMAIL PROTECTED]> > wrote: >> Another alternative is to replace +SKIP with something like +IGNORE. >> That way, the statement is still executed, we just don't care about >> its outcome. If we ski

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 3:21 PM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > Another alternative is to replace +SKIP with something like +IGNORE. > That way, the statement is still executed, we just don't care about > its outcome. If we skip the line entirely, it often affects the rest > of t

Re: [Numpy-discussion] Py_NotImplementedType leak

2008-06-23 Thread Charles R Harris
On Mon, Jun 23, 2008 at 11:23 AM, Charles R Harris < [EMAIL PROTECTED]> wrote: > Leaks of Py_NotImplementedType to the user are regarded as errors by the > Python developers and google turns up several patches fixing such issues. In > numpy we have this problem because we issue the same call for,

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Stéfan van der Walt
2008/6/23 Fernando Perez <[EMAIL PROTECTED]>: > On Mon, Jun 23, 2008 at 11:17 AM, Alan McIntyre <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 23, 2008 at 2:02 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: >>> There's also the option of marking them so doctest skips them via >>> >>> #doctest: +SKIP >>>

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 2:37 PM, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > Can you make the convention chosen for the examples (currently only in > the doc wiki, not yet in SVN) to work: assuming "import numpy as np" in > examples? > > This would remove the need for those "from numpy import *" li

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Fernando Perez
On Mon, Jun 23, 2008 at 11:17 AM, Alan McIntyre <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 2:02 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: >> There's also the option of marking them so doctest skips them via >> >> #doctest: +SKIP >> >> http://docs.python.org/lib/doctest-options.html >

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Pauli Virtanen
Mon, 23 Jun 2008 14:17:09 -0400, Alan McIntyre wrote: > On Mon, Jun 23, 2008 at 2:02 PM, Fernando Perez <[EMAIL PROTECTED]> > wrote: >> There's also the option of marking them so doctest skips them via >> >> #doctest: +SKIP >> >> http://docs.python.org/lib/doctest-options.html > > For short examp

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 2:02 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: > There's also the option of marking them so doctest skips them via > > #doctest: +SKIP > > http://docs.python.org/lib/doctest-options.html For short examples, that seems like a good option, but it seems like you have to ha

[Numpy-discussion] set_printoptions - floating point format option?

2008-06-23 Thread Robert Cimrman
Hi, I need to display some numpy arrays in mantissa+exponent format (e.g. '%.2e' using C syntax). In numpy.set_printoptions(), there is currently only 'precision' option, which does not allow this. What about having an option related to 'precision', named possibly 'float_format', with the foll

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Fernando Perez
On Mon, Jun 23, 2008 at 1:03 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/6/23 Alan McIntyre <[EMAIL PROTECTED]>: >> Some docstrings have examples of how to use the function that aren't >> executable code (see numpy.core.defmatrix.bmat for an example) in >> their current form. Should

[Numpy-discussion] Py_NotImplementedType leak

2008-06-23 Thread Charles R Harris
Leaks of Py_NotImplementedType to the user are regarded as errors by the Python developers and google turns up several patches fixing such issues. In numpy we have this problem because we issue the same call for, say, right_shift as we do for >>. This leads to things like: In [1]: int64(1) >> floa

Re: [Numpy-discussion] Travis: this looks like a bug in ufuncobject.c

2008-06-23 Thread Travis E. Oliphant
Charles R Harris wrote: > select_types(PyUFuncObject *self, int *arg_types, > PyUFuncGenericFunction *function, void **data, > PyArray_SCALARKIND *scalars, > PyObject *typetup) > { > int i, j; > char start_type; > int userdef=-1; > int userdef_

Re: [Numpy-discussion] Surprising performance tweak in Cython

2008-06-23 Thread Gael Varoquaux
On Mon, Jun 23, 2008 at 02:03:06AM -0400, Anne Archibald wrote: > One way to track down this kind of problem is to look at the C code > that's generated. Easier, I admit, with a little familiarity with C, > but in any case code working with python variables will be obtrusively > strewn with functio

Re: [Numpy-discussion] error importing a f2py compiled module.

2008-06-23 Thread Fabrice Silva
Le lundi 23 juin 2008 à 14:00 +0300, Pearu Peterson a écrit : > First, it is not clear what compiler is f95. If it is gfortran, then > use the command > f2py -m modulename -c --fcompiler=gnu95 tmpo.f > > If it is something else, check the output of > > f2py -c --help-fcompiler > > and use ap

Re: [Numpy-discussion] error importing a f2py compiled module.

2008-06-23 Thread Pearu Peterson
On Mon, June 23, 2008 10:38 am, Fabrice Silva wrote: > Dear all > I've tried to run f2py on a fortran file which used to be usable from > python some months ago. > Following command lines are applied with success (no errors raised) : > f2py -m modulename -h tmpo.pyf --overwrite-signature

[Numpy-discussion] ndarray methods vs numpy module functions

2008-06-23 Thread Bob Dowling
[ I'm new here and this has the feel of an FAQ but I couldn't find anything at http://www.scipy.org/FAQ . If I should have looked somewhere else a URL would be gratefully received. ] What's the reasoning behind functions like sum() and cumsum() being provided both as module functions (numpy.s

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Stéfan van der Walt
2008/6/23 Alan McIntyre <[EMAIL PROTECTED]>: > Some docstrings have examples of how to use the function that aren't > executable code (see numpy.core.defmatrix.bmat for an example) in > their current form. Should these examples have the ">>>" removed from > them to avoid them being picked up as do

[Numpy-discussion] error importing a f2py compiled module.

2008-06-23 Thread Fabrice Silva
Dear all I've tried to run f2py on a fortran file which used to be usable from python some months ago. Following command lines are applied with success (no errors raised) : f2py -m modulename -h tmpo.pyf --overwrite-signature tmpo.f f2py -m modulename -c --f90exec=/usr/bin/f95 tmp

[Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-23 Thread Alan McIntyre
Hi all, Some docstrings have examples of how to use the function that aren't executable code (see numpy.core.defmatrix.bmat for an example) in their current form. Should these examples have the ">>>" removed from them to avoid them being picked up as doctests? Thanks, Alan __