2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-05-03 20:48:10 +00:00
|
|
|
, deprecated
|
|
|
|
, hopcroftkarp
|
|
|
|
, joblib
|
2020-04-24 23:36:52 +00:00
|
|
|
, matplotlib
|
2021-05-03 20:48:10 +00:00
|
|
|
, numpy
|
2021-05-20 23:08:51 +00:00
|
|
|
, scikit-learn
|
2020-04-24 23:36:52 +00:00
|
|
|
, scipy
|
2021-05-03 20:48:10 +00:00
|
|
|
, pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "persim";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "0.3.1";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-7w8KJHrc9hBOysFBF9sLJFgXEOqKjZZIFoBTlXALSXU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
deprecated
|
|
|
|
hopcroftkarp
|
|
|
|
joblib
|
2020-04-24 23:36:52 +00:00
|
|
|
matplotlib
|
2021-05-03 20:48:10 +00:00
|
|
|
numpy
|
2021-05-20 23:08:51 +00:00
|
|
|
scikit-learn
|
2020-04-24 23:36:52 +00:00
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
preCheck = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# specifically needed for darwin
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
mkdir -p $HOME/.matplotlib
|
|
|
|
echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00: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"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Distances and representations of persistence diagrams";
|
|
|
|
homepage = "https://persim.scikit-tda.org";
|
|
|
|
license = licenses.mit;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|