about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt2024-11-14 05:04:59 +0100
committergithub-actions[bot]2024-11-14 19:12:48 +0000
commitc3892dbf3af3436078d5f98a2f69a17b8496462e (patch)
treeacd4cf23cf19ea3057d8b71602fc346ab9e556c8
parent8b27c1239e5c421a2bbc2c65d52e4a6fbf2ff296 (diff)
python312Packages.pymoo: drop patch, fix tests, unbreak
(cherry picked from commit 64b1772df83a03f88e6f4471e8bd901058899b04)
-rw-r--r--pkgs/development/python-modules/pymoo/default.nix21
1 files changed, 12 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/pymoo/default.nix b/pkgs/development/python-modules/pymoo/default.nix
index 86eb3e81b294..4456319b4349 100644
--- a/pkgs/development/python-modules/pymoo/default.nix
+++ b/pkgs/development/python-modules/pymoo/default.nix
@@ -2,7 +2,6 @@
   lib,
   buildPythonPackage,
   fetchFromGitHub,
-  fetchpatch,
   setuptools,
   pytestCheckHook,
   writeText,
@@ -38,14 +37,6 @@ buildPythonPackage rec {
     hash = "sha256-iGWPepZw3kJzw5HKV09CvemVvkvFQ38GVP+BAryBSs0=";
   };
 
-  patches = [
-    # https://github.com/anyoptimization/pymoo/pull/407
-    (fetchpatch {
-      url = "https://github.com/anyoptimization/pymoo/commit/be57ece64275469daece1e8ef12b2b6ee05362c9.diff";
-      hash = "sha256-BLPrUqNbAsAecfYahESEJF6LD+kehUYmkTvl/nvyqII=";
-    })
-  ];
-
   pythonRelaxDeps = [ "cma" ];
   pythonRemoveDeps = [ "alive-progress" ];
 
@@ -74,6 +65,10 @@ buildPythonPackage rec {
     substituteInPlace pymoo/config.py \
       --replace-fail "https://raw.githubusercontent.com/anyoptimization/pymoo-data/main/" \
                 "file://$pymoo_data/"
+
+    # Some tests require a grad backend to be configured, this is a hacky way to do so.
+    # The choice must be either "jax.numpy" or "autograd.numpy"
+    echo 'from pymoo.gradient import activate; activate("autograd.numpy")' >> tests/conftest.py
   '';
   nativeCheckInputs = [
     pytestCheckHook
@@ -87,6 +82,14 @@ buildPythonPackage rec {
     # ModuleNotFoundError: No module named 'pymoo.cython.non_dominated_sorting'
     "test_fast_non_dominated_sorting"
     "test_efficient_non_dominated_sort"
+    "test_dominance_degree_non_dominated_sort"
+
+    # sensitive to float precision
+    "test_cd_and_pcd"
+  ];
+  disabledTestPaths = [
+    # sensitive to float precision
+    "tests/algorithms/test_no_modfication.py"
   ];
   # Avoid crashing sandboxed build on macOS
   MATPLOTLIBRC = writeText "" ''