[SciPy-dev] are masked array statistical function hidden intentionally?

josef.pktd@gmai... josef.pktd@gmai...
Wed Nov 19 07:49:16 CST 2008


On Wed, Nov 19, 2008 at 4:07 AM, Pauli Virtanen <pav@iki.fi> wrote:
> Tue, 18 Nov 2008 19:04:01 -0500, josef.pktd wrote:
>> On Tue, Nov 18, 2008 at 4:52 PM, Pierre GM <pgmdevlist@gmail.com> wrote:
>>> About the documentation: well, I guess I should take the blame for not
>>> having written more thorough docstrings.  However, I'm not in charge of
>>> building the whole doc.
> [clip]
>> I thought it more as an "advertising" question, since the docs seem to
>> pick up only functions that are exposed in __all__, also np.lookfor does
>> not seem to pick up any of the functions.
>
> The docs don't pick up functions automatically -- instead, each function
> is manually added to the docs, to a place that makes sense. This is the
> way Sphinx works, and IMHO it is the correct way -- only the developer
> knows what it supposed to be the API of a module and how to best describe
> it.
>
> The Scipy docs live in the Scipy repository, under doc/. Please feel free
> to add whatever you think is missing there. Ditto for the numpy docs
> (they are also in Numpy's SVN, but under /numpy-docs/trunk).
>
> Pierre -- the masked array documentation in Numpy Reference Guide is
> especially lacking as not all MA functions are listed or the
> functionality explained. I'm not so familiar with MA, so I would
> appreciate help in writing the documentation for this part of Numpy.
>
> np.lookfor is a different beast, and it IIRC picks only items listed in
> __all__. I am the one to blame if the logic in it is incorrect, so please
> tell me if you have a better idea how it should work.
>
> --
> Pauli Virtanen
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>


Currently the MA related functions are split over two files, and users would
have to know which function is in which module.

Should we create a namespace stats.ma that imports all of mstats and mmorestats?
Then stats.ma can be imported and included in stats,__init__.__all__.

something like (or relative imports)
stats.ma.py
-----------------
from scipy.stats.mstats import *
from scipy.stats.mmorestats import *
----------------

this would make it easier to find, both for users and for np.lookfor.


Another question:

When users want to use masked array version by default, is there a recipe
to overwrite all corresponding functions in scipy.stats, i.e. something like

stats.__dict__.update(stats.ma.__dict__   ... but only for public function.

If users need this often, there could even be a function, like:

def make_ma_as_default:
    scipy.stats.__dict__.update    with stats.ma methods

Josef


More information about the Scipy-dev mailing list