theochem / horton

HORTON: Helpful Open-source Research TOol for N-fermion systems
http://theochem.github.io/horton/
GNU General Public License v3.0
92 stars 40 forks source link

grid module name is also used in examples as a variable name #211

Closed PaulWAyers closed 7 years ago

PaulWAyers commented 7 years ago

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.)

tovrstra commented 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.

kimt33 commented 7 years ago

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.

tovrstra commented 7 years ago

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.

tovrstra commented 7 years ago

I'm going to close this one. The discussion can still continue in #141.