Ok, to come back to the original question I have pushed a branch
"bugtracking.01.numpyops" to github.com/friedrichromstedt/upy. If you
want to inspect the problem with some closer look, please pull from
this repo, and run demo.py in the branch mentioned. Today's version
is tagged 10-02-14_GMT-22-
Friedrich Romstedt wrote:
> 2010/2/11 Keith Goodman :
>> The problem I have now is that I don't know where to place the line of
>> code that changes the meaning of numpy's equal. I don't know when
>> someone will do
>
> Well, I think a solution is as written before to put a test whether
> the othe
2010/2/11 Keith Goodman :
> The problem I have now is that I don't know where to place the line of
> code that changes the meaning of numpy's equal. I don't know when
> someone will do
Well, I think a solution is as written before to put a test whether
the other operand is in fact a myclass instan
2010/2/11 Robert Kern :
> It turns certain specifically-written generators into full context managers.
>
> http://docs.python.org/library/contextlib#contextlib.contextmanager
Ok, thanks! I didn't know about before. (To the anonymous reader
seeking for information as me:
http://www.python.org/dev
On Thu, Feb 11, 2010 at 15:14, Friedrich Romstedt
wrote:
>> Did you omit the @contextmanager decorator?
>
> Oh, yes! I guessed it would mean: In module contextmanager you write
> what follows after the colon? What does this decoration do?
It turns certain specifically-written generators into full
On Thu, Feb 11, 2010 at 12:47 PM, Robert Kern wrote:
> On Thu, Feb 11, 2010 at 14:40, Keith Goodman wrote:
>> On Thu, Feb 11, 2010 at 12:32 PM, Friedrich Romstedt
>> wrote:
Hey! You broke my numpy :)
>> def addbug(x, y):
...: return x - y
...:
>> old_funcs =
> Did you omit the @contextmanager decorator?
Oh, yes! I guessed it would mean: In module contextmanager you write
what follows after the colon? What does this decoration do?
Friedrich
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://
2010/2/11 :
> If this is global it won't work, because only the last package that
> changes it wins. ??
Hm, at the current implementation of upy you're right, but I think you
can do in the resp. module like:
original_numpy_ops = numpy.set_numeric_ops()
[ ... implementation of my_add_object, cal
On Thu, Feb 11, 2010 at 15:03, Friedrich Romstedt
wrote:
> Robert Kern:
>> def numpy_ops(**ops):
>> old_ops = np.set_numeric_ops(**ops)
>> try:
>> yield
>> finally:
>> np.set_numeric_ops(**old_ops)
>>
>>
>> with numpy_ops(multiply=...):
>> print np.array([1, 2, 3]) * np.a
Robert Kern:
> def numpy_ops(**ops):
> old_ops = np.set_numeric_ops(**ops)
> try:
> yield
> finally:
> np.set_numeric_ops(**old_ops)
>
>
> with numpy_ops(multiply=...):
> print np.array([1, 2, 3]) * np.array([1, 2, 3])
Well, at least for me in Py 2.5 this fails with:
Att
On Thu, Feb 11, 2010 at 14:40, Keith Goodman wrote:
> On Thu, Feb 11, 2010 at 12:32 PM, Friedrich Romstedt
> wrote:
>>> Hey! You broke my numpy :)
>>>
> def addbug(x, y):
>>> ...: return x - y
>>> ...:
> old_funcs = np.set_numeric_ops(add=addbug)
> np.array([1]) + np.array([1
On Thu, Feb 11, 2010 at 3:43 PM, wrote:
> On Thu, Feb 11, 2010 at 3:40 PM, Keith Goodman wrote:
>> On Thu, Feb 11, 2010 at 12:32 PM, Friedrich Romstedt
>> wrote:
Hey! You broke my numpy :)
>> def addbug(x, y):
...: return x - y
...:
>> old_funcs = np.set_num
On Thu, Feb 11, 2010 at 3:40 PM, Keith Goodman wrote:
> On Thu, Feb 11, 2010 at 12:32 PM, Friedrich Romstedt
> wrote:
>>> Hey! You broke my numpy :)
>>>
> def addbug(x, y):
>>> ...: return x - y
>>> ...:
> old_funcs = np.set_numeric_ops(add=addbug)
> np.array([1]) + np.array(
On Thu, Feb 11, 2010 at 12:32 PM, Friedrich Romstedt
wrote:
>> Hey! You broke my numpy :)
>>
def addbug(x, y):
>> ...: return x - y
>> ...:
old_funcs = np.set_numeric_ops(add=addbug)
np.array([1]) + np.array([1])
>> array([0])
> Yea, that's what I meant. Great.
>
> :-) :
> Hey! You broke my numpy :)
>
>>> def addbug(x, y):
> ...: return x - y
> ...:
>>> old_funcs = np.set_numeric_ops(add=addbug)
>>> np.array([1]) + np.array([1])
> array([0])
Yea, that's what I meant. Great.
:-) :-)
Friedrich
___
NumPy-Discus
On Thu, Feb 11, 2010 at 12:21 PM, Friedrich Romstedt
wrote:
> Hi Keith,
>
> 2010/2/11 Keith Goodman :
>> Is there some way to tell numpy to use my __eq__ instead of its own?
>> That would solve my problem. I had a similar problem with __radd__
>> which was solved by setting __array_priority__ = 10
Oh Sorry, I typed some keys, don't know what I did precisely, but the
message was sent prematurely. Now I repeat:
Hi Keith,
2010/2/11 Keith Goodman :
> Is there some way to tell numpy to use my __eq__ instead of its own?
> That would solve my problem. I had a similar problem with __radd__
> which
Hi Keith,
2010/2/11 Keith Goodman :
> Is there some way to tell numpy to use my __eq__ instead of its own?
> That would solve my problem. I had a similar problem with __radd__
> which was solved by setting __array_priority__ = 10. But that doesn't
> work in this case.
It's quite simple, but hidde
On Thu, Feb 11, 2010 at 7:27 AM, Friedrich Romstedt
wrote:
> Keith Goodman:
>> No one answered my post either :(
>>
>> http://old.nabble.com/arrays-and-__eq__-td26987903.html#a26987903
>>
>> Is it the same issue?
>
> First, before I post the package on github, I dived into Keith's
> problem, and
2010/2/11 Stéfan van der Walt :
> Could you please put your "undarray" as well as the ufunc-wrapper
> online (preferably in a repository) so that we can have a look?
Done, github.com/friedrichromsted/upy . Have fun with it :-) ! And
thanks a lot in advance for your help. You will easily locate t
Keith Goodman:
> No one answered my post either :(
>
> http://old.nabble.com/arrays-and-__eq__-td26987903.html#a26987903
>
> Is it the same issue?
First, before I post the package on github, I dived into Keith's
problem, and here comes the explanation to the wreid behaviour:
I used the code:
cl
Hi Friedrich
On 10 February 2010 20:57, Friedrich Romstedt
wrote:
> I wonder why there is no response on my e-mail dating back to Feb 4.
> Is there nobody interested in it, is somebody working on it, or did it
> simply did not come through? I changed the recipient now to
> "Discussion of Numeric
On Wed, Feb 10, 2010 at 2:41 PM, Alan G Isaac wrote:
> On 2/10/2010 1:57 PM, Friedrich Romstedt wrote:
>> I wonder why there is no response on my e-mail dating back to Feb 4.
>> Is there nobody interested in it, is somebody working on it, or did it
>> simply did not come through?
>
> I'm going to
On 2/10/2010 1:57 PM, Friedrich Romstedt wrote:
> I wonder why there is no response on my e-mail dating back to Feb 4.
> Is there nobody interested in it, is somebody working on it, or did it
> simply did not come through?
I'm going to guess it is because your actual question is at
the very end of
On Wed, Feb 10, 2010 at 10:57 AM, Friedrich Romstedt
wrote:
> I wonder why there is no response on my e-mail dating back to Feb 4.
> Is there nobody interested in it, is somebody working on it, or did it
> simply did not come through? I changed the recipient now to
> "Discussion of Numerical Pyth
I wonder why there is no response on my e-mail dating back to Feb 4.
Is there nobody interested in it, is somebody working on it, or did it
simply did not come through? I changed the recipient now to
"Discussion of Numerical Python", hth ...
Sorry when there is double posting now, it's not intend
Hi,
I'm just coding a package for uncertain arrays using the accelerated
numpy functionality intensively. I'm sorry, but I have to give some
background information first. The package provides a class
upy.undarray, which holds the nominal value and the uncertainty
information. It has methods __a
27 matches
Mail list logo