2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
numpy,
|
|
|
|
llvmPackages,
|
|
|
|
wurlitzer,
|
|
|
|
pytestCheckHook,
|
2022-09-30 11:47:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-01-20 10:41:00 +00:00
|
|
|
pname = "wasserstein";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "1.1.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pkomiske";
|
2023-01-20 10:41:00 +00:00
|
|
|
repo = "Wasserstein";
|
2024-06-05 15:53:02 +00:00
|
|
|
rev = "v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-s9en6XwvO/WPsF7/+SEmGePHZQgl7zLgu5sEn4nD9YE=";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/thaler-lab/Wasserstein/commit/8667d59dfdf89eabf01f3ae93b23a30a27c21c58.patch";
|
|
|
|
hash = "sha256-jp5updB3E1MYgLhBJwmBMTwBiFXtABMwTxt0G6xhoyA=";
|
|
|
|
})
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
buildInputs = [ llvmPackages.openmp ];
|
2022-09-30 11:47:45 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
wurlitzer
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
pytestFlagsArray = [ "wasserstein/tests" ];
|
2022-09-30 11:47:45 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"wasserstein/tests/test_emd.py" # requires "ot"
|
|
|
|
# cyclic dependency on energyflow
|
|
|
|
"wasserstein/tests/test_externalemdhandler.py"
|
|
|
|
"wasserstein/tests/test_pairwiseemd.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "wasserstein" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python/C++ library for computing Wasserstein distances efficiently";
|
|
|
|
homepage = "https://github.com/pkomiske/Wasserstein";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|