[Numpy-discussion] Effect of deprecating non-integers for integer function arguments

Sebastian Berg sebastian at sipsolutions.net
Sat Jun 1 05:18:24 EDT 2013


On Fri, 2013-05-31 at 16:32 -0400, josef.pktd at gmail.com wrote:
> On Fri, May 31, 2013 at 2:08 PM, Sebastian Berg
> <sebastian at sipsolutions.net> wrote:
> > Hi,
> >
> > the current numpy master has deprecated non-integers for the use of
> > indexing (not-fancy yet). However I think this should be moved further
> > down in the numpy machinery which means that the conversion utils
> > provided by numpy would generally raise warnings for non-integers.
> >

<snip>

> 
> I haven't checked for statsmodels, but I would consider it a bug on
> our side if we have implicit conversion to integers. We might still
> have some left in older code but changed already most of them.
> I just wrote code like this (upp are quantiles in (0, 1))
> 

Yeah, this is just a heads up that this will probably happen in 1.8 (and
you could test already if you like). I assume most projects will prefer
to have a warning, but I guess that most larger ones are likely to have
such oversights in the code, which will need to be fixed. Even if only
because of the truedivision change in python 3.

- Sebastian

> m_upp = [x[:int(np.round(upp_ * nobs))].mean(0) for upp_ in upp]
> 
> I don't think we use non-integers for reshape.
> 
> Josef
> 
> >
> > The branch implementing this can be found in the PR
> > https://github.com/numpy/numpy/pull/3243
> >
> > Regards,
> >
> > Sebastian
> >
> > _______________________________________________
> > NumPy-Discussion mailing list
> > NumPy-Discussion at scipy.org
> > http://mail.scipy.org/mailman/listinfo/numpy-discussion
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
> 





More information about the NumPy-Discussion mailing list