From ab6dd73dc6ad500137d4907e01d4a93551be728e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 24 Sep 2022 11:31:38 -0400 Subject: [PATCH] python3Packages.wasserstein: init at 1.1.0 --- .../python-modules/wasserstein/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/wasserstein/default.nix diff --git a/pkgs/development/python-modules/wasserstein/default.nix b/pkgs/development/python-modules/wasserstein/default.nix new file mode 100644 index 000000000000..79994a616951 --- /dev/null +++ b/pkgs/development/python-modules/wasserstein/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, numpy +, llvmPackages +, wurlitzer +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "Wasserstein"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "pkomiske"; + repo = pname; + rev = "89c2d6279a7e0aa3b56bcc8fb7b6009420f2563e"; # https://github.com/pkomiske/Wasserstein/issues/1 + hash = "sha256-s9en6XwvO/WPsF7/+SEmGePHZQgl7zLgu5sEn4nD9YE="; + }; + + buildInputs = [ + llvmPackages.openmp + ]; + propagatedBuildInputs = [ + numpy + wurlitzer + ]; + + checkInputs = [ + pytestCheckHook + ]; + pytestFlagsArray = [ + "wasserstein/tests" + ]; + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index aa8e9c9cfc35..36826bff573f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11647,6 +11647,8 @@ in { wasabi = callPackage ../development/python-modules/wasabi { }; + wasserstein = callPackage ../development/python-modules/wasserstein { }; + wasm = callPackage ../development/python-modules/wasm { }; wasmerPackages = pkgs.recurseIntoAttrs (callPackage ../development/python-modules/wasmer { });