Re: [Numpy-discussion] Fortran 90 Library and .mod files numpy.distutils

2014-05-30 Thread David Huard
. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion -- David Huard, PhD Conseiller scientifique, Ouranos ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http

Re: [Numpy-discussion] need a better way to fill a grid

2011-01-24 Thread David Huard
Hi John, Since you have a regular grid, you should be able to find the x and y indices without np.where, ie something like I = (lon-grid.outlon0 / grid.dx).astype(int) J = (lat-grid.outlat0 / grid.dy).astype(int) for i, j, e in zip(I, J, emissions): Z[i,j] += e David On Mon, Jan 24, 2011

Re: [Numpy-discussion] read ascii file from complex fortran format() -- genfromtxt

2010-09-21 Thread David Huard
Have you tried http://code.google.com/p/python-fortranformat/ It's not officially released yet but it's probably worth a try. David H. On Tue, Sep 21, 2010 at 8:25 AM, Andrew Jaffe a.h.ja...@gmail.com wrote: Hi all, I've got an ascii file with a relatively complicated structure,

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-31 Thread David Huard
On Tue, Aug 31, 2010 at 7:02 AM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Tue, Aug 31, 2010 at 3:44 AM, David Huard david.hu...@gmail.comwrote: I just added a warning alerting concerned users (r8674), so this takes care of the bug fix and Nils wish to avoid a silent change

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread David Huard
...@gmail.com ? ?wrote: ? ? ?On Fri, Aug 27, 2010 at 15:32, David Huard david.hu...@gmail.com ? ? ?wrote: ? ? ? Nils and Joseph, ? ? ? Thanks for the bug report, this is now fixed in SVN (r8672). ? ? ?While we're at it, can we change the name of the argument? normed ? ? ?has caused so

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread David Huard
1.5 release. David H. On Mon, Aug 30, 2010 at 11:50 AM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010 at 11:39 AM, Bruce Southey bsout...@gmail.com wrote: On 08/30/2010 09:19 AM, Benjamin Root wrote: On Mon, Aug 30, 2010 at 8:29 AM, David Huard david.hu...@gmail.com wrote: Thanks

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread David Huard
:19 AM, Benjamin Root wrote: On Mon, Aug 30, 2010 at 8:29 AM, David Huard david.hu...@gmail.com wrote: Thanks for the feedback, As far as I understand it, the proposition is to keep histogram as it is for 1.5, then in 2.0, deprecate normed=True but keep the buggy behavior

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-27 Thread David Huard
Nils and Joseph, Thanks for the bug report, this is now fixed in SVN (r8672). Ralph. is this something that you want to see backported in 1.5 ? Regards, David On Fri, Aug 6, 2010 at 7:49 PM, josef.p...@gmail.com wrote: On Fri, Aug 6, 2010 at 4:53 PM, Nils Becker n.bec...@amolf.nl wrote:

Re: [Numpy-discussion] Dynamic convolution in Numpy

2010-06-04 Thread David Huard
to be able to reduce the angle thread under 5° which triggers around 1000 files to produce.For a 3Mb original sound file, it becomes huge. Indeed ! I'll be curious to see what solutions ends up working best. Keep us posted. David Thanks Arthur 2010/6/3 David Huard david.hu...@gmail.com Hi

Re: [Numpy-discussion] Dynamic convolution in Numpy

2010-06-03 Thread David Huard
Hi Arthur, I've no experience whatsoever with what you are doing, but my first thought was why don't you compute all possible versions beforehand and then progressively switch from one version to another by interpolation between the different versions. If the resolution is 15 degrees, there

Re: [Numpy-discussion] Bug in frompyfunc starting at 10000 elements?

2010-05-26 Thread David Huard
And in 2.0.0.dev8437. More hints: Assume has shape (N, Da) and b has shape (N, Db) * There is a problem wben N = 1, Db=1 and Da 1. * There is no problem when N = 1, Da=1 and Db 1. * The first row is OK, but for all others, there is one error per row, appearing in first column, then

Re: [Numpy-discussion] Aggregate memmap

2010-04-25 Thread David Huard
Hi Matt, I don't think the memmap code support this. However, you can stack memmaps just as easily as arrays, so if you define individual memmaps for each slice and stack them (numpy.vstack), the resulting array will behave as a regular 3D array. HTH, David H. On Wed, Apr 21, 2010 at 3:41

Re: [Numpy-discussion] Sea Ice Concentrations from Nimbus-7 SMMR and DMSP SSM/I Passive Microwave Data

