2022-05-29 10:10:09 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2019-07-13 01:35:53 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-04-27 04:06:02 +01:00
|
|
|
, deprecated
|
|
|
|
, hopcroftkarp
|
|
|
|
, joblib
|
2019-07-13 01:35:53 +01:00
|
|
|
, matplotlib
|
2021-04-27 04:06:02 +01:00
|
|
|
, numpy
|
2021-05-14 19:46:36 +01:00
|
|
|
, scikit-learn
|
2019-07-13 01:35:53 +01:00
|
|
|
, scipy
|
2021-04-27 04:06:02 +01:00
|
|
|
, pytestCheckHook
|
2022-05-24 11:32:14 +01:00
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2019-07-13 01:35:53 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "persim";
|
2021-06-18 22:47:29 +01:00
|
|
|
version = "0.3.1";
|
2022-05-24 11:32:14 +01:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2019-07-13 01:35:53 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-05-24 11:32:14 +01:00
|
|
|
sha256 = "sha256-7w8KJHrc9hBOysFBF9sLJFgXEOqKjZZIFoBTlXALSXU=";
|
2019-07-13 01:35:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-04-27 04:06:02 +01:00
|
|
|
deprecated
|
|
|
|
hopcroftkarp
|
|
|
|
joblib
|
2019-07-13 01:35:53 +01:00
|
|
|
matplotlib
|
2021-04-27 04:06:02 +01:00
|
|
|
numpy
|
2021-05-14 19:46:36 +01:00
|
|
|
scikit-learn
|
2019-07-13 01:35:53 +01:00
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2021-04-27 04:06:02 +01:00
|
|
|
pytestCheckHook
|
2019-07-13 01:35:53 +01:00
|
|
|
];
|
|
|
|
|
2021-04-27 04:06:02 +01:00
|
|
|
preCheck = ''
|
2019-07-13 01:35:53 +01:00
|
|
|
# specifically needed for darwin
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
mkdir -p $HOME/.matplotlib
|
|
|
|
echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
|
|
|
|
'';
|
|
|
|
|
2022-05-24 11:32:14 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"persim"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# AttributeError: module 'collections' has no attribute 'Iterable'
|
|
|
|
"test_empyt_diagram_list"
|
|
|
|
"test_empty_diagram_list"
|
|
|
|
"test_fit_diagram"
|
|
|
|
"test_integer_diagrams"
|
|
|
|
"test_lists_of_lists"
|
|
|
|
"test_mixed_pairs"
|
|
|
|
"test_multiple_diagrams"
|
|
|
|
"test_n_pixels"
|
|
|
|
];
|
|
|
|
|
2019-07-13 01:35:53 +01:00
|
|
|
meta = with lib; {
|
2022-05-29 10:10:09 +01:00
|
|
|
broken = stdenv.isDarwin;
|
2019-07-13 01:35:53 +01:00
|
|
|
description = "Distances and representations of persistence diagrams";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://persim.scikit-tda.org";
|
2019-07-13 01:35:53 +01:00
|
|
|
license = licenses.mit;
|
2022-05-24 11:32:14 +01:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2019-07-13 01:35:53 +01:00
|
|
|
};
|
|
|
|
}
|