On Fri, Oct 1, 2010 at 2:20 PM, Pierre GM wrote:
>
> On Oct 1, 2010, at 1:03 PM, Sebastian Haase wrote:
>
However, I had done this before for some specific image-file-types:
those would add there own attribute to ndarray array (e.g. arr.Mrc)
Now if I call the new ndarray_meta on my
On Oct 1, 2010, at 1:03 PM, Sebastian Haase wrote:
>>> However, I had done this before for some specific image-file-types:
>>> those would add there own attribute to ndarray array (e.g. arr.Mrc)
>>> Now if I call the new ndarray_meta on my ndarray_with_mrc I loose the
>>> `Mrc` attribute, leavin
On Fri, Oct 1, 2010 at 12:38 PM, Pierre GM wrote:
>
> On Oct 1, 2010, at 11:26 AM, Sebastian Haase wrote:
>
>> Hi,
>> I'm trying to add a 'meta' attribute to ndarray to keep track of image
>> data filenames and resolution etc.
>> Following the excellent document
>> http://docs.scipy.org/doc/numpy
On Oct 1, 2010, at 11:26 AM, Sebastian Haase wrote:
> Hi,
> I'm trying to add a 'meta' attribute to ndarray to keep track of image
> data filenames and resolution etc.
> Following the excellent document
> http://docs.scipy.org/doc/numpy/user/basics.subclassing.html
> this worked right away.
>
>
On Fri, Oct 1, 2010 at 11:26 AM, Sebastian Haase wrote:
> Hi,
> I'm trying to add a 'meta' attribute to ndarray to keep track of image
> data filenames and resolution etc.
> Following the excellent document
> http://docs.scipy.org/doc/numpy/user/basics.subclassing.html
> this worked right away.
>
Hi,
I'm trying to add a 'meta' attribute to ndarray to keep track of image
data filenames and resolution etc.
Following the excellent document
http://docs.scipy.org/doc/numpy/user/basics.subclassing.html
this worked right away.
However, I had done this before for some specific image-file-types:
t
On Sun, Aug 10, you wrote:
> What functionality, may I ask ?
I am working on a dimensioned array data structure that is a subclass
of ndarray and lets you keep track of the different dimensions of an
array, assign labels to them (and the different levels on each
dimensions) and allows for smart in
On Sunday 10 August 2008 15:50:15 Christoph T. Weidemann wrote:
> Pierre,
> Thanks for the fast and informative answers!
Sorry again for the confusion, the first answer was definitely too fast...
> I used the base attribute to call ndarray functions on
> my derived class and obviously that faile
Pierre,
Thanks for the fast and informative answers!
On Sun you wrote:
> So no, you didn't do anything wrong. What behavior were you expecting ?
I was expecting that calls to self.base would produce identical
results for objects of the TestArray class, no matter how these calls
are triggered. I
On Sunday 10 August 2008 14:26:33 Christoph T. Weidemann wrote:
> Why whould tst.sort() show the correct base class and np.sort show
> NoneType as base class for tst?
> I'd appreciate any insights ...
Christoph,
I should take the time to read the question first before answering.
So, according to
You wrote:
> numpy functions will return arrays of the type which has the largest priority,
> with ndarrays a priority of 1 by default. If you set a Class variable
> __array_priority__ to a number larger than 1, that should fix your problem.
The following code produces the same behavior:
import n
On Sunday 10 August 2008 14:26:33 Christoph T. Weidemann wrote:
> Why whould tst.sort() show the correct base class and np.sort show
> NoneType as base class for tst?
> I'd appreciate any insights ...
numpy functions will return arrays of the type which has the largest priority,
with ndarrays a p
I've come across a strange behavior for classes subclassed from ndarray.
Here's a minimal example that illustrates the problem:
import numpy as np
class TestArray(np.ndarray):
def __new__(cls, data, info=None, dtype=None, copy=False):
subarr = np.array(data, dtype=dtype, copy=copy)
On Thu, May 1, 2008, Travis E. Oliphant wrote:
> You are just seeing the result of __repr__. The printing code works by
> accessing slices of the array. These slices create new instances of
> your TestArray class which have a smaller number of dimensions. That's all.
Ahh, that makes sense. Th
ctw wrote:
> Hi!
>
> I ran into some strange (at least to me) issues with sublasses of
> ndarray. The following minimal class definition illustrates the
> problem:
>
>
>
> import numpy as np
> class TestArray(np.ndarray):
> def __new__(cls, d
Hi!
I ran into some strange (at least to me) issues with sublasses of
ndarray. The following minimal class definition illustrates the
problem:
import numpy as np
class TestArray(np.ndarray):
def __new__(cls, data, info=None, dtype=None, co
16 matches
Mail list logo