networkx / networkx-metis

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

Unify import style #11

Closed ysitu closed 9 years ago

ysitu commented 9 years ago

Follow https://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Imports#Imports for all Python/Cython source code.

OrkoHunter commented 9 years ago

Updated #10 and #3 according to this. So,

from package import module

is appreciated, but

from module import name

is not. The module should be imported and then items from the module should be used as module.item.

ysitu commented 9 years ago

I think that also includes imports from system packages (e.g., collections).

OrkoHunter commented 9 years ago

Done with the system packages too. Some packages were present in the module unused. I removed them.

OrkoHunter commented 9 years ago

10 may go in now. #3 has test issues.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/hunter/GSoC/2015/test/tests/test_metis.py", line 36, in test_selfloops
    perm, iperm = _metis.node_nd(xadj, adjncy)
  File "_metis.pyx", line 356, in _metis.node_nd (_metis.c:4923)
    with TemporaryFile() as tmp:
  File "_metis.pyx", line 357, in _metis.node_nd (_metis.c:4752)
    with redirect(stdout, tmp), nogil:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "_metis.pyx", line 18, in redirect (_metis.c:1206)
    fd = source.fileno()
AttributeError: StringIO instance has no attribute 'fileno'
OrkoHunter commented 9 years ago

Closed via #3