about summary refs log tree commit diff
path: root/pkgs/development/python-modules/mdp/default.nix
blob: 40f57408703f949f6cd4137c146a46ed61b2fce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, buildPythonPackage
, fetchPypi
, future
, joblib
, numpy
, pytest
, pythonOlder
, scikit-learn
}:

buildPythonPackage rec {
  pname = "mdp";
  version = "3.6";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "MDP";
    inherit version;
    hash = "sha256-rFKmUsy67RhX/xIJhi8Dv5sG0JOxJgb7QQeH2jqmWg4=";
  };

  postPatch = ''
    # https://github.com/mdp-toolkit/mdp-toolkit/issues/92
    substituteInPlace mdp/utils/routines.py \
      --replace numx.typeDict numx.sctypeDict
    substituteInPlace mdp/test/test_NormalizingRecursiveExpansionNode.py \
      --replace py.test"" "pytest"
    substituteInPlace mdp/test/test_RecursiveExpansionNode.py \
      --replace py.test"" "pytest"
  '';

  propagatedBuildInputs = [
    future
    numpy
  ];

  nativeCheckInputs = [
    joblib
    pytest
    scikit-learn
  ];

  pythonImportsCheck = [
    "mdp"
    "bimdp"
  ];

  checkPhase = ''
    runHook preCheck

    pytest --seed 7710873 mdp
    pytest --seed 7710873 bimdp

    runHook postCheck
  '';

  meta = with lib; {
    description = "Library for building complex data processing software by combining widely used machine learning algorithms";
    homepage = "https://mdp-toolkit.github.io/";
    changelog = "https://github.com/mdp-toolkit/mdp-toolkit/blob/MDP-${version}/CHANGES";
    license = licenses.bsd3;
    maintainers = with maintainers; [ nico202 ];
  };
}