On Mon, Dec 2, 2013 at 3:11 PM, Gael Varoquaux <
[email protected]> wrote:

> On Mon, Dec 02, 2013 at 02:50:45PM +0000, Robert Kern wrote:
> > > +1. "Import *" is a really really bad habit. And hacked up interactive
> > > environments (with crazy start up scripts) make it really hard to
> teach,
> > > because beginners don't make the difference between a hack and Python
> > > proper and find that Python is not very systematic in what it does.
>
> > I know you are addressing a comment from the original proposal, but I
> > think these arguments are in *favor* of the proposal, in general. "api"
> > modules are very useful without "import *". Proper use of the "api"
> > module gives all of the convenience of "import *" without any of these
> > drawbacks.
>
> Yes. I am somewhat wondering if it's a good thing to have a 'sklearn.api'
> or not. I don't really like the flat API, as it means that there is a big
> namespace where everything is mixed, but aaybe it is a good thing, as
> currently it's hard to understand the logic (and sometimes there isn't
> one).
>
>
It doesn't have to be flat. We have

import statsmodels.api as sm

sm.datasets
sm.tsa # time series analysis
sm.nonparametric
...

But a balance between top-level and nested is necessary. E.g., what tools
and models are common enough to go at the top. Any? With tab-completion it
doesn't matter much.


> However, if we go down that way, we need to be consistent in how we
> document things. The more I teach, the more I believe in the "There
> should be one-- and preferably only one --obvious way to do it."
>
>
My heuristic is .api for interactive use and when I'm just messing around.
Import directly within the package, tests, and for "production code" (when
I don't need the kitchen sink) where import times might matter or the extra
typing of the namespace is just clutter.


> Thus I think that we need to weight the pros and cons of telling
> everybody to use sklearn.api, or nobody.
>
> G
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to