about summary refs log tree commit diff
path: root/tests/test_pyhegp.py
diff options
context:
space:
mode:
authorArun Isaac2025-08-04 12:31:24 +0100
committerArun Isaac2025-08-06 22:35:26 +0100
commit2dc2efa7f77deb5ebcf7b80abefc162474614b2c (patch)
tree2fdb75e3de75dcdf461f8fde133fc3b338313f80 /tests/test_pyhegp.py
parent5c086aa352012cf95b33cab8e506424016b28a26 (diff)
downloadpyhegp-2dc2efa7f77deb5ebcf7b80abefc162474614b2c.tar.gz
pyhegp-2dc2efa7f77deb5ebcf7b80abefc162474614b2c.tar.lz
pyhegp-2dc2efa7f77deb5ebcf7b80abefc162474614b2c.zip
Move negate to pyhegp.utils.
* tests/test_pyhegp.py (negate): Move to pyhegp.utils.
Import negate from pyhegp.utils.
* pyhegp/utils.py: New file.
Diffstat (limited to 'tests/test_pyhegp.py')
-rw-r--r--tests/test_pyhegp.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/test_pyhegp.py b/tests/test_pyhegp.py
index c355df5..1fceb99 100644
--- a/tests/test_pyhegp.py
+++ b/tests/test_pyhegp.py
@@ -24,6 +24,7 @@ import numpy as np
 from pytest import approx
 
 from pyhegp.pyhegp import Stats, hegp_encrypt, hegp_decrypt, random_key, pool_stats, standardize, unstandardize
+from pyhegp.utils import negate
 
 @given(st.lists(st.lists(arrays("float64",
                                 st.shared(array_shapes(min_dims=1, max_dims=1),
@@ -81,9 +82,6 @@ def square_matrices(order, elements=None):
         return draw(arrays("float64", (n, n), elements=elements))
     return st.composite(generate)
 
-def negate(predicate):
-    return lambda *args, **kwargs: not predicate(*args, **kwargs)
-
 def is_singular(matrix):
     # We want to avoid nearly singular matrices as well. Hence, we set
     # a looser absolute tolerance.