summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-05-25 20:38:34 +0200
committerRobert Schütz <github@dotlambda.de>2022-05-25 13:58:22 -0700
commit1e2fcc635f5c7814d59e1d36c6053288a1015e76 (patch)
treebf049ad47282ca694f59822637d32439dc6eaf9f
parent882fc91780e0b2744f2eff19cc644693f9adab11 (diff)
python310Packages.pot: 0.8.1.0 -> 0.8.2
-rw-r--r--pkgs/development/python-modules/pot/default.nix110
1 files changed, 89 insertions, 21 deletions
diff --git a/pkgs/development/python-modules/pot/default.nix b/pkgs/development/python-modules/pot/default.nix
index 8bc7ecb7f355..f017ff5fb54f 100644
--- a/pkgs/development/python-modules/pot/default.nix
+++ b/pkgs/development/python-modules/pot/default.nix
@@ -1,55 +1,123 @@
{ lib
-, fetchPypi
+, autograd
, buildPythonPackage
-, numpy
-, scipy
+, cupy
+, cvxopt
, cython
+, fetchPypi
, matplotlib
-, scikit-learn
-, cupy
+, numpy
+, tensorflow
, pymanopt
-, autograd
, pytestCheckHook
+, pythonOlder
+, scikit-learn
+, scipy
, enableDimensionalityReduction ? false
, enableGPU ? false
}:
buildPythonPackage rec {
pname = "pot";
- version = "0.8.1.0";
+ version = "0.8.2";
+ format = "setuptools";
+
+ disabled = pythonOlder "3.6";
src = fetchPypi {
pname = "POT";
inherit version;
- sha256 = "ff2974418fbf35b18072555c2a9e7e4f6876eddfb6791179ddb8f0f6d6032505";
+ sha256 = "sha256-PKmuPI83DPy7RkOgHHPdPJJz5NT/fpr123AVTzTLwgQ=";
};
+ nativeBuildInputs = [
+ numpy
+ cython
+ ];
+
+ propagatedBuildInputs = [
+ numpy
+ scipy
+ ] ++ lib.optionals enableGPU [
+ cupy
+ ] ++ lib.optionals enableDimensionalityReduction [
+ autograd
+ pymanopt
+ ];
+
+ checkInputs = [
+ cvxopt
+ matplotlib
+ numpy
+ tensorflow
+ scikit-learn
+ pytestCheckHook
+ ];
+
postPatch = ''
substituteInPlace setup.cfg \
- --replace "--cov-report= --cov=ot" ""
+ --replace " --cov-report= --cov=ot" "" \
+ --replace " --durations=20" "" \
+ --replace " --junit-xml=junit-results.xml" ""
+ substituteInPlace setup.py \
+ --replace '"oldest-supported-numpy", ' ""
'';
- nativeBuildInputs = [ numpy cython ];
- propagatedBuildInputs = [ numpy scipy ]
- ++ lib.optionals enableGPU [ cupy ]
- ++ lib.optionals enableDimensionalityReduction [ pymanopt autograd ];
- checkInputs = [ matplotlib scikit-learn pytestCheckHook ];
-
# To prevent importing of an incomplete package from the build directory
# instead of nix store (`ot` is the top-level package name).
preCheck = ''
rm -r ot
'';
- # GPU tests are always skipped because of sandboxing
- disabledTests = [ "warnings" ];
+ disabledTests = [
+ # GPU tests are always skipped because of sandboxing
+ "warnings"
+ # Fixture is not available
+ "test_conditional_gradient"
+ "test_convert_between_backends"
+ "test_emd_backends"
+ "test_emd_emd2_types_devices"
+ "test_emd1d_type_devices"
+ "test_emd2_backends"
+ "test_factored_ot_backends"
+ "test_free_support_barycenter_backends"
+ "test_func_backends"
+ "test_generalized_conditional_gradient"
+ "test_line_search_armijo"
+ "test_loss_dual"
+ "test_max_sliced_backend"
+ "test_plan_dual"
+ "test_random_backends"
+ "test_sliced_backend"
+ "test_to_numpy"
+ "test_wasserstein_1d_type_devices"
+ "test_wasserstein"
+ "test_weak_ot_bakends"
+ # TypeError: Only integers, slices...
+ "test_emd1d_device_tf"
+ ];
+
+ disabledTestPaths = [
+ # AttributeError: module pytest has no attribute skip_backend
+ "test/test_bregman.py"
+ "test/test_da.py"
+ "test/test_utils.py"
+ "test/test_gromov.py"
+ "test/test_helpers.py"
+ "test/test_unbalanced.py"
+ ] ++ lib.optionals (!enableDimensionalityReduction) [
+ "test/test_dr.py"
+ ];
- pythonImportsCheck = [ "ot" "ot.lp" ];
+ pythonImportsCheck = [
+ "ot"
+ "ot.lp"
+ ];
- meta = {
+ meta = with lib; {
description = "Python Optimal Transport Library";
homepage = "https://pythonot.github.io/";
- license = lib.licenses.mit;
- maintainers = with lib.maintainers; [ yl3dy ];
+ license = licenses.mit;
+ maintainers = with maintainers; [ yl3dy ];
};
}