[SciPy-user] removal of stats.mean et al breaks untested code

josef.pktd@gmai... josef.pktd@gmai...
Mon Apr 6 09:49:13 CDT 2009

On Mon, Apr 6, 2009 at 9:46 AM, Bruce Southey <bsouthey@gmail.com> wrote:
> josef.pktd@gmail.com wrote:
>> I just found another victim of the removal of stats.mean and stats.var
>> stats.gaussian_kde doesn't have any tests, and when I tried to rewrite
>> the option to set the smoothing factor, I found that several methods
>> are broken that use the removed stats.mean and stats.var.
>> If the users of scipy have code similar to the one in scipy.stats,
>> without sufficient test coverage, then fixing all the hidden
>> (untested) usages of removed functions can be pretty painful and will
>> take quite a bit of time.
>> In case that the release cycle of scipy gets shorter, we might want to
>> consider a longer depreciation period.
>> Josef
>> _______________________________________________
>> SciPy-user mailing list
>> SciPy-user@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
> The only other one that I could easily find by looking for the files
> that import stats:
> stats/_support.py in the collapse function line 179:
>    if cfcn is None:
>        cfcn = stats.mean
>    a = asarray(a)

Thank you for finding this.

I tried to fix this function, but it is more thoroughly broken.

I never looked at function in stats._support that are not used
anywhere else, like collapse. From the description, it actually looks
like a useful function, there where some questions on the mailing list
asking for something similar. But the current collapse mixes
inconsistently array and list operations, and after a short time, I
only get the simplest case to work.
I have a rewrite in a similar function that, I guess, will be faster.
So for now I will just open a ticket to fix this.


More information about the SciPy-user mailing list