1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, cython
6, nose
7, matplotlib
8, nibabel
9, numpy
10, scipy
11, sympy
12, python
13}:
14
15buildPythonPackage rec {
16 version = "0.5.0";
17 pname = "nipy";
18 disabled = pythonOlder "2.6";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "a8a2c97ce854fece4aced5a6394b9fdca5846150ad6d2a36b86590924af3c848";
23 };
24
25 nativeBuildInputs = [ cython ];
26 buildInputs = lib.optionals doCheck [ nose ];
27 propagatedBuildInputs = [ matplotlib nibabel numpy scipy sympy ];
28
29 preBuild = ''
30 make recythonize
31 '';
32
33 checkPhase = '' # wants to be run in a different directory
34 mkdir nosetests
35 cd nosetests
36 ${python.interpreter} -c "import nipy; nipy.test()"
37 rm -rf .
38 '';
39
40 # failing test:
41 # nipy.algorithms.statistics.models.tests.test_olsR.test_results(11.593139639404727, 11.593140144880794, 6) # disagrees by 1 at 6th decimal place
42 # erroring tests:
43 # nipy.modalities.fmri.fmristat.tests.test_FIAC.test_altprotocol
44 # nipy.modalities.fmri.fmristat.tests.test_FIAC.test_agreement
45 # nipy.tests.test_scripts.test_nipy_4d_realign # because `nipy_4d_realign` script isn't found at test time; works from nix-shell, so could be patched
46 # nipy.tests.test_scripts.test_nipy_3_4d # ditto re.: `nipy_3_4d` script
47 doCheck = false;
48
49 meta = with lib; {
50 homepage = "https://nipy.org/nipy";
51 description = "Software for structural and functional neuroimaging analysis";
52 license = licenses.bsd3;
53 };
54
55}