8 , oldest-supported-numpy
17 , enableDimensionalityReduction ? false
21 buildPythonPackage rec {
26 disabled = pythonOlder "3.6";
28 src = fetchFromGitHub {
31 rev = "refs/tags/${version}";
32 hash = "sha256-fdqDM0V6zTFe1lcqi53ZZNHAfmuR2I7fdX4SN9qeNn8=";
37 oldest-supported-numpy
40 propagatedBuildInputs = [
43 ] ++ lib.optionals enableGPU [
45 ] ++ lib.optionals enableDimensionalityReduction [
60 substituteInPlace setup.cfg \
61 --replace " --cov-report= --cov=ot" "" \
62 --replace " --durations=20" "" \
63 --replace " --junit-xml=junit-results.xml" ""
65 # we don't need setup.py to find the macos sdk for us
66 sed -i '/sdk_path/d' setup.py
69 # need to run the tests with the built package next to the test directory
72 ln -s -t . "$OLDPWD/test"
80 # GPU tests are always skipped because of sandboxing
82 # Fixture is not available
83 "test_conditional_gradient"
84 "test_convert_between_backends"
86 "test_emd_emd2_types_devices"
87 "test_emd1d_type_devices"
89 "test_factored_ot_backends"
90 "test_free_support_barycenter_backends"
92 "test_generalized_conditional_gradient"
93 "test_line_search_armijo"
95 "test_max_sliced_backend"
97 "test_random_backends"
100 "test_wasserstein_1d_type_devices"
102 "test_weak_ot_bakends"
103 # TypeError: Only integers, slices...
104 "test_emd1d_device_tf"
107 disabledTestPaths = lib.optionals (!enableDimensionalityReduction) [
111 pythonImportsCheck = [
117 description = "Python Optimal Transport Library";
118 homepage = "https://pythonot.github.io/";
119 license = licenses.mit;
120 maintainers = with maintainers; [ yl3dy ];