From f4f91dc52b99ac0302163f6118e78b6cede5d25c Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Thu, 17 Sep 2020 12:05:58 -0400 Subject: [PATCH] FIX: No longer depending on pydotplus (networkx >=2.0 update) Fixes: https://github.com/nipy/nipype/issues/3244 --- nipype/info.py | 3 +-- nipype/interfaces/cmtk/nx.py | 10 ++-------- requirements.txt | 3 +-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/nipype/info.py b/nipype/info.py index 73ad1b88d5..396b24cea7 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -99,7 +99,7 @@ def get_nipype_gitversion(): # versions NIBABEL_MIN_VERSION = "2.1.0" -NETWORKX_MIN_VERSION = "1.9" +NETWORKX_MIN_VERSION = "2.0" NUMPY_MIN_VERSION = "1.13" # Numpy bug in python 3.7: # https://www.opensourceanswers.com/blog/you-shouldnt-use-python-37-for-data-science-right-now.html @@ -143,7 +143,6 @@ def get_nipype_gitversion(): "packaging", "prov>=%s" % PROV_VERSION, "pydot>=%s" % PYDOT_MIN_VERSION, - "pydotplus", "python-dateutil>=%s" % DATEUTIL_MIN_VERSION, "rdflib>=%s" % RDFLIB_MIN_VERSION, "scipy>=%s" % SCIPY_MIN_VERSION, diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 3886fe8844..aaf4bece39 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -289,15 +289,9 @@ def compute_singlevalued_measures(ntwk, weighted=True, calculate_cliques=False): iflogger.info("Computing single valued measures:") measures = {} iflogger.info("...Computing degree assortativity (pearson number) ...") - try: - measures["degree_pearsonr"] = nx.degree_pearsonr(ntwk) - except AttributeError: # For NetworkX 1.6 - measures["degree_pearsonr"] = nx.degree_pearson_correlation_coefficient(ntwk) + measures["degree_pearsonr"] = nx.degree_pearson_correlation_coefficient(ntwk) iflogger.info("...Computing degree assortativity...") - try: - measures["degree_assortativity"] = nx.degree_assortativity(ntwk) - except AttributeError: - measures["degree_assortativity"] = nx.degree_assortativity_coefficient(ntwk) + measures["degree_assortativity"] = nx.degree_assortativity_coefficient(ntwk) iflogger.info("...Computing transitivity...") measures["transitivity"] = nx.transitivity(ntwk) iflogger.info("...Computing number of connected_components...") diff --git a/requirements.txt b/requirements.txt index 6cb09abdee..afec34ebfd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,12 @@ # Auto-generated by tools/update_requirements.py click>=6.6.0 -networkx>=1.9 +networkx>=2.0 nibabel>=2.1.0 numpy>=1.13 ; python_version < "3.7" numpy>=1.15.3 ; python_version >= "3.7" packaging prov>=1.5.2 pydot>=1.2.3 -pydotplus python-dateutil>=2.2 rdflib>=5.0.0 scipy>=0.14