Skip to content

Commit

Permalink
Fix tests to accomodate changes in NumPy
Browse files Browse the repository at this point in the history
  • Loading branch information
manu-mannattil committed Mar 6, 2024
1 parent 0e3cfd5 commit b71b5bc
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 40 deletions.
6 changes: 1 addition & 5 deletions nolitsa/tests/test_d2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np

from nolitsa import d2, utils
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


def test_c2():
Expand Down Expand Up @@ -74,7 +74,3 @@ def test_ttmle():

desired = np.pi * (c[1:] / (c[1:] - c[0]))
assert_allclose(desired, d2.ttmle(r, c, zero=False)[1])


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np

from nolitsa import data, utils
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


def test_falpha():
Expand All @@ -26,7 +26,3 @@ def test_falpha():
np.diff(np.log(freq[1:])))

assert_allclose(-alpha, desired)


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import absolute_import, division, print_function
import numpy as np
from nolitsa import delay
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


class TestAcorr(object):
Expand Down Expand Up @@ -67,7 +67,3 @@ def test_adfd():
dim, maxtau = 7, 25
desired = np.sqrt(sqsum(dim - 1)) * b * np.arange(maxtau)
assert_allclose(delay.adfd(x, dim=dim, maxtau=maxtau), desired)


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np

from nolitsa import dimension
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


class TestAFN(object):
Expand Down Expand Up @@ -95,7 +95,3 @@ def test_curve(self):

f1 = dimension.fnn(x, dim=dim, tau=25)[0]
np.allclose(f1, desired)


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_lyapunov.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np

from nolitsa import lyapunov
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


def test_mle():
Expand Down Expand Up @@ -43,7 +43,3 @@ def test_mle_embed():

assert_allclose(desired, lyapunov.mle_embed(x, dim=dim, tau=tau,
maxt=25)[0], atol=1e-1)


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np

from nolitsa import noise
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


class TestNoRed(object):
Expand Down Expand Up @@ -76,7 +76,3 @@ def test_line(self):
z[-c:] = x[-c:]

assert_allclose(y, z)


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_surrogates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np

from nolitsa import surrogates, noise, utils
from numpy.testing import assert_allclose, run_module_suite
from numpy.testing import assert_allclose


def test_ft():
Expand Down Expand Up @@ -56,7 +56,3 @@ def test_mismatch():
x[desired[0] - 1:desired[1] + neigh] = 10.0

assert_allclose(desired, surrogates.mismatch(x, neigh=neigh)[0])


if __name__ == '__main__':
run_module_suite()
6 changes: 1 addition & 5 deletions nolitsa/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from time import sleep
from nolitsa import utils
from numpy.testing import assert_, assert_allclose, run_module_suite
from numpy.testing import assert_, assert_allclose


def test_corrupt():
Expand Down Expand Up @@ -209,7 +209,3 @@ def test_stationary(self):
def test_non_stationary(self):
x = np.arange(1000)
assert_(utils.statcheck(x)[1] < 1E-30)


if __name__ == '__main__':
run_module_suite()

0 comments on commit b71b5bc

Please sign in to comment.