networkx / networkx-metis

NetworkX Addon to allow graph partitioning with METIS
Other
79 stars 21 forks source link

Change import routine #25

Closed OrkoHunter closed 9 years ago

OrkoHunter commented 9 years ago

Let's change the way of using the functions from

>>> from networkx.addons.metis import metis
>>> metis.partition
<function networkx.addons.metis.metis.partition>

to

>>> from networkx.addons import metis
>>> metis.partition
<function networkx.addons.metis.metis.partition>

The later one makes more sense.

OrkoHunter commented 9 years ago

This will be similar for lemon.

>>> from networkx.addons import lemon
>>> lemon.some_shortest_path_func()
ysitu commented 9 years ago

Does it make sense to simply rename metis.py to __init__.py?

OrkoHunter commented 9 years ago

Having a metis.py to use all the wrapper functions from _metis.pyx makes more sense to me. However, we can do the renaming trick but there would be less of a wrapper module.

ysitu commented 9 years ago

I am not sure if I understand what you mean by "there would be less of a wrapper module". I just find the extra level of indirection unnecessary if __init__.py does only from .metis import *.

OrkoHunter commented 9 years ago

Ah well, let's change it.

OrkoHunter commented 9 years ago

Removed metis.py