Re: [Numpy-discussion] Bump warning stacklevel

2016-01-28 Thread Sebastian Berg
On Mi, 2016-01-27 at 17:12 -0500, Benjamin Root wrote: > I like the idea of bumping the stacklevel in principle, but I am not > sure it is all that practical. For example, if a warning came up when > doing "x / y", I am assuming that it is emitted from within the ufunc > np.divide(). So, you wou

Re: [Numpy-discussion] Bump warning stacklevel

2016-01-27 Thread Benjamin Root
I like the idea of bumping the stacklevel in principle, but I am not sure it is all that practical. For example, if a warning came up when doing "x / y", I am assuming that it is emitted from within the ufunc np.divide(). So, you would need two stacklevels based on whether the entry point was the o

Re: [Numpy-discussion] Bump warning stacklevel

2016-01-27 Thread Ralf Gommers
On Wed, Jan 27, 2016 at 11:02 PM, sebastian wrote: > On 2016-01-27 21:01, Ralf Gommers wrote: > >> >> One issue will be how to keep this consistent. `stacklevel` is used so >> rarely that new PRs will always omit it for new warnings. Will we just >> rely on code review, or would a private wrapper

Re: [Numpy-discussion] Bump warning stacklevel

2016-01-27 Thread sebastian
On 2016-01-27 21:01, Ralf Gommers wrote: On Wed, Jan 27, 2016 at 7:26 PM, Sebastian Berg wrote: Hi all, in my PR about warnings suppression, I currently also have a commit which bumps the warning stacklevel to two (or three), i.e. use: warnings.warn(..., stacklevel=2) (almost) everywhere. T

Re: [Numpy-discussion] Bump warning stacklevel

2016-01-27 Thread Nathaniel Smith
+1 On Wed, Jan 27, 2016 at 10:26 AM, Sebastian Berg wrote: > Hi all, > > in my PR about warnings suppression, I currently also have a commit > which bumps the warning stacklevel to two (or three), i.e. use: > > warnings.warn(..., stacklevel=2) > > (almost) everywhere. This means that for example

Re: [Numpy-discussion] Bump warning stacklevel

2016-01-27 Thread Ralf Gommers
On Wed, Jan 27, 2016 at 7:26 PM, Sebastian Berg wrote: > Hi all, > > in my PR about warnings suppression, I currently also have a commit > which bumps the warning stacklevel to two (or three), i.e. use: > > warnings.warn(..., stacklevel=2) > > (almost) everywhere. This means that for example (tak

[Numpy-discussion] Bump warning stacklevel

2016-01-27 Thread Sebastian Berg
Hi all, in my PR about warnings suppression, I currently also have a commit which bumps the warning stacklevel to two (or three), i.e. use: warnings.warn(..., stacklevel=2) (almost) everywhere. This means that for example (take only the empty warning): np.mean([]) would not print: /usr/lib/py