Re: [Numpy-discussion] Controlling NumPy __mul__ method or forcing it to use __rmul__ of the "other"

2017-06-19 Thread Ilhan Polat
Ah OK. I was just wondering if there are recommended values to start with in case below some values are reserved for NumPy/SciPy internals. I'll just go with the ufunc path just in case. This really looks like TeX overful/underful badness value adjustment. As long as the journal accepts don't

Re: [Numpy-discussion] Controlling NumPy __mul__ method or forcing it to use __rmul__ of the "other"

2017-06-19 Thread Nathan Goldbaum
I don't think there's any real standard here. Just doing a github search reveals many different choices people have used: https://github.com/search?l=Python=__array_priority__=Code=%E2%9C%93 On Mon, Jun 19, 2017 at 11:07 AM, Ilhan Polat wrote: > Thank you. I didn't know

Re: [Numpy-discussion] Controlling NumPy __mul__ method or forcing it to use __rmul__ of the "other"

2017-06-19 Thread Ilhan Polat
Thank you. I didn't know that it existed. Is there any place where I can get a feeling for a sane priority number compared to what's being done in production? Just to make sure I'm not stepping on any toes. On Mon, Jun 19, 2017 at 5:36 PM, Stephan Hoyer wrote: > I answered

Re: [Numpy-discussion] Controlling NumPy __mul__ method or forcing it to use __rmul__ of the "other"

2017-06-19 Thread Stephan Hoyer
I answered your question on StackOverflow: https://stackoverflow.com/questions/40694380/forcing-multiplication-to-use-rmul-instead-of-numpy-array-mul-or-byp/44634634#44634634 In brief, you need to set __array_priority__ or __array_ufunc__ on your object. On Mon, Jun 19, 2017 at 5:27 AM, Ilhan

[Numpy-discussion] Controlling NumPy __mul__ method or forcing it to use __rmul__ of the "other"

2017-06-19 Thread Ilhan Polat
I will assume some simple linear systems knowledge but the question can be generalized to any operator that implements __mul__ and __rmul__ methods. Motivation: I am trying to implement a gain matrix, say 3x3 identity matrix, for time being with a single input single output (SISO) system that I