Skip to content

Commit cd92621

Browse files
committed
Merge branch 'main' into dev
2 parents c0a7662 + 45aaa9e commit cd92621

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

tabox/tests/test_adosc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_random_vector(self):
3939
)
4040

4141
self.assertTrue(
42-
np.array_equal(this_ret, that_ret, equal_nan=True),
42+
np.allclose(this_ret, that_ret, equal_nan=True),
4343
f"fast_period: {fast_period}, slow_period: {slow_period}, "
4444
f"high: {high}, low: {low}, close: {close}, volume: {volume}, "
4545
f"this_ret: {this_ret}, that_ret: {that_ret}",

tabox/tests/test_macdext.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def test_random_vector(self):
2929
signalmatype=0
3030
)
3131

32-
self.assertTrue(np.array_equal(this_macd, that_macd, equal_nan=True), f"{close}, {this_macd}, {that_macd}")
33-
self.assertTrue(np.array_equal(this_signal, that_signal, equal_nan=True), f"{close}, {this_signal}, {that_signal}")
34-
self.assertTrue(np.array_equal(this_hist, that_hist, equal_nan=True), f"{close}, {this_hist}, {that_hist}")
32+
self.assertTrue(np.allclose(this_macd, that_macd, equal_nan=True), f"{close}, {this_macd}, {that_macd}")
33+
self.assertTrue(np.allclose(this_signal, that_signal, equal_nan=True), f"{close}, {this_signal}, {that_signal}")
34+
self.assertTrue(np.allclose(this_hist, that_hist, equal_nan=True), f"{close}, {this_hist}, {that_hist}")
3535

3636
def test_custom_periods_and_types(self):
3737
close = np.random.random(1000)
@@ -54,9 +54,9 @@ def test_custom_periods_and_types(self):
5454
signalmatype=3
5555
)
5656

57-
self.assertTrue(np.array_equal(this_macd, that_macd, equal_nan=True))
58-
self.assertTrue(np.array_equal(this_signal, that_signal, equal_nan=True))
59-
self.assertTrue(np.array_equal(this_hist, that_hist, equal_nan=True))
57+
self.assertTrue(np.allclose(this_macd, that_macd, equal_nan=True))
58+
self.assertTrue(np.allclose(this_signal, that_signal, equal_nan=True))
59+
self.assertTrue(np.allclose(this_hist, that_hist, equal_nan=True))
6060

6161
if __name__ == '__main__':
6262
unittest.main()

tabox/tests/test_t3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ def test_random_vector(self):
1212
this_t3 = this_T3(close)
1313
that_t3 = that_T3(close)
1414

15-
self.assertTrue(np.array_equal(this_t3, that_t3, equal_nan=True), f"{close}, {this_t3}, {that_t3}")
15+
self.assertTrue(np.allclose(this_t3, that_t3, equal_nan=True), f"{close}, {this_t3}, {that_t3}")
1616

1717
def test_custom_periods(self):
1818
close = np.random.random(1000)
1919
this_t3 = this_T3(close, timeperiod=10, vfactor=0.5)
2020
that_t3 = that_T3(close, timeperiod=10, vfactor=0.5)
2121

22-
self.assertTrue(np.array_equal(this_t3, that_t3, equal_nan=True))
22+
self.assertTrue(np.allclose(this_t3, that_t3, equal_nan=True))
2323

2424
if __name__ == '__main__':
2525
unittest.main()

tabox/tests/test_tema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ def test_random_vector(self):
1212
this_tema = this_TEMA(close)
1313
that_tema = that_TEMA(close)
1414

15-
self.assertTrue(np.array_equal(this_tema, that_tema, equal_nan=True),
15+
self.assertTrue(np.allclose(this_tema, that_tema, equal_nan=True),
1616
f"{close}, {this_tema}, {that_tema}")
1717

1818
def test_custom_periods(self):
1919
close = np.random.random(1000)
2020
this_tema = this_TEMA(close, timeperiod=5)
2121
that_tema = that_TEMA(close, timeperiod=5)
2222

23-
self.assertTrue(np.array_equal(this_tema, that_tema, equal_nan=True))
23+
self.assertTrue(np.allclose(this_tema, that_tema, equal_nan=True))
2424

2525
if __name__ == '__main__':
2626
unittest.main()

tabox/tests/test_wma.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_random_vector(self):
1414
this_ret = this_WMA(close, k)
1515
that_ret = that_WMA(close, k)
1616

17-
self.assertTrue(np.array_equal(this_ret, that_ret, equal_nan=True))
17+
self.assertTrue(np.allclose(this_ret, that_ret, equal_nan=True))
1818

1919
if __name__ == '__main__':
2020
unittest.main()

0 commit comments

Comments
 (0)