Closed PaulWAyers closed 7 years ago
I believe this is the same problem as discussed in #141, which has a potential solution that would not require is to change names of modules. I needs to be tested but I'm happy to give it a try. Matt and I were a little reluctant because it seemed a little ugly. If it makes life easier for users, I'm fine with it.
Is it possible to discourage the use of from horton import *
? PEP328 discourages the use of wildcard imports (it is "not an option"). I think that the solution in #141 may not even be necessary if we make use of explicit imports and avoid wildcard imports.
Even if we would remove wildcard imports and use from X import y1, y2, y3, ...
in the __init__.py
files instead, the problem would not be solved and similar name clashes are still going to happen. I think the solution in #141 is the only way to get rid of it completely.
I'm going to close this one. The discussion can still continue in #141.
Looking at PEP8, there is no solution for this. There is an inherent 'potential conflict' as both module names and variable names are all_lower_case. I'm not sure if we should set up a HORTON-specific convention for module names. (E.g., in Fortran it was popular to use names like grid_module or gridmod or, not that Fortran naming conventions should be aspired too.)