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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.3.2";
|
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;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-p6Vumfr+vRDr0D9PnEZItp9vNlCLIb59HpBg1KdyHGE=";
|
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
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
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"
|
2023-03-04 12:14:45 +00:00
|
|
|
# https://github.com/scikit-tda/persim/issues/67
|
|
|
|
"test_persistenceimager"
|
2023-05-24 13:37:59 +00:00
|
|
|
# ValueError: setting an array element with a sequence
|
|
|
|
"test_exact_critical_pairs"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Distances and representations of persistence diagrams";
|
|
|
|
homepage = "https://persim.scikit-tda.org";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/scikit-tda/persim/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2023-03-04 12:14:45 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|