Skip to content

Commit 094c6b8

Browse files
authored
Merge pull request #155 from jpgill86/pyqtgraph-0.12-compatibility
Fix failing tests
2 parents 469770e + 906d125 commit 094c6b8

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
matrix:
3636
python-version: ['3.7', '3.8', '3.9']
37-
qt-version: [PyQt5]
37+
qt-version: [PyQt5, PySide2]
3838
env:
3939
DISPLAY: ':99.0'
4040
XDG_RUNTIME_DIR: /tmp/runtime-runner
@@ -83,7 +83,7 @@ jobs:
8383
# run, but by downloading them ahead of time in a separate step we
8484
# can monitor the progress in GitHub Actions. if the files already
8585
# exist (because they were restored from the cache), no work is done.
86-
86+
8787
# python -c "from ephyviewer.tests.testing_tools import get_tdt_test_files; get_tdt_test_files();"
8888
run: |
8989
python -c "from ephyviewer.tests.testing_tools import get_blackrock_files; get_blackrock_files();"

ephyviewer/tests/test_datasource.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_neo_rawio_sources():
107107
neorawio = BlackrockRawIO(filename=filename)
108108
neorawio.parse_header()
109109
print(neorawio)
110-
110+
111111

112112
sources = ephyviewer.get_sources_from_neo_rawio(neorawio)
113113
#~ print(sources)
@@ -156,18 +156,18 @@ def test_neo_object_sources():
156156

157157
def test_spikeinterface_sources():
158158
import spikeinterface as si
159-
from spikeinterface.core.tests.testing_tools import generate_recording, generate_sorting
160-
159+
from spikeinterface.core.testing_tools import generate_recording, generate_sorting
160+
161161
recording = generate_recording()
162162
source = ephyviewer.FromSpikeinterfaceRecordingSource(recording=recording)
163163
print(source)
164-
164+
165165
print(source.t_start, source.nb_channel, source.sample_rate)
166-
166+
167167
sorting = generate_sorting()
168168
source = ephyviewer.FromSpikeinterfaceSorintgSource(sorting=sorting)
169169
print(source)
170-
170+
171171
print(source.t_start, source.nb_channel, source.get_channel_name())
172172

173173

ephyviewer/tests/test_spikeinterfaceviewer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
def test_spikeinterface_viewer(interactive=False):
88
import spikeinterface as si
9-
from spikeinterface.core.tests.testing_tools import generate_recording, generate_sorting
10-
9+
from spikeinterface.core.testing_tools import generate_recording, generate_sorting
10+
1111
recording = generate_recording()
1212
sig_source = ephyviewer.FromSpikeinterfaceRecordingSource(recording=recording)
1313

ephyviewer/tests/testing_tools.py

+7-14
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def make_video_file(filename, codec='mpeg4', rate=25.): # mpeg4 mjpeg libx264
8383
#~ ax.set_title()
8484
#~ line.set_markersize(i)
8585
fig.canvas.draw()
86-
one_img = np.frombuffer(fig.canvas.tostring_rgb(), dtype='u1').reshape(h,w,3)
86+
one_img = np.asarray(fig.canvas.buffer_rgba())[:,:,:3]
8787
one_img = one_img[:,:,::-1].copy()
8888
#~ one_img = one_img .swapaxes(0,1).copy()
8989

@@ -158,10 +158,10 @@ def get_tdt_test_files():
158158
# from neo.utils import download_dataset
159159
# local_folder = download_dataset(remote_path='tdt/aep_05')
160160
# return str(local_folder)
161-
161+
162162
# we use old implementation with http
163163
url_for_tests = "https://web.gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/"
164-
164+
165165
files_to_download = [
166166
'tdt/aep_05/Block-1/aep_05_Block-1.Tbk',
167167
'tdt/aep_05/Block-1/aep_05_Block-1.Tdx',
@@ -170,7 +170,7 @@ def get_tdt_test_files():
170170
]
171171

172172
local_folder = Path.home() / 'ephy_testing_data_http'
173-
173+
174174
for file in files_to_download:
175175
localfile = local_folder / file
176176
distantfile = url_for_tests + file
@@ -179,7 +179,7 @@ def get_tdt_test_files():
179179
dist = urlopen(distantfile)
180180
with open(localfile, 'wb') as f:
181181
f.write(dist.read())
182-
182+
183183
tdt_folder = str(local_folder / 'tdt' / 'aep_05')
184184
return tdt_folder
185185

@@ -192,7 +192,7 @@ def get_blackrock_files():
192192
]
193193

194194
local_folder = Path.home() / 'ephy_testing_data_http'
195-
195+
196196
for file in files_to_download:
197197
localfile = local_folder / file
198198
distantfile = url_for_tests + file
@@ -201,13 +201,6 @@ def get_blackrock_files():
201201
dist = urlopen(distantfile)
202202
with open(localfile, 'wb') as f:
203203
f.write(dist.read())
204-
204+
205205
filename = str(local_folder / 'blackrock' / 'FileSpec2.3001')
206206
return filename
207-
208-
209-
210-
211-
212-
213-

requirements-tests.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
av
22
coveralls
33
neo>=0.10.0
4-
spikeinterface>=0.90.0
4+
spikeinterface>=0.90.1
55
pandas
66
pytest
77
pytest-cov

0 commit comments

Comments
 (0)