2010-02-26 Thread David Huard
/polar_stereo/tools.html The first 300 bytes contain the header. The data is stored as 1 byte integers. The number of columns is stored in the header[6:11] and the number of rows in header[12:17] :author: David Huard david.hu...@gmail.com :date: September 2009 Notes = ltln_25n.msk

Re: [Numpy-discussion] numpy 2.0, what else to do?

2010-02-15 Thread David Huard
In the list of things to do, I suggest deleting completely the old histogram behaviour and the `new` keyword. The `new` keyword argument has raised a deprecation warning since 1.3 and was set for removal in 1.4. David H. On Mon, Feb 15, 2010 at 9:21 AM, Robert Kern robert.k...@gmail.com wrote:

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-02 Thread David Huard
On Tue, Feb 2, 2010 at 9:23 PM, Neil Martinsen-Burrell n...@wartburg.edu wrote: On 2010-02-02 19:53 , David Cournapeau wrote: Travis Oliphant wrote: I think we just signal the breakage in 1.4.1 and move forward.   The datetime is useful as a place-holder for data.  Math on date-time arrays

[Numpy-discussion] How to get the shape of an array slice without doing it

2010-01-29 Thread David Huard
Hi, I have a 4D array with a given shape, but the array is never actually created since it is large and distributed over multiple binary files. Typical usage would be to take slices across the 4D array. I'd like to know what the shape of the resulting array would be if I took a slice out of it.

Re: [Numpy-discussion] How to get the shape of an array slice without doing it

2010-01-29 Thread David Huard
On Fri, Jan 29, 2010 at 12:10 PM, josef.p...@gmail.com wrote: On Fri, Jan 29, 2010 at 11:49 AM, David Huard david.hu...@gmail.com wrote: Hi, I have a 4D array with a given shape, but the array is never actually created since it is large and distributed over multiple binary files. Typical

Re: [Numpy-discussion] Warning on http://scipy.org/ about binary incompatibility ?

2010-01-29 Thread David Huard
I'm a heavy user of scikits.timeseries so I am very interested in having native datetime objects in Numpy. However, when I did play with it about a week ago. I found inconsistencies between the actual code and the NEP. The Example of use section mostly doesn't work. I understand the need to put

Re: [Numpy-discussion] How to get the shape of an array slice without doing it

2010-01-29 Thread David Huard
For the record, here is what I came up with. import numpy as np def expand_ellipsis(index, ndim): Replace the ellipsis, real or implied, of an index expression by slices. Parameters -- index : tuple Indexing expression. ndim : int Number of dimensions of

[Numpy-discussion] Histogram - removing the new keyword for 1.4

2009-12-10 Thread David Huard
to bring this so late in the release cycle. Cheers, David Huard ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Convert data into rectangular grid

