Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update function name due to networkx version update #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fa2/forceatlas2.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def forceatlas2_networkx_layout(self, G, pos=None, iterations=100, weight_attr=N
or (cynetworkx and isinstance(G, cynetworkx.classes.graph.Graph))
), "Not a networkx graph"
assert isinstance(pos, dict) or (pos is None), "pos must be specified as a dictionary, as in networkx"
M = networkx.to_scipy_sparse_matrix(G, dtype='f', format='lil', weight=weight_attr)
M = networkx.to_scipy_sparse_array(G, dtype='f', format='lil', weight=weight_attr)
if pos is None:
l = self.forceatlas2(M, pos=None, iterations=iterations)
else:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
print(">>>> Cython is installed?")
try:
from Cython.Distutils import Extension
from Cython.Build import build_ext
from Cython.Build import build_ext, cythonize
USE_CYTHON = True
print('Yes\n')
except ImportError:
Expand All @@ -25,7 +25,7 @@
print(">>>> Are pre-generated C files available?")

if USE_CYTHON:
ext_modules = [Extension('fa2.fa2util', ['fa2/fa2util.py', 'fa2/fa2util.pxd'], cython_directives={'language_level' : 3})]
ext_modules = cythonize([Extension('fa2.fa2util', ['fa2/fa2util.py'], cython_directives={'language_level' : 3})])
cmdclass = {'build_ext': build_ext}
opts = {"ext_modules": ext_modules, "cmdclass": cmdclass}
elif path.isfile(path.join(here, 'fa2/fa2util.c')):
Expand Down Expand Up @@ -72,4 +72,4 @@
},
include_package_data=True,
**opts
)
)