From e41aed051285a508853a7e07f9603d0731bc7ed5 Mon Sep 17 00:00:00 2001 From: mmagnuski Date: Tue, 3 Sep 2024 16:32:58 +0200 Subject: [PATCH] TST: fix tests --- .circleci/config.yml | 1 + pylabianca/test/test_zeta.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 490d5391..a4076166 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,7 @@ jobs: mamba install pytest -y; hash -r pytest pip install pytest-cov + pip install zetapy - run: name: Run tests command: | diff --git a/pylabianca/test/test_zeta.py b/pylabianca/test/test_zeta.py index c4574f67..6e933174 100644 --- a/pylabianca/test/test_zeta.py +++ b/pylabianca/test/test_zeta.py @@ -10,6 +10,7 @@ def test_against_zetapy(): from zetapy import zetatest2 + numba_available = pln.utils.has_numba() fpath = pln.utils.get_zeta_example_data() data = loadmat(fpath, squeeze_me=True) @@ -71,8 +72,7 @@ def test_against_zetapy(): assert np.abs(zeta_info['dblZETA'] - z_val[0]) < 0.25 # if has_numba - has_numba = pln.utils.has_numba() - if has_numba: + if numba_available: z_val_numba, p_val_numba, dist_numba = pln.selectivity.zeta_test( spk_epochs_sel, compare='orientation', n_permutations=500, tmax=1., return_dist=True, backend='numba', picks=0) @@ -88,10 +88,10 @@ def test_against_zetapy(): stim_ori_str = np.array([str(ori) for ori in stim_ori], dtype='object') spk_epochs.metadata = pd.DataFrame({'orientation': stim_ori_str}) - backend = 'numba' if has_numba else 'numpy' + backend = 'numba' if numba_available else 'numpy' z_val_n1, p_val_n1 = pln.selectivity.zeta_test( spk_epochs, compare='orientation', n_permutations=100, - backend='numpy', picks=0, significance='empirical') + backend=backend, picks=0, significance='empirical') z_val_n2, p_val_n2 = pln.selectivity.zeta_test( spk_epochs, compare='orientation', n_permutations=100, backend=backend, picks=0, significance='both')