[SciPy-user] Inconsistent standard deviation and variance implementation in scipy vs. scipy.stats

Anne Archibald peridot.faceted@gmail....
Mon Oct 6 21:30:02 CDT 2008

2008/10/6 Sebastian Haase <haase@msg.ucsf.edu>:
> On Mon, Oct 6, 2008 at 8:34 PM, Anne Archibald
> <peridot.faceted@gmail.com> wrote:
>> 2008/10/6 Stéfan van der Walt <stefan@sun.ac.za>:
>>> 2008/9/26 David Cournapeau <cournape@gmail.com>:
>>>> Yes, it would be nice. What do other people think about deprecating
>>>> all the numpy re-export in scipy ? It would be nice to do for 0.7
>>>> (e.g. in 0.7, deprecated, in 0.8, removed).
>>> There were no objections to this, so may we go ahead?
>> My only concern is possible user confusion: some functions (e.g. sqrt)
>> are provided as "enhanced" versions in scipy, while others are simply
>> reexported. If we remove the reexports, users can't simply use
>> scipy.whatever to get the best-available version of each function,
>> they have to know whether an enhanced version exists. Of course, since
>> the enhanced versions exist because their APIs differ in important and
>> possibly surprising ways (e.g., sqrt(-1) has a different return type
>> from sqrt(1)) this may be a good thing.
> Arguing that SciPy is below 1.0 I think the reexporting should be
> minimized as much as possible.
> I don't thing that some people's preference for
> "from scipy import *"
> (without a preceding "from numpy import *") should not be a deciding point.

The case I was concerned about was

import scipy as sp
x = sp.cos(2*sp.arccos(y))

If this is changed to

import numpy as np
x = np.cos(2*np.arccos(y))

it suddenly stops working for values y>1. To keep the same behaviour
it needs to be

import scipy as sp
import numpy as np
x = np.cos(2*sp.arccos(y))

This is perhaps all right, but it does mean that users need to pay attention.


More information about the SciPy-user mailing list