Re: [Numpy-discussion] I've just commited a fast-clip function
Travis Oliphant wrote: Hey folks, I've just committed a revision of ticket #425 to speed up clipping in the scalar case. I also altered the PyArray_Conjugate function (called by the conjugate method) to use the ufunc for complex data. These were some relatively largish changes to the source code (all behind the scences and no interface changes) --- enough to make me want to see some more testing. I would appreciate it, if people could test out the new clip function and conjugate method to make sure they are working well. All tests pass, but there are some things we are not testing for. I need to still add the clip tests from ticket #425 --- unless somebody beats me to it. Hi Travis, Would the test I included in the patch be OK, once converted to be usable after your modifications ? They were covering many corner cases (including some which crashed the old clip). cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] odd installation problem of numpy/matplotlib
Sorry if the message will arrive in duplicate I had some problem with posting in the mailing list I've installed in my machine in the following order python 2.5 numpy 1.01 matplot lib 0.87 scipy 0.52 wxPython 2.8 with no problem I've also installed the same packages at home and in another two computer and everything went fine. The I was asked to install this configuaration in some classroom machines and also on another computer and I continue getting this error The import of the numpy version of the _transforms module, _ns_transforms, failed. This is is either because numpy was unavailable when matplotlib was compiled, because a dependency of _ns_transforms could not be satisfied, or because the build flag for this module was turned off in setup.py. If it appears that _ns_transforms was not built, make sure you have a working copy of numpy and then re-install matplotlib. Otherwise, the following traceback gives more details: Traceback (most recent call last): File pyshell#2, line 1, in module from pylab import * File C:\Python25\Lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python25\Lib\site-packages\matplotlib\pylab.py, line 201, in module from axes import Axes, PolarAxes File C:\Python25\Lib\site-packages\matplotlib\axes.py, line 14, in module from artist import Artist, setp File C:\Python25\Lib\site-packages\matplotlib\artist.py, line 4, in module from transforms import identity_transform File C:\Python25\Lib\site-packages\matplotlib\transforms.py, line 223, in module from _transforms import Value, Point, Interval, Bbox, Affine File C:\Python25\Lib\site-packages\matplotlib\_transforms.py, line 17, in module from matplotlib._ns_transforms import * ImportError: DLL load failed: Impossibile trovare il modulo specificato but I can assure that If I check numpy installation before installing matplot lib it seems everything fine. All computer have Windows XP home edition 2002 SP2 the only difference is in the RAM quantity. (more than 256 in the computer where everything works) but it seems so strange to me that it is the ram (I've also installed in another computer , old one, and everything works) Any IDEA ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Ticket 418
Hi all, Is someone able to reproduce the segfault described at http://projects.scipy.org/scipy/numpy/ticket/418 with a recent svn version ? I am using numpy.__version__ '1.0.2.dev3616' scipy.__version__ '0.5.3.dev2892' Nils ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] converting scalar to array with dimension 1
Hello list - I have a function that normally accepts an array as input, but sometimes a scalar. I figured the easiest way to make sure the input is an array, is to make it an array. But if I make a float an array, it has 0 dimension, and I can still not do array manipulation on it. a = 3 a = array(a) shape(a) () a[0] Traceback (most recent call last): File pyshell#121, line 1, in ? a[0] IndexError: 0-d arrays can't be indexed What would be the best (and easiest, this is for an intro class I am teaching) way to convert a to an array (recall, most of the time a is already an array). Thanks for your help, Mark ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] isarray in numpy?
Is there a way to check whether something is an array? It seems that isarray(a) is not there. Thanks and sorry for the newbie question, Mark ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] isarray in numpy?
mark wrote: Is there a way to check whether something is an array? It seems that isinstance(a, numpy.ndarray) This will return True if a is an array or a sub-class. -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Should 0-d arrays with fields defined return a 0-d array or a scalar
mark wrote: Does this mean, we could do something like this? a = 3 a = array(a) a[ a4 ] = 5 No. That would be a separate change. -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] I've just commited a fast-clip function
David Cournapeau wrote: Travis Oliphant wrote: Hey folks, I've just committed a revision of ticket #425 to speed up clipping in the scalar case. I also altered the PyArray_Conjugate function (called by the conjugate method) to use the ufunc for complex data. These were some relatively largish changes to the source code (all behind the scences and no interface changes) --- enough to make me want to see some more testing. I would appreciate it, if people could test out the new clip function and conjugate method to make sure they are working well. All tests pass, but there are some things we are not testing for. I need to still add the clip tests from ticket #425 --- unless somebody beats me to it. Hi Travis, Would the test I included in the patch be OK, once converted to be usable after your modifications ? They were covering many corner cases Yes, the test functions should be fine (except there is no fastclip function). -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] converting scalar to array with dimension 1
atleast_1d will do the trick In [11]: a = 3 In [12]: a = atleast_1d(a) In [13]: shape(a) Out[13]: (1,) In [14]: a.shape # also works ;-) Out[14]: (1,) In [15]: a[0] Out[15]: 3 --bb On 3/30/07, Mark Bakker [EMAIL PROTECTED] wrote: Hello list - I have a function that normally accepts an array as input, but sometimes a scalar. I figured the easiest way to make sure the input is an array, is to make it an array. But if I make a float an array, it has 0 dimension, and I can still not do array manipulation on it. a = 3 a = array(a) shape(a) () a[0] Traceback (most recent call last): File pyshell#121, line 1, in ? a[0] IndexError: 0-d arrays can't be indexed What would be the best (and easiest, this is for an intro class I am teaching) way to convert a to an array (recall, most of the time a is already an array). Thanks for your help, Mark ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] I've just commited a fast-clip function
Stefan van der Walt wrote: On Thu, Mar 29, 2007 at 11:21:07PM -0600, Travis Oliphant wrote: Record arrays also cause problems, i.e. I think I've fixed these errors (reference counting problems), now. If we can get the tests added, then we can just run numpy.test() Thanks for your help. -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] organizational question
Is either NumPy or SciPy substantially supported by an identifiable and actual non-profit organization? I ask because I think both fit under http://www.mellon.org/grant_programs/programs/copy_of_research item 4. Here is the announcement: http://matc.mellon.org/ Note that universities are among the nominees: http://matc.mellon.org/2007_nominations Cheers, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] converting scalar to array with dimension 1
On Friday 30 March 2007 16:26:26 Robert Kern wrote: True, not every two-liner should be in the core, but very-frequently-used two-liners that state the authors intent clearer can have a good case made for them. Fair enough, I'll keep that in mind. Thanks again! ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] converting scalar to array with dimension 1
On Friday 30 March 2007 17:43:42 Bill Baxter wrote: Actually I didn't realize that it had a loop in it, so thanks for pointing that out. I thought it was just and alias for array with some args. I just realized that myself, going directly in the sources: that's how I found that the ndmin argument was available in the Python interface. Actually, I tend to use subok=False more and more. Matrix, despite being a subclass of ndarray, is too incompatible with ndarray to really mix and match most of the time. So it seems safest just to force everything to be a bog-stock ndarray. I made some convenience functions that provide the right args to array for my own use. Yes, Matrix objects are tricky beasts... I use quite regularly masked arrays and time series (as ndarray subclasses), and don't want to lose the extra information w/ subok=False. But it's all matter of personal goals, I agree. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Best way to run python parallel
On 3/29/07, Brad Malone [EMAIL PROTECTED] wrote: Hi, I use python for some fairly heavy scientific computations (at least to be running on a single processor) and would like to use it in parallel. I've seen some stuff online about Parallel Python and mpiPy, but I don't know much about them. Is a python-specific program needed to run python in parallel or are the others ( e.g., mpi/poe) just more difficult to work with? And which one would you recommend? Brad, I am the author of mpi4py. I really suggest you try this for several reasons: - As Brian Granger said, it build almost anywhere (I only use linux, but other guys use it on MAC and Win). - It is just a python module, you don't need to rebuild a python interpreter (really true unless you want to use old MPICH1 implementation). However, parallel debuggin can be really hard. I am waiting for Brian's work on IPython1. - You can communicate numpy arrays very efficiently (for moderately sized arrays, the performace is almost the same that the one in C on gigabit ethernet clusters). In the current state, you have to manually specify the MPI datatypes. This could be automated in the future, once the Travis's buffer interface gets in on core Python. Additionally, you can communicate almost any object supporting pickling, this is not so efficient, but really transparent is you want to communicate a small, nested object like a dict. - And finally, one thing that is really important to me (and in fact, what motivated my to develop mpi4py). Its API is really similar to the C++ MPI bindings, so you can read any MPI book/tutorial/code snipet, and translate it to working Python code. A final note. Just in case you need to do parallel linear algebra, and solve linear/nonlinear systems of ecuations, I've also developed petsc4py, a port to PETSc libraries. You can find mpi4py (and also petsc4py) at PyPI for download (or just try setuptools 'easy_install', this will download, build and install mpi4py for you, just be sure of having 'mpicc' MPI compiler wrappers on your PATH). -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion