[gentoo-commits] proj/sci:master commit in: sci-libs/nipype/files/, sci-libs/nipype/

2023-01-29 Thread Horea Christian
commit: 34adca35bfa7ee9e22c7456989b67c732a9bb511
Author: Horea Christian  chymera  eu>
AuthorDate: Sun Jan 29 13:36:16 2023 +
Commit: Horea Christian  gmail  com>
CommitDate: Sun Jan 29 13:36:16 2023 +
URL:https://gitweb.gentoo.org/proj/sci.git/commit/?id=34adca35

sci-libs/nipype: version bump 1.8.4

Signed-off-by: Horea Christian  chymera.eu>

 .../nipype-1.8.4-dependency_compatibility.patch| 575 +
 sci-libs/nipype/nipype-1.8.4.ebuild|  92 
 2 files changed, 667 insertions(+)

diff --git a/sci-libs/nipype/files/nipype-1.8.4-dependency_compatibility.patch 
b/sci-libs/nipype/files/nipype-1.8.4-dependency_compatibility.patch
new file mode 100644
index 0..9811139e7
--- /dev/null
+++ b/sci-libs/nipype/files/nipype-1.8.4-dependency_compatibility.patch
@@ -0,0 +1,575 @@
+From a31870d0f9dc0e774f1cf9d18351586f78ecb252 Mon Sep 17 00:00:00 2001
+From: Chris Markiewicz 
+Date: Sat, 28 Jan 2023 08:11:54 -0500
+Subject: [PATCH 1/9] FIX: Set dtypes for integer test images
+
+NiBabel 4 began warning that int64 images would error, and NiBabel 5
+began erroring if not passed an explicit dtype or header.
+
+We don't need int64 images, just set some sensible dtypes.
+---
+ nipype/algorithms/tests/test_ErrorMap.py | 2 +-
+ nipype/algorithms/tests/test_TSNR.py | 3 ++-
+ nipype/algorithms/tests/test_metrics.py  | 2 +-
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/nipype/algorithms/tests/test_ErrorMap.py 
b/nipype/algorithms/tests/test_ErrorMap.py
+index 98f05d8e17..adac507bad 100644
+--- a/nipype/algorithms/tests/test_ErrorMap.py
 b/nipype/algorithms/tests/test_ErrorMap.py
+@@ -17,7 +17,7 @@ def test_errormap(tmpdir):
+ volume1 = np.array([[[2.0, 8.0], [1.0, 2.0]], [[1.0, 9.0], [0.0, 3.0]]])
+ # Alan Turing's birthday
+ volume2 = np.array([[[0.0, 7.0], [2.0, 3.0]], [[1.0, 9.0], [1.0, 2.0]]])
+-mask = np.array([[[1, 0], [0, 1]], [[1, 0], [0, 1]]])
++mask = np.array([[[1, 0], [0, 1]], [[1, 0], [0, 1]]], dtype=np.uint8)
+ 
+ img1 = nb.Nifti1Image(volume1, np.eye(4))
+ img2 = nb.Nifti1Image(volume2, np.eye(4))
+diff --git a/nipype/algorithms/tests/test_TSNR.py 
b/nipype/algorithms/tests/test_TSNR.py
+index 26c1019b63..320bec8ab2 100644
+--- a/nipype/algorithms/tests/test_TSNR.py
 b/nipype/algorithms/tests/test_TSNR.py
+@@ -131,5 +131,6 @@ def assert_unchanged(self, expected_ranges):
+ [
+ [[[2, 4, 3, 9, 1], [3, 6, 4, 7, 4]], [[8, 3, 4, 6, 2], [4, 0, 4, 
4, 2]]],
+ [[[9, 7, 5, 5, 7], [7, 8, 4, 8, 4]], [[0, 4, 7, 1, 7], [6, 8, 8, 
8, 7]]],
+-]
++],
++dtype=np.int16,
+ )
+diff --git a/nipype/algorithms/tests/test_metrics.py 
b/nipype/algorithms/tests/test_metrics.py
+index ad7502992e..3652fc2ce5 100644
+--- a/nipype/algorithms/tests/test_metrics.py
 b/nipype/algorithms/tests/test_metrics.py
+@@ -45,7 +45,7 @@ def test_fuzzy_overlap(tmpdir):
+ 
+ # Just considering the mask, the central pixel
+ # that raised the index now is left aside.
+-data = np.zeros((3, 3, 3), dtype=int)
++data = np.zeros((3, 3, 3), dtype=np.uint8)
+ data[0, 0, 0] = 1
+ data[2, 2, 2] = 1
+ nb.Nifti1Image(data, np.eye(4)).to_filename("mask.nii.gz")
+
+From 443492e82f3b197ad739cb244912ced652853a8d Mon Sep 17 00:00:00 2001
+From: Chris Markiewicz 
+Date: Sat, 28 Jan 2023 08:43:07 -0500
+Subject: [PATCH 2/9] FIX: Coerce depidx to lil_matrix
+
+---
+ nipype/pipeline/plugins/base.py | 18 +-
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/nipype/pipeline/plugins/base.py b/nipype/pipeline/plugins/base.py
+index a927b24686..3d600dda55 100644
+--- a/nipype/pipeline/plugins/base.py
 b/nipype/pipeline/plugins/base.py
+@@ -21,6 +21,18 @@
+ logger = logging.getLogger("nipype.workflow")
+ 
+ 
++def _graph_to_lil_matrix(graph, nodelist):
++"""Provide a sparse linked list matrix across various NetworkX versions"""
++import scipy.sparse as ssp
++
++try:
++from networkx import to_scipy_sparse_array
++except ImportError:  # NetworkX < 2.7
++from networkx import to_scipy_sparse_matrix as to_scipy_sparse_array
++
++return ssp.lil_matrix(to_scipy_sparse_array(graph, nodelist=nodelist, 
format="lil"))
++
++
+ class PluginBase(object):
+ """Base class for plugins."""
+ 
+@@ -431,12 +443,8 @@ def _task_finished_cb(self, jobid, cached=False):
+ 
+ def _generate_dependency_list(self, graph):
+ """Generates a dependency list for a list of graphs."""
+-import networkx as nx
+-
+ self.procs, _ = topological_sort(graph)
+-self.depidx = nx.to_scipy_sparse_matrix(
+-graph, nodelist=self.procs, format="lil"
+-)
++self.depidx = _graph_to_lil_matrix(graph, nodelist=self.procs)
+ self.refidx = self.depidx.astype(int)
+ self.proc_done = np.zeros(len(self.procs), dtype=bool)
+ self.proc_pending = 

[gentoo-commits] proj/sci:master commit in: sci-libs/nipype/files/, sci-libs/nipype/

2022-07-11 Thread Horea Christian
commit: 0c07f1c2cc4caec9042ea446d13ed857139f8caf
Author: Horea Christian  chymera  eu>
AuthorDate: Mon Jul 11 18:32:17 2022 +
Commit: Horea Christian  gmail  com>
CommitDate: Mon Jul 11 18:32:17 2022 +
URL:https://gitweb.gentoo.org/proj/sci.git/commit/?id=0c07f1c2

sci-libs/nipype: EAPI and PYTHON_COMPAT bump, test fix

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Horea Christian  chymera.eu>

 .../nipype/files/nipype-1.5.0-collections.patch| 28 ++
 sci-libs/nipype/nipype-1.5.0.ebuild| 17 +
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/sci-libs/nipype/files/nipype-1.5.0-collections.patch 
b/sci-libs/nipype/files/nipype-1.5.0-collections.patch
new file mode 100644
index 0..e784ba48b
--- /dev/null
+++ b/sci-libs/nipype/files/nipype-1.5.0-collections.patch
@@ -0,0 +1,28 @@
+--- a/nipype/interfaces/base/traits_extension.py   2020-06-03 
11:08:30.0 -0400
 b/nipype/interfaces/base/traits_extension.py   2022-07-11 
