1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, cython
6, numpy
7, scipy
8, scikit-learn
9, persim
10, pytest
11}:
12
13buildPythonPackage rec {
14 pname = "ripser";
15 version = "0.6.1";
16 disabled = pythonOlder "3.6";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "335112a0f94532ccbe686db7826ee8d0714b32f65891abf92c0a02f3cb0fc5fd";
21 };
22
23 checkInputs = [
24 pytest
25 ];
26
27 propagatedBuildInputs = [
28 cython
29 numpy
30 scipy
31 scikit-learn
32 persim
33 ];
34
35 checkPhase = ''
36 # specifically needed for darwin
37 export HOME=$(mktemp -d)
38 mkdir -p $HOME/.matplotlib
39 echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
40
41 pytest
42 '';
43
44 meta = with lib; {
45 description = "A Lean Persistent Homology Library for Python";
46 homepage = "https://ripser.scikit-tda.org";
47 license = licenses.mit;
48 maintainers = [ maintainers.costrouc ];
49 };
50}