Skip to content

Commit dee9447

Browse files
authored
Test cs function with negative values (#14)
* Test cs function with negative values * Formatting * Remove numpy 2 check
1 parent bc4fd56 commit dee9447

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

complexify/cs.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55

66
import numpy as np
77

8-
if np.__version__[0] == "2":
9-
NumPy2 = True
10-
else:
11-
NumPy2 = False
12-
138

149
def abs(x): # noqa: A001
1510
"""

tests/test_cs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class TestComplexSafe(unittest.TestCase):
99
def setUp(self):
1010
# Generate random arrays with a fixed seed
1111
np.random.seed(3)
12-
self.a = np.random.rand(5)
13-
self.b = np.random.rand(5)
12+
self.a = 2 * (np.random.rand(5) - 0.5)
13+
self.b = 2 * (np.random.rand(5) - 0.5)
1414

15-
self.hFD = 1e-6
16-
self.hCS = 1e-40
15+
self.hFD = 1e-8
16+
self.hCS = 1e-200
1717

1818
self.aFD = self.a.copy()
1919
self.aFD[0] += self.hFD

0 commit comments

Comments
 (0)