14:09:31.847784312 -0400
+@@ -19,7 +19,10 @@
+ (usually by Robert Kern).
+
+ """
+-from collections import Sequence
++try:
++from collections import Sequence
++except ImportError:
++from collections.abc import Sequence
+
+ # perform all external trait imports here
+ from traits import __version__ as traits_version
+--- a/nipype/utils/misc.py 2020-06-03 11:08:30.0 -0400
 b/nipype/utils/misc.py 2020-06-03 14:08:57.951408897 -0400
+@@ -6,7 +6,10 @@
+ import os
+ import sys
+ import re
+-from collections import Iterator
++try:
++from collections import Iterator
++except ImportError:
++from collections.abc import Iterator
+ from warnings import warn
+
+ from distutils.version import LooseVersion

diff --git a/sci-libs/nipype/nipype-1.5.0.ebuild 
b/sci-libs/nipype/nipype-1.5.0.ebuild
index 35792adbc..67e244049 100644
--- a/sci-libs/nipype/nipype-1.5.0.ebuild
+++ b/sci-libs/nipype/nipype-1.5.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{8..10} )
 PYTHON_REQ_USE="threads(+),sqlite"
 
 inherit distutils-r1
@@ -47,6 +47,7 @@ RDEPEND="
 
 PATCHES=(
"${FILESDIR}/${P}"-version_check.patch
+   "${FILESDIR}/${P}"-collections.patch
 )
 
 src_prepare() {
@@ -68,10 +69,18 @@ python_install_all() {
doenvd "${FILESDIR}/98nipype"
 }
 
+EPYTEST_DESELECT=(
+   nipype/algorithms/tests/test_CompCor.py::TestCompCor::test_compcor
+   
nipype/algorithms/tests/test_CompCor.py::TestCompCor::test_compcor_variance_threshold_and_metadata
+   nipype/algorithms/tests/test_CompCor.py::TestCompCor::test_tcompcor
+   nipype/interfaces/tests/test_io.py::test_s3datagrabber_communication
+   
nipype/utils/tests/test_cmd.py::TestNipypeCMD::test_main_returns_0_on_help
+)
+
 python_test() {
# Setting environment variable to disable etelemetry version check:
# https://github.com/nipy/nipype/issues/3196#issuecomment-605980044
-   NIPYPE_NO_ET=1 pytest -vv\
+   NIPYPE_NO_ET=1 epytest -vv\
|| die
# Upstream test configuration fails
#-c nipype/pytest.ini\



[gentoo-commits] proj/sci:master commit in: sci-libs/nipype/files/, sci-libs/nipype/

2020-09-25 Thread Horea Christian
commit: 7766d151243230173d21865e85dbf7c71853f8ad
Author: Horea Christian  chymera  eu>
AuthorDate: Fri Sep 25 09:26:39 2020 +
Commit: Horea Christian  gmail  com>
CommitDate: Fri Sep 25 09:26:39 2020 +
URL:https://gitweb.gentoo.org/proj/sci.git/commit/?id=7766d151

sci-libs/nipype: version bump 1.{4,5}* and old version removal

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Horea Christian  chymera.eu>

 sci-libs/nipype/files/98nipype |  1 +
 .../nipype/files/nipype-1.5.0-version_check.patch  | 45 ++
 sci-libs/nipype/nipype-1.1.1-r2.ebuild |  2 +-
 ...{nipype-1.1.1-r1.ebuild => nipype-1.4.2.ebuild} | 21 +-
 ...{nipype-1.1.1-r1.ebuild => nipype-1.5.0.ebuild} | 44 -
 5 files changed, 92 insertions(+), 21 deletions(-)

diff --git a/sci-libs/nipype/files/98nipype b/sci-libs/nipype/files/98nipype
new file mode 100644
index 0..c848f7c2a
--- /dev/null
+++ b/sci-libs/nipype/files/98nipype
@@ -0,0 +1 @@
+export NIPYPE_NO_ET=1

diff --git a/sci-libs/nipype/files/nipype-1.5.0-version_check.patch 
b/sci-libs/nipype/files/nipype-1.5.0-version_check.patch
new file mode 100644
index 0..8b7f11c63
--- /dev/null
+++ b/sci-libs/nipype/files/nipype-1.5.0-version_check.patch
@@ -0,0 +1,45 @@
+From b4d57d7ca4359b0990636bbc6091c49706c6ff39 Mon Sep 17 00:00:00 2001
+From: Horea Christian 
+Date: Fri, 7 Aug 2020 01:12:38 -0400
+Subject: [PATCH] ENH: no more auto-failing on misparsed versions
+
+---
+ nipype/interfaces/base/core.py | 18 ++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py
+index 82da393a84..1e626fe1b5 100644
+--- a/nipype/interfaces/base/core.py
 b/nipype/interfaces/base/core.py
+@@ -276,6 +276,15 @@ def _check_version_requirements(self, trait_object, 
raise_exception=True):
+ version = LooseVersion(str(self.version))
+ for name in names:
+ min_ver = 
LooseVersion(str(trait_object.traits()[name].min_ver))
++try:
++min_ver > version
++except TypeError:
++iflogger.warning(
++'Nipype is having issues parsing the package version '
++f'for Trait {name} ({self.__class__.__name__})'
++f'You may want to check whether {version} is larger 
than {min_ver}'
++)
++continue
+ if min_ver > version:
+ unavailable_traits.append(name)
+ if not isdefined(getattr(trait_object, name)):
+@@ -293,6 +302,15 @@ def _check_version_requirements(self, trait_object, 
raise_exception=True):
+ version = LooseVersion(str(self.version))
+ for name in names:
+ max_ver = 
LooseVersion(str(trait_object.traits()[name].max_ver))
++try:
++max_ver > version
++except TypeError:
++iflogger.warning(
++'Nipype is having issues parsing the package version '
++f'for Trait {name} ({self.__class__.__name__})'
++f'You may want to check whether {version} is smaller 
than {max_ver}'
++)
++continue
+ if max_ver < version:
+ unavailable_traits.append(name)
+ if not isdefined(getattr(trait_object, name)):

diff --git a/sci-libs/nipype/nipype-1.1.1-r2.ebuild 
b/sci-libs/nipype/nipype-1.1.1-r2.ebuild
index 39427865a..528967695 100644
--- a/sci-libs/nipype/nipype-1.1.1-r2.ebuild
+++ b/sci-libs/nipype/nipype-1.1.1-r2.ebuild
@@ -25,7 +25,7 @@ DEPEND="
sci-libs/nibabel[${PYTHON_USEDEP}]
test? (
dev-python/mock[${PYTHON_USEDEP}]
-   <=dev-python/pytest-4.6.9[${PYTHON_USEDEP}]
+   dev-python/pytest[${PYTHON_USEDEP}]
${RDEPEND}
)
 "

diff --git a/sci-libs/nipype/nipype-1.1.1-r1.ebuild 
b/sci-libs/nipype/nipype-1.4.2.ebuild
similarity index 71%
copy from sci-libs/nipype/nipype-1.1.1-r1.ebuild
copy to sci-libs/nipype/nipype-1.4.2.ebuild
index 435268f9c..dd1b5e1f0 100644
--- a/sci-libs/nipype/nipype-1.1.1-r1.ebuild
+++ b/sci-libs/nipype/nipype-1.4.2.ebuild
@@ -18,14 +18,12 @@ KEYWORDS="~amd64 ~x86"
 IUSE="test"
 
 DEPEND="
-   dev-python/future[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/prov[${PYTHON_USEDEP}]
-   dev-python/setuptools[${PYTHON_USEDEP}]
sci-libs/nibabel[${PYTHON_USEDEP}]
test? (
dev-python/mock[${PYTHON_USEDEP}]
-   <=dev-python/pytest-4.6.9[${PYTHON_USEDEP}]
+   dev-python/pytest[${PYTHON_USEDEP}]
${RDEPEND}
)
 "
@@ -34,27 +32,30 @@ DEPEND="
 
 RDEPEND="