Skip to content

Commit

Permalink
TST: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagnuski committed Sep 3, 2024
1 parent 5d6d076 commit e41aed0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
mamba install pytest -y;
hash -r pytest
pip install pytest-cov
pip install zetapy
- run:
name: Run tests
command: |
Expand Down
8 changes: 4 additions & 4 deletions pylabianca/test/test_zeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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')
Expand Down

0 comments on commit e41aed0

Please sign in to comment.