Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-21 Thread Nathaniel Smith
On Tue, Feb 21, 2012 at 4:04 AM, Travis Oliphant tra...@continuum.io wrote:
 It uses llvm-py (modified to work with LLVM 3.0) and code I wrote to do the
 translation from Python byte-code to LLVM.   This LLVM can then be JITed.
   I have several applications that I would like to use this for.   It would
 be possible to write more of NumPy using this approach.     Initially, it
 makes it *very* easy to create a machine-code ufunc from Python code.
 There are other use-cases of having loops written in Python and plugged in
 to a calculation, filtering, or indexing framework that this system will be
 useful for.

Very neat!

It's interesting that you decided to use Python bytecode as your
source representation. I'm curious what your strategy is for
overcoming all the challenges that have plagued previous attempts to
efficiently compile real Python? (Unladen Swallow, PyPy, etc.) Just
support some subset of the language that's easy to handle and do type
inference over? Or do you plan to continue using Python as your input
language?

I guess the conventional wisdom would be that there's a lot of
potential for using LLVM to generate efficient specialized loops for
numpy on the fly (cf. llvm-pipe for a similar and successful project),
but that the key would be to use a more specialized representation
than Python bytecode -- one that left out hard/irrelevant parts of the
language, that had richer type information, that didn't change around
for different Python releases, etc.

-- Nathaniel
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] is there an efficient way to get a random set of subsets/combinations?

2012-02-21 Thread Yaroslav Halchenko
Thank you guys for replies!

On Mon, 20 Feb 2012, Christopher Jordan-Squire wrote:
 If you're using numpy 2.0 (the development branch), the function
 numpy.random.choice might do what you're looking for.

yeap -- handy one, although would require manual control over
repetitions lazy me was trying to avoid ;)

On Tue, 21 Feb 2012, Val Kalatsky wrote:
Hi Slava,

Mom, is that you? ;-)

Since your k is only 10, here is a�quickie:
import numpy as np
arr = np.arange(n)
for i in range(k):
� � np.random.shuffle(arr)
� � print np.sort(arr[:p])
If your ever get non-unique entries in a set of k=10 for your n and p,
consider yourself lucky:)

well -- I just thought that there might be an ideal function which in
limit would return all combinations if given large enough k for
reasonably small (n, p)... but indeed I should just put a logic in place
to treat those cases separately.

-- 
=--=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Where is arrayobject.h?

2012-02-21 Thread Neal Becker
What is the correct way to find the installed location of arrayobject.h?

On fedora, I had been using:
(via scons):

import distutils.sysconfig
PYTHONINC = distutils.sysconfig.get_python_inc()
PYTHONLIB = distutils.sysconfig.get_python_lib(1)

NUMPYINC = PYTHONLIB + '/numpy/core/include'

But on ubuntu, this fails.  It seems numpy was installed into 
/usr/local/lib/..., while PYTHONLIB expands to /usr/lib/python2.7/dist-packages.

Is there a universal method?

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Where is arrayobject.h?

2012-02-21 Thread V. Armando Solé
On 21/02/2012 19:26, Neal Becker wrote:
 What is the correct way to find the installed location of arrayobject.h?

 On fedora, I had been using:
 (via scons):

 import distutils.sysconfig
 PYTHONINC = distutils.sysconfig.get_python_inc()
 PYTHONLIB = distutils.sysconfig.get_python_lib(1)

 NUMPYINC = PYTHONLIB + '/numpy/core/include'

 But on ubuntu, this fails.  It seems numpy was installed into
 /usr/local/lib/..., while PYTHONLIB expands to 
 /usr/lib/python2.7/dist-packages.

 Is there a universal method?



I use:

import numpy
numpy.get_include()

If that is universal I cannot tell.

Armando


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-21 Thread Gael Varoquaux
On Sun, Feb 19, 2012 at 05:44:27AM -0500, David Warde-Farley wrote:
 I think the comments about the developer audience NumPy will attract are 
 important. There may be lots of C++ developers out there, but the 
 intersection of (truly competent in C++) and (likely to involve oneself in 
 NumPy development) may well be quite small.

That's a very valid concern. It is reminiscent of a possible cause to our
lack of contributors to Mayavi: contributing to Mayavi requires knowing
VTK. One of the major benefits of Mayavi is that it makes it is to use
the power of VTK without understanding it well. The intersection of the
people interested in using Mayavi and able to contribute to it is almost
empty.

This is stricking to me, because I know a lot of who know VTK well. Most
of them couldn't care less for Mayavi: they are happy coding directly in
VTK in C++. This is also a reason why I don't code UIs any more: I simply
cannot find the resource to maintain them in proportion with the number
of users that they garner. A sad statement.

Gael
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Live coding demonstration

2012-02-21 Thread alan
This is the sort of programming environment I would love to have in
python.


http://flowingdata.com/2012/02/20/live-coding-and-inventing-on-principle/

-- 
---
| Alan K. Jackson| To see a World in a Grain of Sand  |
| a...@ajackson.org  | And a Heaven in a Wild Flower, |
| www.ajackson.org   | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake   |
---
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion