Hi everyone,
Since SciPy 1.9, we now have a lazy import mechanism which allows us to do `import scipy` and then work on any submodules without waiting time due to the import itself.
NumPy and Pandas, just to name these, have set a precedence for an idiomatic way of importing their library. This is arguably an advantage for introspection, debugging, teaching, consistency or even communication purposes. Hence, I would like to propose that we also adopt an idiomatic import style for SciPy.
There's basically 3 ways of doing this, if we'd start from scratch:
1. import scipy.submodule # use as scipy.submodule.func()
2. import scipy as sp # use as sp.submodule.func()
3. from scipy import submodule # use as submodule.func()
It's not clear which would be preferred if we'd have the luxury of starting from scratch. Whole blog posts have been written about abbreviations like `np` and `pd` being an anti-pattern for example, and the justification of doing that in scipy is far weaker before our main namespace is essentially empty, while for numpy you use it all the time so the 3 characters saved matter a lot more.
Given the large amount of churn a change would cause and the quite limited (if any) benefits here, I'd prefer to not change anything here.
Cheers,
Ralf
If we would want to move forward with that idea, I would propose to make a brainstorming session with interested people to discuss the topic. This could for instance be a topic for next week’s community call.
Cheers,
Pamphile
_______________________________________________
SciPy-Dev mailing list -- scipy-dev@python.org
To unsubscribe send an email to scipy-dev-leave@python.org
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: ralf.gommers@gmail.com