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
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
:
return 0;
}
}
On Sun, Dec 4, 2011 at 9:29 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sat, Dec 3, 2011 at 8:14 PM, Geoffrey Irving irv...@naml.us wrote:
Hello,
I'm trying to add a fixed precision rational number dtype to numpy,
and am running into an issue trying
On Sun, Dec 4, 2011 at 10:02 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sat, Dec 3, 2011 at 5:28 PM, Geoffrey Irving irv...@naml.us 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 the entry
On Sun, Dec 4, 2011 at 5:18 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Dec 4, 2011 at 5:41 PM, Geoffrey Irving irv...@naml.us 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, though
On Sun, Dec 4, 2011 at 6:45 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Dec 4, 2011 at 6:59 PM, Geoffrey Irving irv...@naml.us wrote:
On Sun, Dec 4, 2011 at 5:18 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Dec 4, 2011 at 5:41 PM, Geoffrey Irving irv
On Mon, Dec 5, 2011 at 6:59 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
Hi Geoffrey,
On Mon, Dec 5, 2011 at 12:37 AM, Geoffrey Irving irv...@naml.us wrote:
On Sun, Dec 4, 2011 at 6:45 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Dec 4, 2011 at 6:59 PM
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
On Wed, Dec 21, 2011 at 3:56 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
Hi Geoffrey,
On Tue, Dec 20, 2011 at 7:24 PM, Geoffrey Irving irv...@naml.us wrote:
Hello,
As a followup to the prior thread on bugs in user defined types in
numpy, I converted my rational number class from
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
On Thu, Aug 2, 2012 at 1:26 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Aug 2, 2012 at 8:46 PM, Geoffrey Irving irv...@naml.us 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
fails
On Thu, Aug 2, 2012 at 3:13 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Aug 2, 2012 at 11:41 PM, Geoffrey Irving irv...@naml.us wrote:
On Thu, Aug 2, 2012 at 1:26 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Aug 2, 2012 at 8:46 PM, Geoffrey Irving irv...@naml.us 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
On Mon, Jan 28, 2013 at 3:48 PM, Geoffrey Irving irv...@naml.us wrote:
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
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
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
On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz scop...@gmail.com 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
Is there a standard way in numpy of getting a char with C-native
integer signedness? I.e.,
boost::is_signedchar::value ? numpy.byte : numpy.ubyte
but without nonsensical mixing of languages?
Thanks,
Geoffrey
___
NumPy-Discussion mailing list
On Thu, Oct 31, 2013 at 2:08 AM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Oct 31, 2013 at 12:52 AM, Geoffrey Irving irv...@naml.us wrote:
Is there a standard way in numpy of getting a char with C-native
integer signedness? I.e.,
boost::is_signedchar::value ? numpy.byte
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 10:18 AM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Sep 30, 2010 at 16:00, Geoffrey Irving irv...@naml.us wrote:
On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Sep 30, 2010 at 15:30, Geoffrey Irving irv...@naml.us wrote:
Hello
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
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
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)), and I want to compute
the product
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 we multiply
the two together
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
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 want to do something like
n,m = 100,1000
X
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
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_EquivTypes check, which means that the dtypes NPY_INT
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
On Wed, Dec 17, 2008 at 2:24 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Dec 17, 2008 at 15:52, Geoffrey Irving irv...@naml.us wrote:
Currently numpy arrays are either writable or unwritable, but
unwritable arrays can still be changed through other copies. This
means that when
On Wed, Dec 17, 2008 at 3:34 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Dec 17, 2008 at 16:51, Geoffrey Irving irv...@naml.us wrote:
On Wed, Dec 17, 2008 at 2:24 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Dec 17, 2008 at 15:52, Geoffrey Irving irv...@naml.us wrote
On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Dec 17, 2008 at 17:45, Geoffrey Irving irv...@naml.us wrote:
On Wed, Dec 17, 2008 at 3:34 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Dec 17, 2008 at 16:51, Geoffrey Irving irv...@naml.us wrote:
On Wed
On Thu, Dec 18, 2008 at 1:00 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Dec 18, 2008 at 10:01, Geoffrey Irving irv...@naml.us wrote:
On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern robert.k...@gmail.com wrote:
It just seems to me to be another complication that does not provide
any
On Fri, Jan 30, 2009 at 5:18 AM, Neal Becker ndbeck...@gmail.com 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
35 matches
Mail list logo