NeuralAnalysis / PyalData

Repository for the Python implementation of the TrialData analysis library.
GNU General Public License v3.0
7 stars 9 forks source link

Expose every function at the top level of the module? #52

Closed bagibence closed 3 years ago

bagibence commented 3 years ago

I think it's generally good practice not to do from module import * and use module.foo instead, but it's inconvenient to type out pyaldata.tools.foo when we want to use a function. It's also annoying to have to remember if some functionality is in tools or utils. Plus tools.py and utils.py are starting to be a bit too long and unorganized, so we'll have split them anyway, which will make this even worse.

What I'm thinking is that we could just export every function at the top level of the module, so that we can use pyaldata.foo without knowing if function foo is in utils.py or tools.py (or in something like utils.transformations.foo in the future).

Then we could agree on a convention for a shorthand so that we can do import pyaldata as pdt (or pld or whatever shorthand that's not pd because that's taken for pandas). Alternatively, one might use just do from pyaldata import *. becaues I think our function names are specific enough that they don't clash with anything else and we know that they come from pyaldata