2009-09-29 Thread David Huard
On Mon, Sep 28, 2009 at 8:45 PM, jah jah.mailingl...@gmail.com wrote: On Mon, Sep 28, 2009 at 4:48 PM, josef.p...@gmail.com wrote: On Mon, Sep 28, 2009 at 7:19 PM, jah jah.mailingl...@gmail.com wrote: Hi, Suppose I have a set of x,y,c data (something useful for matplotlib.pyplot.plot()

Re: [Numpy-discussion] MFDatasets and NetCDF4

2009-09-25 Thread David Huard
Hi George, On Fri, Sep 25, 2009 at 6:55 AM, George Nurser gnur...@googlemail.comwrote: Hi, I hope this is the right place to ask this. I've found the MFDataset works well in reading NetCDF3 files, but it appears that it doesn't work at present for NetCDF4 files. It works on my side for

[Numpy-discussion] Fortran reader for npy files

2009-08-28 Thread David Huard
Hi, Has someone written a fortran reader for the npy binary files numpy.save creates ? Thanks, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Faulty behavior of numpy.histogram?

2009-08-12 Thread David Huard
On Wed, Aug 12, 2009 at 3:12 AM, Danny Handoko danny.hand...@asml.comwrote: Dear all, We try to use numpy.histogram with combination of matplotlib. We are using numpy 1.3.0, but a somewhat older matplotlib version of 0.91.2. Matplotlib's axes.hist() function calls the numpy.histogram,

[Numpy-discussion] vectorize problem with f2py and gfortran 4.3

2009-08-10 Thread David Huard
Hi all, A user on the pymc user list has reported a problem with f2py wrapped fortran functions compiled with gfortran 4.3, which is the standard Ubuntu Jaunty fortran compiler. I noticed the same bug in some of my own routines. The problem, as far as I can understand, is that vectorize tries to

Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-15 Thread David Huard
Pauli and David, Can this indexing syntax do things that are otherwise awkward with the current syntax ? Otherwise, I'm not warm to the idea of making indexing more complex than it is. getv : this is useful but it feels a bit redundant with numpy.take. Is there a reason why take could not

Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-15 Thread David Huard
to the numpy namespace. David On Fri, May 15, 2009 at 4:47 PM, josef.p...@gmail.com wrote: On Fri, May 15, 2009 at 4:09 PM, David Huard david.hu...@gmail.com wrote: Pauli and David, Can this indexing syntax do things that are otherwise awkward with the current syntax ? Otherwise, I'm not warm

Re: [Numpy-discussion] hairy optimization problem

2009-05-06 Thread David Huard
Hi Mathew, You could use Newton's method to optimize for each vi sequentially. If you have an expression for the jacobian, it's even better. What I'd do is write a class with a method f(self, x, y) that records the result of f(x,y) each time it is called. I would then sample very coarsely the

Re: [Numpy-discussion] efficient 3d histogram creation

2009-05-05 Thread David Huard
On Mon, May 4, 2009 at 4:18 PM, josef.p...@gmail.com wrote: On Mon, May 4, 2009 at 4:00 PM, Chris Colbert sccolb...@gmail.com wrote: i'll take a look at them over the next few days and see what i can hack out. Chris On Mon, May 4, 2009 at 3:18 PM, David Huard david.hu...@gmail.com

Re: [Numpy-discussion] efficient 3d histogram creation

2009-05-04 Thread David Huard
On Mon, May 4, 2009 at 7:00 AM, josef.p...@gmail.com wrote: On Mon, May 4, 2009 at 12:31 AM, Chris Colbert sccolb...@gmail.com wrote: this actually sort of worked. Thanks for putting me on the right track. Here is what I ended up with. this is what I ended up with: def

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
Stefan, The SciPy site is really nice, but the NumPy site returns a Page Load Error. David On Mon, Mar 9, 2009 at 3:35 AM, Stéfan van der Walt ste...@sun.ac.zawrote: Hi all, Here is an outline of recent changes made to the Trac system. I have modified the ticket workflow on

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
On Tue, Mar 10, 2009 at 9:44 AM, Stéfan van der Walt ste...@sun.ac.zawrote: Hi David 2009/3/10 David Huard david.hu...@gmail.com: Stefan, The SciPy site is really nice, but the NumPy site returns a Page Load Error. Which page are you referring to? http://projects.scipy.org/numpy

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
Plain old firefox 3.0.6 on fedora 9. On Tue, Mar 10, 2009 at 4:11 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Mar 10, 2009 at 2:07 PM, Stéfan van der Walt ste...@sun.ac.zawrote: 2009/3/10 David Huard david.hu...@gmail.com: but, if I try to login, I get the same error

Re: [Numpy-discussion] GMRES internal variables

2009-02-17 Thread David Huard
Nathan, First of all, thanks to all your work on the sparse linear algebra package, I am starting to use it and it's much appreciated. Just a thought: wouldn't it be more natural to write gmres as a class rather than a function ? That way, accessing the internal work arrays for reuse would be

[Numpy-discussion] Changes to histogram semantics: follow-up

2008-11-12 Thread David Huard
a DeprecationWarning. Users relying on the old behaviour are encouraged to switch to the new semantics. new=True warns users that the `new` keyword will disappear in 1.4 Regards, David Huard ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http

Re: [Numpy-discussion] Bugs in histogram and matplotlib-hist

2008-11-12 Thread David Huard
On Wed, Nov 12, 2008 at 1:27 PM, Mike Ressler [EMAIL PROTECTED]wrote: On Wed, Nov 12, 2008 at 4:30 AM, Scott Sinclair [EMAIL PROTECTED] wrote: Mike Ressler [EMAIL PROTECTED] 11/12/08 1:19 AM I did an update to a Fedora 9 workstation yesterday that included updating numpy to 1.2.0 and

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-10 Thread David Huard
On Thu, Oct 9, 2008 at 2:48 PM, Neal Becker [EMAIL PROTECTED] wrote: David Huard wrote: On Thu, Oct 9, 2008 at 9:40 AM, Neal Becker [EMAIL PROTECTED] wrote: David Huard wrote: Neal, Look at: apply_along_axis I guess it'd be: b = empty_like(a) for row in a.shape[0

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-09 Thread David Huard
Neal, Look at: apply_along_axis David On Thu, Oct 9, 2008 at 8:04 AM, Neal Becker [EMAIL PROTECTED] wrote: Suppose I have a function (I wrote in c++) that accepts a numpy 1-d vector. What is the recommended way to apply it to each row of a matrix, returning a new matrix result? (Assume

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-09 Thread David Huard
On Thu, Oct 9, 2008 at 9:40 AM, Neal Becker [EMAIL PROTECTED] wrote: David Huard wrote: Neal, Look at: apply_along_axis I guess it'd be: b = empty_like(a) for row in a.shape[0]: b[row,:] = apply_along_axis (func, row, a) I don't suppose there is a way to do this without

Re: [Numpy-discussion] Help to process a large data file

2008-10-03 Thread David Huard
Frank, On Thu, Oct 2, 2008 at 3:20 PM, frank wang [EMAIL PROTECTED] wrote: Thans David and Chris for providing the nice solution. Glad it helped. Both method works gread. I could not tell the speed difference between the two solutions. My data size is 1048577 lines. I'd be curious to

Re: [Numpy-discussion] Help to process a large data file

2008-10-02 Thread David Huard
Frank, How about that: x = np.loadtxt('file') z = x.sum(1) # Reduce data to an array of 0,1,2 rz = z[z0] # Remove all 0s since you don't want to count those. loc = np.where(rz==2)[0] # The location of the (1,1)s count = np.diff(loc) - 1 # The spacing between those (1,1)s, ie, the

Re: [Numpy-discussion] Upper and lower envelopes

2008-09-30 Thread David Huard
On Tue, Sep 30, 2008 at 4:37 PM, Anne Archibald [EMAIL PROTECTED]wrote: 2008/9/30 bevan [EMAIL PROTECTED]: Hello, I have some XY data. I would like to generate the equations for an upper and lower envelope that excludes a percentage of the data points. I would like to define the

Re: [Numpy-discussion] loadtxt error

2008-09-24 Thread David Huard
Note that the fix was also backported to 1.2, for which binary builds are available: David [ copied from a recent thread ] The 1.2.0rc2 is now available: http://svn.scipy.org/svn/numpy/tags/1.2.0rc2 The source tarball is here: https://cirl.berkeley.edu/numpy/numpy-1.2.0rc2.tar.gz Here is the

Re: [Numpy-discussion] loadtxt error

2008-09-23 Thread David Huard
This bug has been fixed in the trunk a couple of weeks ago. Cheers, David On Mon, Sep 22, 2008 at 8:10 PM, Pierre GM [EMAIL PROTECTED] wrote: On Monday 22 September 2008 19:56:47 frank wang wrote: This error is caused that the usecols is a tuple and it does not have find command. I do

Re: [Numpy-discussion] Help speeding up element-wise operations for video processing

2008-09-16 Thread David Huard
Brendan, Not sure if I understand correctly what you want, but ... Numpy vector operations are performed in C, so there will be an iteration over the array elements. For parallel operations over all pixels, you'd need a package that talks to your GPU, such as pyGPU. I've never tried it and if

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-05 Thread David Huard
Hi Ryan, I applied your patch in r5788 on the trunk. I noticed there was another bug occurring when both converters and usecols are provided. I've added regression tests for both bugs. Could you confirm that everything is fine on your side ? Thanks, On Thu, Sep 4, 2008 at 4:47 PM, Ryan May

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-05 Thread David Huard
Done in r5790. On Fri, Sep 5, 2008 at 12:36 PM, Ryan May [EMAIL PROTECTED] wrote: David Huard wrote: Hi Ryan, I applied your patch in r5788 on the trunk. I noticed there was another bug occurring when both converters and usecols are provided. I've added regression tests for both

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread David Huard
On Tue, Aug 5, 2008 at 4:04 AM, Vincent Schut [EMAIL PROTECTED] wrote: David Huard wrote: On Mon, Aug 4, 2008 at 1:45 PM, Jarrod Millman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: snip Question: Should histogram raise a warning by default (new=True) to warn users

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread David Huard
On Tue, Aug 5, 2008 at 1:18 PM, Jarrod Millman [EMAIL PROTECTED] wrote: On Tue, Aug 5, 2008 at 8:48 AM, David Huard [EMAIL PROTECTED] wrote: Thanks for the feedback. Here is what will be printed: If new=False The original semantics of histogram is scheduled to be deprecated in NumPy

Re: [Numpy-discussion] 1.2 tasks

2008-08-05 Thread David Huard
On Tue, Aug 5, 2008 at 1:36 PM, Jarrod Millman [EMAIL PROTECTED] wrote: On Tue, Aug 5, 2008 at 10:24 AM, Stéfan van der Walt [EMAIL PROTECTED] wrote: Could you put in a check for new=True, and suppress those messages? A user that knows about the changes wouldn't want to see anything.

Re: [Numpy-discussion] 1.2 tasks

2008-08-04 Thread David Huard
On Mon, Aug 4, 2008 at 1:45 PM, Jarrod Millman [EMAIL PROTECTED] wrote: Here are the remaining tasks that I am aware of that need to be done before tagging 1.2.0b1 on the 8th. Median == The call signature for median needs to change from def median(a, axis=0, out=None,

Re: [Numpy-discussion] import numpy is slow

2008-07-31 Thread David Huard
On Thu, Jul 31, 2008 at 1:12 PM, Christopher Barker [EMAIL PROTECTED]wrote: David Cournapeau wrote: Christopher Barker wrote: On my OS-X box (10.4.11, python2.5, numpy '1.1.1rc2'), it takes about 7 seconds to import numpy! Hot or cold ? If hot, there is something horribly wrong with

Re: [Numpy-discussion] The date/time dtype and the casting issue

2008-07-29 Thread David Huard
Hi, Silent casting is often a source of bugs and I appreciate the strict rules you want to enforce. However, I think there should be a simpler mechanism for operations between different types than creating a copy of a variable with the correct type. My suggestion is to have a dtype argument for

Re: [Numpy-discussion] Schedule for 1.2.0

2008-07-23 Thread David Huard
I think we should stick to what has been agreed and announced months ago. It's called honouring our commitments and the project's image depends on it. If the inconvenience of these API changes is worth the trouble, a 1.1.2 release could be considered. My two cents. David 2008/7/22 Joe

Re: [Numpy-discussion] numpy.loadtext() fails with dtype + usecols

2008-07-21 Thread David Huard
Looks good to me. I committed the patch to the trunk and added a regression test (r5495). David 2008/7/18 Charles R Harris [EMAIL PROTECTED]: On Fri, Jul 18, 2008 at 4:16 PM, Ryan May [EMAIL PROTECTED] wrote: Hi, I was trying to use loadtxt() today to read in some text data, and I had

Re: [Numpy-discussion] 1.1.1rc1 to be tagged tonight

2008-07-21 Thread David Huard
Ryan, I committed your patch to the trunk and added a test for it from your failing example. Jarrod, though I'm also wary to touch the branch so late, the patch is minor and I don't see how it could break something that was not already broken. David 2008/7/20 Ryan May [EMAIL PROTECTED]:

Re: [Numpy-discussion] Histogram bin definition

2008-07-16 Thread David Huard
Hi Stefan, It's designed this way. The main reason is that the default bin edges are generated using linspace(a.min(), a.max(), bin) when bin is an integer. If we leave the rightmost edge open, then the histogram of a 100 items array will typically yield an histogram with 99 values because the

Re: [Numpy-discussion] Revised list of backport candidates for 1.1.1

2008-07-15 Thread David Huard
The revision number for the backport of 5254 is 5419. David 2008/7/15 Charles R Harris [EMAIL PROTECTED]: After the first round of backports the following remain. charris r5259 r5312 r5322 r5324 r5392 r5394 r5399 r5406 r5407 dhuard r5254

Re: [Numpy-discussion] RFC: A proposal for implementing some date/time types in NumPy

2008-07-14 Thread David Huard
2008/7/14 Francesc Alted [EMAIL PROTECTED]: [...] DateArray([14-Jan-2001 14:34:33, 16-Jan-2001 10:09:11], freq='S') That's great. However we only planned to import/export dates from the ``datetime`` module for the time being, mainly because of efficency but also simplicity.

Re: [Numpy-discussion] nose changes checked in

2008-06-17 Thread David Huard
I noticed that NumpyTest and NumpyTestCase disappeared, and now I am wondering whether these classes part of the public interface or were they reserved for internal usage ? In the former, it might be well to deprecate them before removing them. Cheers, David 2008/6/17 David Cournapeau [EMAIL

Re: [Numpy-discussion] NumpyTest problem

2008-06-10 Thread David Huard
, but NumpyTest().test(all=True) doesn't, that is, it finds 0 test. David 2008/6/2 Charles R Harris [EMAIL PROTECTED]: On Mon, Jun 2, 2008 at 9:20 AM, David Huard [EMAIL PROTECTED] wrote: Hi, There are 2 problems with NumpyTest 1. It fails if the command is given the file name only

Re: [Numpy-discussion] Bug in numpy.histogram?

2008-06-09 Thread David Huard
2008/6/9 Tommy Grav [EMAIL PROTECTED]: I understand this and agree, but it still means that the API for histogram is broken since normed can only be used with the new=True parameter. I though the whole point of the future warning was to avoid this. It is not a big deal, just means that one

[Numpy-discussion] NumpyTest problem

2008-06-02 Thread David Huard
Hi, There are 2 problems with NumpyTest 1. It fails if the command is given the file name only (without a directory structure) E.g.: [EMAIL PROTECTED]:~/repos/numpy/numpy/tests$ python test_ctypeslib.py Traceback (most recent call last): File test_ctypeslib.py, line 87, in module

Re: [Numpy-discussion] NumpyTest problem

2008-06-02 Thread David Huard
numpy.test(level=10,all=0) seems to work fine. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] NumpyTest problem

2008-06-02 Thread David Huard
properly if I can. Alan On Mon, Jun 2, 2008 at 11:20 AM, David Huard [EMAIL PROTECTED] wrote: Hi, There are 2 problems with NumpyTest 1. It fails if the command is given the file name only (without a directory structure) E.g.: [EMAIL PROTECTED]:~/repos/numpy/numpy/tests$ python

Re: [Numpy-discussion] 1.1.0rc1 tagged

2008-05-19 Thread David Huard
Ticket 793 has a patch, submitted by Alan McIntyre, waiting for review from someone C-API-wise. Cheers, David 2008/5/19 Neal Becker [EMAIL PROTECTED]: Jarrod Millman wrote: Please test the release candidate: svn co http://svn.scipy.org/svn/numpy/tags/1.1.0rc1 1.1.0rc1 Also please

Re: [Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-15 Thread David Huard
Works for me, Thanks David 2008/5/15 Pearu Peterson [EMAIL PROTECTED]: Robert Kern wrote: On Wed, May 14, 2008 at 3:20 PM, David Huard [EMAIL PROTECTED] wrote: I filed a patch that seems to do the trick in ticket #792. I don't think this is the right approach. The problem isn't

Re: [Numpy-discussion] let's use patch review

2008-05-15 Thread David Huard
2008/5/14 David Cournapeau [EMAIL PROTECTED]: On Wed, 2008-05-14 at 13:58 -1000, Eric Firing wrote: What does that mean? How does one know when there is a consensus? There can be a system to make this automatic. For example, the code is never commited directly to svn, but to a

[Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-14 Thread David Huard
Hi, On fedora 8, the docstrings of f2py generated extensions are strangely missing. On Ubuntu, the same modules do have the docstrings. The problem, as reported in the f2py ML, seems to come from the -D_FORTIFY_SOURCE flag which is set to 2 instead of 1. Could this be fixed in numpy.distutils and

Re: [Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-14 Thread David Huard
I filed a patch that seems to do the trick in ticket #792.http://scipy.org/scipy/numpy/ticket/792 2008/5/14 David Huard [EMAIL PROTECTED]: Hi, On fedora 8, the docstrings of f2py generated extensions are strangely missing. On Ubuntu, the same modules do have the docstrings. The problem

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread David Huard
Other suggestions for bounded bell-shaped functions that reach zero on a finite interval: - Beta distribution: http://en.wikipedia.org/wiki/Beta_distribution - Cubic B-splines:http://www.ibiblio.org/e-notes/Splines/Basis.htm 2008/4/25 Bruce Southey [EMAIL PROTECTED]: Rich Shepard wrote:

Re: [Numpy-discussion] numpy release

2008-04-25 Thread David Huard
2008/4/24 Jarrod Millman [EMAIL PROTECTED]: On Thu, Apr 24, 2008 at 1:22 PM, David Huard wrote: Assuming we want the next version to : ignore values outside of range and accept and return the bin edges instead of the left edges, here could be the new signature for 1.1: h, edges

Re: [Numpy-discussion] numpy release

2008-04-25 Thread David Huard
2008/4/25 David Huard [EMAIL PROTECTED]: 2008/4/24 Jarrod Millman [EMAIL PROTECTED]: On Thu, Apr 24, 2008 at 1:22 PM, David Huard wrote: Assuming we want the next version to : ignore values outside of range and accept and return the bin edges instead of the left edges, here could

Re: [Numpy-discussion] numpy release

2008-04-25 Thread David Huard
] wrote: On Fri, Apr 25, 2008 at 12:55 PM, David Huard [EMAIL PROTECTED] wrote: Done in r5085. I added a bunch of tests, but I'd appreciate if someone could double check before the release. This is not the time to introduce new bugs. Hopefully this is the end

Re: [Numpy-discussion] numpy release

2008-04-24 Thread David Huard
The problem I see with C is that it will break compatibility with the other histogram functions, which also use bins. So here is suggestion E: The most common use case ( I think) is the following: h, b = histogram(r, number_of_bins, normed=True/False) for which the function behaves correctly.

Re: [Numpy-discussion] numpy release

2008-04-23 Thread David Huard
2008/4/23, Stéfan van der Walt [EMAIL PROTECTED]: Hi Jarrod Of those tickets, the following are serious: http://projects.scipy.org/scipy/numpy/ticket/605 (a patch is available?, David Huard) Fixing of histogram. I haven't found a way to fix histogram reliably without breaking

Re: [Numpy-discussion] ticket #605

2008-04-09 Thread David Huard
Hello Jarrod and co., here is my personal version of the histogram saga. The current version of histogram puts in the rightmost bin all values larger than range, but does not put in the leftmost bin all values smaller than bin, eg. In [6]: histogram([1,2,3,4,5,6], bins=3, range=[2,5]) Out[6]:

Re: [Numpy-discussion] packaging scipy (was Re: Simple financial functions for NumPy)

2008-04-09 Thread David Huard
2008/4/9, Gael Varoquaux [EMAIL PROTECTED]: [snip] Some people do not want their scripts to scale or to last more than a day. And that's what Matlab is especially good at ! ; ) And I'll say the thing I'm dying to say since this started: If anybody other than Travis had suggested we put

Re: [Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram

2008-04-08 Thread David Huard
Hans, Note that the current histogram is buggy, in the sense that it assumes that all bins have the same width and computes db = bins[1]-bin[0]. This is why you get zeros everywhere. The current behavior has been heavily criticized and I think we should change it. My proposal is to have for

Re: [Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram

2008-04-08 Thread David Huard
, 3, -9223372036854775808]) In [29]: np.r_[-np.inf, asarray(dbin).astype(float), np.inf] Out[29]: array([-Inf, 1., 2., 3., Inf]) Is this a misuse of r_ or a bug ? David But I have not had time to find the error. Regards Bruce David Huard wrote: Hans, Note

Re: [Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram

2008-04-07 Thread David Huard
+1 for an outlier keyword. Note, that this implies that when bins are passed explicitly, the edges are given (nbins+1), not simply the left edges (nbins). While we are refactoring histogram, I'd suggest adding an axis keyword. This is pretty straightforward to implement using the

Re: [Numpy-discussion] packaging scipy (was Re: Simple financial functions for NumPy)

2008-04-07 Thread David Huard
2008/4/4, Joe Harrington [EMAIL PROTECTED]: import numpy as N import numpy.math as N.M import numpy.trig as N.T import numpy.stat as N.S I don't think the issue is whether to put everything in the base namespace // everything in individual namespace, but rather to find an optimal and

Re: [Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram

2008-04-07 Thread David Huard
On Apr 7, 2008, at 4:14 PM, LB wrote: +1 for axis and +1 for a keyword to define what to do with values outside the range. For the keyword, ather than 'outliers', I would propose 'discard' or 'exclude', because it could be used to describe the four possibilities : - discard='low'

Re: [Numpy-discussion] loading data with gaps

2008-04-04 Thread David Huard
Hi Tim, Look at the thread posted a couple of weeks ago named: loadtxt and missing values I'm guessing you'll find answers to your questions, if not, don't hesitate to ask. David 2008/4/3, Tim Michelsen [EMAIL PROTECTED]: Hello! How can I load a data file (e.g. CSV, DAT) in ASCII which

Re: [Numpy-discussion] isnan bug?

2008-03-20 Thread David Huard
Chris, The trac http://projects.scipy.org/scipy/numpy/ page is to place to file tickets. Note that you have to register first before you can file new tickets. David 2008/3/20, Chris Withers [EMAIL PROTECTED]: Hi All, I'm faily sure that: numpy.isnan(datetime.datetime.now()) ...should

[Numpy-discussion] Proposed change to average function

2008-03-18 Thread David Huard
of unexpected results but wanted to know if anyone disagrees with the change. The proposed version is implemented in revision 4888. Regards, David Huard ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo

Re: [Numpy-discussion] Help needed with numpy 10.5 release blockers

2008-03-14 Thread David Huard
I added a test for ticket 690. 2008/3/13, Barry Wark [EMAIL PROTECTED]: I appologize that the Mac OSX buildbot has been so flakey. For some reason it stops being able to resolve scipy.org on a regular basis (though other processes on the same machine don't seem to have trouble). Restarting

Re: [Numpy-discussion] Help needed with numpy 10.5 release blockers

2008-03-14 Thread David Huard
I added a test for ticket 691. Problem is, there seems to be a new bug. I don't know it its related to the change or if it was there before. Please check this out. David 2008/3/14, David Huard [EMAIL PROTECTED]: I added a test for ticket 690. 2008/3/13, Barry Wark [EMAIL PROTECTED]: I

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread David Huard
['S%03d'%i for i in int_data] David 2008/3/13, Alan G Isaac [EMAIL PROTECTED]: On Thu, 13 Mar 2008, Alexander Michael apparently wrote: I want to format an array of numbers as strings. To what end? Note that tofile has a format option. And for 1d array ``x`` you can always do::

Re: [Numpy-discussion] loadtxt broken if file does not end in newline

2008-02-27 Thread David Huard
I can look at it. Would everyone be satisfied with a solution using regular expressions ? That is, looking for the following pattern: pattern = re.compile(r ^\s* # leading white space (.*) # Data %s? # Zero or one comment character (.*) # Comments \s*$ # Trailing white space

Re: [Numpy-discussion] loadtxt broken if file does not end in newline

2008-02-27 Thread David Huard
in enumerate(fh): if iskiprows: continue line = pattern.split(line)[0] can take care of that automatically if comments is a regular expression. Cheers, David 2008/2/27, Christopher Barker [EMAIL PROTECTED]: David Huard wrote: Would everyone be satisfied with a solution using

Re: [Numpy-discussion] David's build_with_scons branch merged!

2008-02-08 Thread David Huard
Jarrod and David, I am reporting a success on FC8, Xeon. Some tests don't pass, but I don't believe it is related to the build process. Well done, David 2008/2/8, Jarrod Millman [EMAIL PROTECTED]: Hello, In preparation for the upcoming NumPy 1.0.5 release, I just merged David Cournapeau's

Re: [Numpy-discussion] histogramdd memory needs

2008-02-04 Thread David Huard
2008/2/4, Lars Friedrich [EMAIL PROTECTED]: Hi, 2) Is there a way to use another algorithm (at the cost of performance) that uses less memory during calculation so that I can generate bigger histograms? You could work through your array block by block. Simply fix the range and

Re: [Numpy-discussion] histogramdd memory needs

2008-02-01 Thread David Huard
Hi Lars, [...] 2008/2/1, Lars Friedrich [EMAIL PROTECTED]: 1) How can I tell histogramdd to use another dtype than float64? My bins will be very little populated so an int16 should be sufficient. Without normalization, a Integer dtype makes more sense to me. There is no way you'll be able

Re: [Numpy-discussion] maskedarray branch

2008-01-19 Thread David Huard
2008/1/18, Stefan van der Walt [EMAIL PROTECTED]: Hi David On Fri, Jan 18, 2008 at 10:53:28AM -0500, David Huard wrote: Stefan, It seems that the current maskedarray branch is not compatible with the current scipy trunk. Would you mind expanding on that? From memory it had

Re: [Numpy-discussion] maskedarray branch

2008-01-18 Thread David Huard
2008/1/18, Stefan van der Walt [EMAIL PROTECTED]: Hi David On Tue, Jan 15, 2008 at 04:29:22PM -0500, David Huard wrote: I am trying to install the maskedarray numpy branch for use with the timeseries package and I get the following error when importing numpy: Before I try to find

Re: [Numpy-discussion] maskedarray branch

2008-01-18 Thread David Huard
Stefan, It seems that the current maskedarray branch is not compatible with the current scipy trunk. Cheers, David 2008/1/18, David Huard [EMAIL PROTECTED]: Putting import add_newdocs before import ma seems to fix the ImportError, but I'm not sure if there could be undesirable side

[Numpy-discussion] maskedarray branch

2008-01-15 Thread David Huard
Hi all, I am trying to install the maskedarray numpy branch for use with the timeseries package and I get the following error when importing numpy: /usr/local/lib64/python2.5/site-packages/numpy/__init__.py in module() 45 import random 46 import ctypeslib --- 47 import ma

[Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread David Huard
Hi all, I'm having trouble understanding the behavior of vectorize on the following example: import string from numpy import vectorize vstrip = vectorize(string.strip) s = [' aa ' , ' bb ', ' cc '] vstrip(s) array(['', '',

Re: [Numpy-discussion] Failing to understand vectorize behavior

2008-01-09 Thread David Huard
, David Huard [EMAIL PROTECTED] wrote: Hi all, I'm having trouble understanding the behavior of vectorize on the following example: import string from numpy import vectorize vstrip = vectorize( string.strip) s = [' aa ' , ' bb

  1   2   >