Skip to content

Commit 7be54d6

Browse files
ErikBjareoreHGA
andauthored
Get CI test builds working again! (#170)
* Revert "Revert PR #167: "ci: fix broken CI" (#169)" This reverts commit 2d74871. * Update Makefile * fix: Update vep.py import * Update Makefile * Update vep.py * fix: typo in makefile * fix: update BaseExperiment class reference * Update Makefile * Update vep.py * Update 01r__n170_viz.py * makefile: install libnotify4 --------- Co-authored-by: Ore O <[email protected]>
1 parent 81dd244 commit 7be54d6

File tree

10 files changed

+90
-364
lines changed

10 files changed

+90
-364
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ jobs:
1717
python-version: 3.8
1818
- name: Install dependencies
1919
run: |
20+
make install-deps-apt
2021
python -m pip install --upgrade pip wheel
2122
python -m pip install attrdict
2223
23-
# Install wxPython wheels since they are distribution-specific and therefore not on PyPI
24-
# See: https://wxpython.org/pages/downloads/index.html
25-
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython
24+
make install-deps-wxpython
25+
- name: Build project
26+
run: |
27+
make build
2628
27-
pip install .
2829
- name: Build docs
2930
run: |
30-
cd doc && make html
31+
make docs
3132
- name: Deploy Docs
3233
uses: peaceiris/actions-gh-pages@v3
3334
if: github.ref == 'refs/heads/master' # TODO: Deploy seperate develop-version of docs?

.github/workflows/test.yml

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
test:
11-
name: ${{ matrix.os }}, py-${{ matrix.python_version }}
11+
name: test (${{ matrix.os }}, py-${{ matrix.python_version }})
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false
@@ -44,29 +44,17 @@ jobs:
4444
- name: Install APT dependencies
4545
if: "startsWith(runner.os, 'Linux')"
4646
run: |
47-
# update archive links
48-
sudo apt-get update
49-
# xvfb is a dependency to create a virtual display
50-
# libgtk-3-dev is a requirement for wxPython
51-
# freeglut3-dev is a requirement for a wxPython dependency
52-
sudo apt-get -y install xvfb libgtk-3-dev freeglut3-dev
47+
make install-deps-apt
48+
- name: Upgrade pip
49+
run: |
50+
python -m pip install --upgrade pip wheel
5351
- name: Install Linux dependencies
5452
if: "startsWith(runner.os, 'Linux')"
5553
run: |
56-
python -m pip install --upgrade pip wheel
57-
58-
# Install wxPython wheels since they are distribution-specific and therefore not on PyPI
59-
# See: https://wxpython.org/pages/downloads/index.html
60-
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython
61-
62-
pip install .
63-
64-
- name: Install MacOS/Windows dependencies
54+
make install-deps-wxpython
55+
- name: Install dependencies
6556
run: |
66-
python -m pip install --upgrade pip wheel
67-
pip install .
68-
pip install -U psychtoolbox # JG_ADD
69-
# EB: needed?
57+
make build
7058
- name: Run eegnb install test
7159
shell: bash
7260
run: |
@@ -83,9 +71,10 @@ jobs:
8371
Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &> xvfb.log &
8472
export DISPLAY=:0
8573
fi
86-
pytest
74+
make test
8775
8876
typecheck:
77+
name: typecheck (${{ matrix.os }}, py-${{ matrix.python_version }})
8978
runs-on: ${{ matrix.os }}
9079
strategy:
9180
fail-fast: false
@@ -102,27 +91,17 @@ jobs:
10291
- name: Install APT dependencies
10392
if: "startsWith(runner.os, 'Linux')"
10493
run: |
105-
# update archive links
106-
sudo apt-get update
107-
# xvfb is a dependency to create a virtual display
108-
# libgtk-3-dev is a requirement for wxPython
109-
# freeglut3-dev is a requirement for a wxPython dependency
110-
sudo apt-get -y install xvfb libgtk-3-dev freeglut3-dev
94+
make install-deps-apt
95+
- name: Upgrade pip
96+
run: |
97+
python -m pip install --upgrade pip wheel
11198
- name: Install Linux dependencies
11299
if: "startsWith(runner.os, 'Linux')"
113100
run: |
114-
python -m pip install --upgrade pip wheel
115-
116-
# Install wxPython wheels since they are distribution-specific and therefore not on PyPI
117-
# See: https://wxpython.org/pages/downloads/index.html
118-
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython
119-
120-
pip install .
121-
- name: Install MacOS/Windows dependencies
101+
make install-deps-wxpython
102+
- name: Install dependencies
122103
run: |
123-
python -m pip install --upgrade pip wheel
124-
pip install .
104+
make build
125105
- name: Typecheck
126106
run: |
127-
# Exclude visual_cueing due to errors
128-
python -m mypy --exclude 'examples/visual_cueing'
107+
make typecheck

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
build:
2+
pip install .
3+
4+
test:
5+
pytest
6+
7+
typecheck:
8+
# Exclude visual_cueing due to errors
9+
python -m mypy --exclude 'examples/visual_cueing'
10+
11+
docs:
12+
cd doc && make html
13+
14+
clean:
15+
cd doc && make clean
16+
17+
install-deps-apt:
18+
sudo apt-get update # update archive links
19+
20+
# xvfb is a dependency to create a virtual display
21+
# libgtk-3-dev is a requirement for wxPython
22+
# freeglut3-dev is a requirement for a wxPython dependency
23+
# portaudio19-dev *might* be required to import psychopy on Ubuntu
24+
# pulseaudio *might* be required to actually run the tests (on PsychoPy import)
25+
# libpulse-dev required to build pocketsphinx (speech recognition dependency of psychopy)
26+
# libsdl2-dev required by psychopy
27+
# libnotify4 is so we can have the libnotify.so module used in wxPython working
28+
sudo apt-get -y install xvfb libgtk-3-dev freeglut3-dev portaudio19-dev libpulse-dev pulseaudio libsdl2-dev libnotify4
29+
30+
# configure dynamic links
31+
sudo ldconfig
32+
33+
UPDATED_LIBPATH=$(sudo find / -name libnotify.so)
34+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$UPDATED_LIBPATH
35+
36+
install-deps-wxpython:
37+
# Install wxPython wheels since they are distribution-specific and therefore not on PyPI
38+
# See: https://wxpython.org/pages/downloads/index.html
39+
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def setup(app):
284284
'backreferences_dir': 'generated', # Where to drop linking files between examples & API
285285
'doc_module': ('eeg-notebooks',),
286286
'reference_url': {'eeg-notebooksS': None},
287-
'remove_conffig_comments': True,
287+
'remove_config_comments': True,
288288
}
289289
290290
"""

eegnb/analysis/utils.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from copy import deepcopy
33
import math
44
import logging
5+
import sys
56
from collections import OrderedDict
67
from glob import glob
78
from typing import Union, List#, Dict
@@ -20,6 +21,7 @@
2021
from mne.channels import make_standard_montage
2122
from mne.filter import create_filter
2223
from matplotlib import pyplot as plt
24+
from scipy import stats
2325
from scipy.signal import lfilter, lfilter_zi
2426

2527
from eegnb import _get_recording_dir
@@ -221,7 +223,8 @@ def plot_conditions(
221223
ylim=(-6, 6),
222224
diff_waveform=(1, 2),
223225
channel_count=4,
224-
channel_order=None):
226+
channel_order=None,
227+
):
225228
"""Plot ERP conditions.
226229
Args:
227230
epochs (mne.epochs): EEG epochs
@@ -247,10 +250,9 @@ def plot_conditions(
247250
"""
248251

249252
if channel_order:
250-
channel_order = np.array(channel_order)
253+
channel_order = np.array(channel_order)
251254
else:
252-
channel_order = np.array(range(channel_count))
253-
255+
channel_order = np.array(range(channel_count))
254256

255257
if isinstance(conditions, dict):
256258
conditions = OrderedDict(conditions)
@@ -260,7 +262,7 @@ def plot_conditions(
260262

261263
X = epochs.get_data() * 1e6
262264

263-
X = X[:,channel_order]
265+
X = X[:, channel_order]
264266

265267
times = epochs.times
266268
y = pd.Series(epochs.events[:, -1])

0 commit comments

Comments
 (0)