Skip to content
Snippets Groups Projects
Commit a8267aef authored by Christoph Groth's avatar Christoph Groth
Browse files

switch to relative cimports

This still does not allow to import kwant under other names:
http://thread.gmane.org/gmane.comp.python.cython.user/13809

Once we depend on Python 3.5, and "proper" relative cimports are supported by
Cython, we could add a test for exclusive use of relative imports.
parent 2a311ea3
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,8 @@ import numpy as np
from scipy import sparse as sp
from itertools import chain
from kwant.graph.core cimport CGraph, gintArraySlice
from kwant.graph.defs cimport gint
from .graph.core cimport CGraph, gintArraySlice
from .graph.defs cimport gint
from .graph.defs import gint_dtype
msg = ('Hopping from site {0} to site {1} does not match the '
......
......@@ -7,7 +7,7 @@
# http://kwant-project.org/authors.
cimport numpy as np
from kwant.graph.defs cimport gint
from .defs cimport gint
cdef struct Edge:
gint tail, head
......
......@@ -30,7 +30,7 @@ from libc.stdlib cimport malloc, realloc, free
from libc.string cimport memset
import numpy as np
cimport numpy as np
from kwant.graph.defs cimport gint
from .defs cimport gint
cdef class Graph:
"""An uncompressed graph. Used to make compressed graphs. (See `CGraph`.)
......
......@@ -13,9 +13,9 @@ __all__ = ['bisect', 'reset']
cimport libc.stdio
import numpy as np
cimport numpy as np
from kwant.graph cimport core
from . cimport core
from . import core, defs
from kwant.graph.c_scotch cimport *
from .c_scotch cimport *
DEF SCOTCH_STRATQUALITY = 1
DEF SCOTCH_STRATSPEED = 2
......
......@@ -10,10 +10,10 @@ import numpy as np
cimport numpy as np
cimport cython
from libc.string cimport memcpy
from kwant.graph.defs cimport gint
from .defs cimport gint
from .defs import gint_dtype
from kwant.graph.core cimport CGraph
cimport kwant.graph.c_slicer as c_slicer
from .core cimport CGraph
from . cimport c_slicer
__all__ = ['slice']
......
......@@ -16,9 +16,9 @@ cimport numpy as np
from libc.stdlib cimport malloc, realloc, free
from libc.string cimport memset
cimport cython
from kwant.graph.defs cimport gint
from .defs cimport gint
from .defs import gint_dtype
from kwant.graph.core cimport CGraph, CGraph_malloc
from .core cimport CGraph, CGraph_malloc
from .core import CGraph, CGraph_malloc
@cython.boundscheck(False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment