Hello,
The attached .npy file was written from custom C++ code. It loads
fine in Numpy 1.6.2 with Python 2.6 installed through MacPorts, but
fails on a different machine with Numpy 2.0.0 installed via Superpack:
box:array% which python
/usr/bin/python
box:array% which python
box:array% python
Py
On Thu, Aug 2, 2012 at 1:26 PM, Robert Kern wrote:
> On Thu, Aug 2, 2012 at 8:46 PM, Geoffrey Irving wrote:
>> Hello,
>>
>> The attached .npy file was written from custom C++ code. It loads
>> fine in Numpy 1.6.2 with Python 2.6 installed through MacPorts, but
>
On Thu, Aug 2, 2012 at 3:13 PM, Robert Kern wrote:
> On Thu, Aug 2, 2012 at 11:41 PM, Geoffrey Irving wrote:
>> On Thu, Aug 2, 2012 at 1:26 PM, Robert Kern wrote:
>>> On Thu, Aug 2, 2012 at 8:46 PM, Geoffrey Irving wrote:
>>>> Hello,
>>>>
>>>
I discovered this from C via the PyArray_FromAny function, but here it
is in Python:
>>> asarray(None,dtype=float)
array(nan)
Is this expected or documented behavior? It seems quite unintuitive
and surprising that this wouldn't throw an exception.
Is there a way to disable this behavior
t;>>> np.double(None)
> nan
>
> On Mon, Jan 28, 2013 at 3:48 PM, Geoffrey Irving wrote:
>>
>> I discovered this from C via the PyArray_FromAny function, but here it
>> is in Python:
>>
>> &g
I have the following two structured dtypes:
rotation (quaternion) = dtype([('s','f8'),('v','3f8')])
frame = dtype([('t','3f8'),('r',rotation)])
For various reasons, I usually store rotation arrays in a class
Rotations deriving from ndarray, and frames in a class Frames deriving
from ndarr
Hello,
I have an extension module which holds on to a reference to a numpy
array in a static variable. When the process shuts down, the C++
destructor triggers array_dealloc via Py_DECREF, and I get
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at
When attempting to cast to a user defined type, PyArray_GetCast looks
up the cast function in the dictionary but doesn't check if the entry
exists. This causes segfaults. Here's a patch.
Geoffrey
diff --git a/numpy/core/src/multiarray/convert_datatype.c
b/numpy/core/src/multiarray/convert_datat
Hello,
I'm trying to add a fixed precision rational number dtype to numpy,
and am running into an issue trying to register ufunc loops. The code
in question looks like
int npy_rational = PyArray_RegisterDataType(&rational_descr);
PyObject* equal = ... // extract equal object from the imp
case 0:
return 0;
}
}
On Sun, Dec 4, 2011 at 9:29 AM, Charles R Harris
wrote:
>
>
> On Sat, Dec 3, 2011 at 8:14 PM, Geoffrey Irving wrote:
>>
>> Hello,
>>
>> I'm trying to add a fixed precision rational number dtype to numpy,
>>
On Sun, Dec 4, 2011 at 10:02 AM, Charles R Harris
wrote:
>
>
> On Sat, Dec 3, 2011 at 5:28 PM, Geoffrey Irving wrote:
>>
>> When attempting to cast to a user defined type, PyArray_GetCast looks
>> up the cast function in the dictionary but doesn't check if t
On Sun, Dec 4, 2011 at 5:18 PM, Charles R Harris
wrote:
>
>
> On Sun, Dec 4, 2011 at 5:41 PM, Geoffrey Irving wrote:
>>
>> This may be the problem. Simple diffs are pleasant. I'm guessing
>> this code doesn't get a lot of testing. Glad it's there,
On Sun, Dec 4, 2011 at 6:45 PM, Charles R Harris
wrote:
>
>
> On Sun, Dec 4, 2011 at 6:59 PM, Geoffrey Irving wrote:
>>
>> On Sun, Dec 4, 2011 at 5:18 PM, Charles R Harris
>> wrote:
>> >
>> >
>> > On Sun, Dec 4, 2011 at 5:41 PM, Geoff
On Mon, Dec 5, 2011 at 6:59 AM, Charles R Harris
wrote:
> Hi Geoffrey,
>
> On Mon, Dec 5, 2011 at 12:37 AM, Geoffrey Irving wrote:
>>
>> On Sun, Dec 4, 2011 at 6:45 PM, Charles R Harris
>> wrote:
>> >
>> >
>> > On Sun, Dec 4, 2011 at 6:59
Hello,
As a followup to the prior thread on bugs in user defined types in
numpy, I converted my rational number class from C++ to C and switched
to 32 bits to remove the need for unportable 128 bit numbers. It
should be usable as a fairly thorough test case for user defined types
now. It does ra
On Wed, Dec 21, 2011 at 3:56 AM, Charles R Harris
wrote:
> Hi Geoffrey,
>
> On Tue, Dec 20, 2011 at 7:24 PM, Geoffrey Irving wrote:
>>
>> Hello,
>>
>> As a followup to the prior thread on bugs in user defined types in
>> numpy, I converted my rational
Is there a standard way of creating an object array restricted to a
particular python type? I want a safe way of sending arrays of
objects back and forth between Python and C++, and it'd be great if I
could use numpy arrays on the Python side instead of creating a new
type.
For example, I might h
On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz wrote:
> Hi Geoffrey,
>
> Not to toot my own horn here too much, but you really should have a look at
> xdress (http://xdress.org/ and https://github.com/xdress/xdress). XDress
> will generate a wrapper of the Force class for you and then also crea
Is there a standard way in numpy of getting a char with C-native
integer signedness? I.e.,
boost::is_signed::value ? numpy.byte : numpy.ubyte
but without nonsensical mixing of languages?
Thanks,
Geoffrey
___
NumPy-Discussion mailing list
NumPy-Dis
On Thu, Oct 31, 2013 at 2:08 AM, Robert Kern wrote:
> On Thu, Oct 31, 2013 at 12:52 AM, Geoffrey Irving wrote:
>>
>> Is there a standard way in numpy of getting a char with C-native
>> integer signedness? I.e.,
>>
>> boost::is_signed::value ? numpy.byt
Hello,
If I create an mmap'ed array, and then generate another array
referencing only its base, destruction of the original mmap'ed array
closes the mmap. The second array is then prone to segfaults.
I think the best fix is to put the responsibility for flushing the
mmap onto the actual mmap obj
Hello,
I'm not sure where the correct place to ask questions about Mayavi, so
feel free to redirect me elsewhere.
I have a triangle mesh with a bunch of data on each face. The only
color-relevant argument to triangular_mesh I know about is scalars,
which is one value per vertex. Is there a way
On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern wrote:
> On Thu, Sep 30, 2010 at 15:30, Geoffrey Irving wrote:
>> Hello,
>>
>> I'm not sure where the correct place to ask questions about Mayavi, so
>> feel free to redirect me elsewhere.
>
> https://mail.enthou
On Fri, Oct 1, 2010 at 10:18 AM, Robert Kern wrote:
> On Thu, Sep 30, 2010 at 16:00, Geoffrey Irving wrote:
>> On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern wrote:
>>> On Thu, Sep 30, 2010 at 15:30, Geoffrey Irving wrote:
>>>> Hello,
>>>>
>&g
On Fri, Oct 1, 2010 at 11:39 AM, Robert Kern wrote:
> On Thu, Sep 30, 2010 at 16:26, Geoffrey Irving wrote:
>> On Fri, Oct 1, 2010 at 10:18 AM, Robert Kern wrote:
>>> On Thu, Sep 30, 2010 at 16:00, Geoffrey Irving wrote:
>>>> On Fri, Oct 1, 2010 at 9:38 AM, Ro
On Fri, Jan 30, 2009 at 5:18 AM, Neal Becker wrote:
> A nit, but it would be nice if 'ones' could fill with a value other than 1.
>
> Maybe an optional val= keyword?
You can use the "tile" function for this. "tile(3,3)" creates an
array of 3 3's.
Geoffrey
___
On Sat, Mar 28, 2009 at 12:47 AM, Robert Kern wrote:
> 2009/3/27 Charles R Harris :
>>
>> On Fri, Mar 27, 2009 at 4:43 PM, Robert Kern wrote:
>>>
>>> On Fri, Mar 27, 2009 at 17:38, Bryan Cole wrote:
>>> > I have a number of arrays of shape (N,4,4). I need to perform a
>>> > vectorised matrix-mul
Hello,
Is there an efficient way to implement a nonuniform gather operation
in numpy? Specifically, I want to do something like
n,m = 100,1000
X = random.uniform(size=n)
K = random.randint(n, size=m)
Y = random.uniform(size=m)
for k,y in zip(K,Y):
X[k] += y
but I want it to be fast. The n
On Sat, Sep 27, 2008 at 10:01 PM, Nathan Bell <[EMAIL PROTECTED]> wrote:
> On Sun, Sep 28, 2008 at 12:34 AM, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
>>
>> Is there an efficient way to implement a nonuniform gather operation
>> in numpy? Specifically, I wa
Hello,
Currently in numpy comparing dtypes for equality with == does an
internal PyArray_EquivTypes check, which means that the dtypes NPY_INT
and NPY_LONG compare as equal in python. However, the hash function
for dtypes reduces id(), which is therefore inconsistent with ==.
Unfortunately I can'
On Wed, Oct 15, 2008 at 12:56 PM, Robert Kern <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 15, 2008 at 02:20, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> Currently in numpy comparing dtypes for equality with == does an
>> internal PyArray_EquivT
Currently numpy arrays are either writable or unwritable, but
unwritable arrays can still be changed through other copies. This
means that when a numpy array is passed into an interface that
requires immutability for safety reasons, a copy always has to be
made.
One way around this would be to ad
On Wed, Dec 17, 2008 at 2:24 PM, Robert Kern wrote:
> On Wed, Dec 17, 2008 at 15:52, Geoffrey Irving wrote:
>> Currently numpy arrays are either writable or unwritable, but
>> unwritable arrays can still be changed through other copies. This
>> means that when a numpy ar
On Wed, Dec 17, 2008 at 3:34 PM, Robert Kern wrote:
> On Wed, Dec 17, 2008 at 16:51, Geoffrey Irving wrote:
>> On Wed, Dec 17, 2008 at 2:24 PM, Robert Kern wrote:
>>> On Wed, Dec 17, 2008 at 15:52, Geoffrey Irving wrote:
>>>> Currently numpy arrays are eith
On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern wrote:
> On Wed, Dec 17, 2008 at 17:45, Geoffrey Irving wrote:
>> On Wed, Dec 17, 2008 at 3:34 PM, Robert Kern wrote:
>>> On Wed, Dec 17, 2008 at 16:51, Geoffrey Irving wrote:
>>>> On Wed, Dec 17, 2008 at 2:24 PM, Ro
On Thu, Dec 18, 2008 at 1:00 PM, Robert Kern wrote:
> On Thu, Dec 18, 2008 at 10:01, Geoffrey Irving wrote:
>> On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern wrote:
>
>>> It just seems to me to be another complication that does not provide
>>> any guarantees. You s
Hello,
I have a large number of points (shape (n,3)), and a matching
number of 3x3 matrices (shape (n,3,3)), and I want to compute
the product of each matrix times the corresponding point.
I can't see a way to do this operation with dot or tensordot,
since these routines either sum across an inde
On Thu, Feb 28, 2008 at 05:57:29PM -0600, Robert Kern wrote:
> On Thu, Feb 28, 2008 at 4:34 PM, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I have a large number of points (shape (n,3)), and a matching
> > number of 3x3 matrices (shape (n,3,3)
On Thu, Feb 28, 2008 at 06:55:11PM -0600, Robert Kern wrote:
> On Thu, Feb 28, 2008 at 6:43 PM, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
> > > The magic is in In[27]. We reshape the array of vectors to be
> > > compatible with the shape of the array of matrices. When
39 matches
Mail list logo