[SciPy-Dev] Including Lomb-Scargle code in scipy.signal (sub)module

Gael Varoquaux gael.varoquaux at normalesup.org
Wed Feb 9 18:07:21 EST 2011


On Wed, Feb 09, 2011 at 04:37:57PM -0600, Warren Weckesser wrote:
>    As in many scipy subpackages, users will access this function as
>    scipy.signal.lombscargle  (because __init__.py in scipy.signal
>    imports the function from the submodule and makes it available
>    in  __all__).  I don't know if there is an official policy, but
>    this seems to be the preferred packaging style in many scipy
>    packages.  So the name of the submodule doesn't really matter
>    that much.  I would just call the submodule lombscargle also.

I don't think that you should be using the same name for the module and
the function as, as a result, the function imported in the __init__, will
shadow the module and make it impossible to import (eg for testing).

My 2 cents,

Gaël



More information about the SciPy-Dev mailing list