lantunes / cellpylib

A library for working with Cellular Automata, for Python.
https://cellpylib.org
Apache License 2.0
228 stars 32 forks source link

[JOSS] Namespace is polluted with symbols that shouldn't be there #9

Closed szhorvat closed 3 years ago

szhorvat commented 3 years ago

Python is not my main language, so it is entirely possible that the "problem" I will mention here is not really considered a problem in the Python community. However, I do not see this issue in polished Python packages.

It is generally convenient to explore a package through the autocompletion feature of Jupyter or your IDE. Thus I like to type cpl., hit tab, and see what is in that namespace. I see a lot of things that do not belong there, such as np (from import numpy as np or Axes3D (which comes from matplotlib).

IMO a polished package should control explicitly which symbols are exported and made public.

It is now not clear if the functions I mentioned in #8 are even intended to be public (probably not).

blsqr commented 3 years ago

Strongly support this 👍

The change should be simple, any one of the following is possible:

szhorvat commented 3 years ago

Thanks for the feedback @blsqr ! I am not a Python guy, so I wasn't 100% sure about this.

lantunes commented 3 years ago

@szhorvat @blsqr Thank you for pointing this out. I have updated the __init__.py file such that the individual names are imported explicitly rather than using import *. This change is on the joss_review branch.

lantunes commented 3 years ago

For reference, the relevant commit is 9d964c580e54a2a010fddec90986eac06be6a72a.