I am using numpy distutils to build the extension modules of a project, which
have been so far written in C, and wrapped by SWIG. Now I would like to try
cython (as everynone!), but still be able to use the numpy distutils. I have
found the thread , which offers some solution, but it does not mention using
the Configuration class from numpy.distutils.misc_util which I use.
How can I tell Configuration to use Cython instead of Pyrex?
On Nov 2, 2009, at 11:09 AM, numpy-discussion-request(a)scipy.org wrote:
> From: David Cournapeau <cournape(a)gmail.com>
> Subject: [Numpy-discussion] 1.4.0: Setting a firm release date for 1st
> To: Discussion of Numerical Python <numpy-discussion(a)scipy.org>
> Content-Type: text/plain; charset=UTF-8
> I think it is about time to release 1.4.0. Instead of proposing a
> release date, I am setting a firm date for 1st December, and 16th
> november to freeze the trunk. If someone wants a different date, you
> have to speak now.
> There are a few issues I would like to clear up:
> - Documentation for datetime, in particular for the public C API
> - Snow Leopard issues, if any
> Otherwise, I think there has been quite a lot of new features. If
> people want to add new functionalities or features, please do it soon,
This seems like an appropriate opportunity to ping an issue I posted
Basically, interp doesn't currently play nice with numpy scalars.
Patch included with ticket (see second comment).
I am getting strange behaviour with the following code:
Pd = ((numpy.sign(C_02) == 1) * Pd_pos) + ((numpy.sign(C_02) == -1) *
Ps = ((numpy.sign(C_02) == 1) * Ps_pos) + ((numpy.sign(C_02) == -1) *
where Pd, Ps, C_02, Pd_pos, Pd_neg, Ps_pos and Ps_neg are all Float32
numpy arrays of the same shape.
The problem is that the first line evaluates correctly (Pd is what it
should be), but the second line does not. However, if I run the same
line of code manually in IDLE, then it evaluates correctly! In other
words, Ps as returned by the function does not match the value that I
should get and obtain when entering the exact same code in IDLE.
Basically, (numpy.sign(C_02) == 1) evaluates to either True or False,
and multiplying with another array will give either 0 (when false) or
the value of the array. The purpose of this code is to compute Pd and
Ps without loops, and to take the value from Pd_pos or Ps_pos when
C_02 is positive or of Pd_neg and Ps_neg when C_02 is negative.
Using loops, it looks like this:
for index in numpy.ndindex(ysize, xsize):
if numpy.sign(C_02[index]) == 1:
Pd[index] = Pd_pos[index]
Ps[index] = Ps_pos[index]
elif numpy.sign(C_02[index]) == -1:
Pd[index] = Pd_neg[index]
Ps[index] = Ps_neg[index]
which also works fine, but takes much longer.
Python 2.6.3, IDLE 2.6.1, Numpy 1.3.0, Snow Leopard, the script also
uses some GDAL, matplotlib and scipy functions...
What is the best way to create a view that is composed of sections of many
For example, imagine I had
a = np.array(range(0, 12)).reshape(3, 4)
b = np.array(range(12, 24)).reshape(3, 4)
c = np.array(range(24, 36)).reshape(3, 4)
v = multiview((3, 4))
#the idea of the following lines is that the 0th row of v is
#a view on the first row of a. the same would hold true for
#the 1st and 2nd row of v and the 0th rows of b and c, respectively
v = a
v = b
v = c
#change the underlying arrays
a[0, 0] = 50
b[0, 0] = 51
c[0, 0] = 52
#I would want all these assertions to pass because the view
#refers to the rows of a, b and c
assert v[0, 0] == 50
assert v[1, 0] == 51
assert v[2, 0] == 52
Is there any way to do this?
Having trouble viewing this email? Click here
Friday, November 6:
How do I... use Envisage for GUIs?
Envisage is a Python-based framework for building extensible
applications. The Envisage Core and corresponding Envisage Plugins are
components of the Enthought Tool Suite. We've found that Envisage
grants us a degree of immediate functionality in our custom
applications and have come to rely on the framework in much of our
For November's EPD webinar, Corran Webster will show how you can hook
together existing Envisage plugins to quickly create a new GUI. We'll
also look at how you can easily turn an existing Traits UI interface
into an Envisage plugin.
New: Linux-ready webinars!
In order to better serve the Linux-users among our subscribers, we've
decided to begin hosting our EPD webinars on WebEx instead of
GoToMeeting. This means that our original limit of 35 attendees will
be scaled back to 30. As usual, EPD subscribers at a Basic level or
above will be guaranteed seats for the event while the general public
may add their name to the wait list here.
EPD Webinar: How do I... use Envisage for GUIs?
Friday, November 6
1pm CDT/6pm UTC
We look forward to seeing you Friday! As always, feel free to contact
us with questions, concerns, or suggestions for future webinar topics.
The Enthought Team
QUICK LINKS :::
This email was sent to leah(a)enthought.com by amenity(a)enthought.com.
Update Profile/Email Address | Instant removal with SafeUnsubscribe™ |
Enthought, Inc. | 515 Congress Ave. | Suite 2100 | Austin | TX | 78701
I was surprised by this - is it a bug or a feature or me
a = np.zeros((1,), dtype=[('f1', 'u2')])
b = a.copy()
b == a
(array([True], dtype=bool)) # as expected
c = a.byteswap().newbyteorder()
c == a
(False) # to me, unexpected, note bool rather than array
Thanks for any clarification...