Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgill86 authored Sep 9, 2021
2 parents 7c82f8a + c942077 commit 68e524a
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 16 deletions.
10 changes: 10 additions & 0 deletions doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,13 @@ Viewers from Neo objects
:download:`viewers_with_neo_objects.py <../examples/viewers_with_neo_objects.py>`

.. literalinclude:: ../examples/viewers_with_neo_objects.py


Viewers for SpikeInterface objects
----------------------------------

.. image:: img/viewers_with_spikeinterface_objects.png

:download:`viewers_with_spikeinterface_objects.py <../examples/viewers_with_spikeinterface_objects.py>`

.. literalinclude:: ../examples/viewers_with_spikeinterface_objects.py
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Installation
============

Requirements:
* Python ≥ 3.5
* Python ≥ 3.7
* numpy
* scipy
* matplotlib ≥ 2.0
* pyqtgraph ≥ 0.10.0
* PyQt5, PySide2, or PyQt4 (manual installation required)
* PyQt5 or PySide2 (manual installation required)

Optional dependencies:
* Neo ≥ 0.6 (standalone app and Neo sources)
Expand Down
1 change: 1 addition & 0 deletions doc/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release Notes
.. toctree::
:maxdepth: 1

releases/1.5.0.rst
releases/1.4.0.rst
releases/1.3.1.rst
releases/1.3.0.rst
Expand Down
33 changes: 33 additions & 0 deletions doc/releases/1.5.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Version 1.5.0
-------------

2021-09-09

Compatibility
.............

Support for Python < 3.7 and for PyQt4 were dropped.

* Add compatibility with Neo 0.10.0
(:pr:`151`, :pr:`157`, :pr:`159`)

* Add PySide2 support
(:pr:`148`)

New data sources
................

* Add data sources for SpikeInterface recording and sorting objects
(:pr:`153`)

Continuous integration
......................

* Run automated test suite with GitHub Actions
(:pr:`137`, :pr:`138`, :pr:`142`, :pr:`145`, :pr:`149`)

* Add manually-triggerable GitHub Action workflows for publishing to PyPI
(:pr:`140`)

* Add Coveralls test coverage reporting
(:pr:`144`)
2 changes: 1 addition & 1 deletion ephyviewer/datasource/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, epoch=None, possible_labels=[], color_labels=None, channel_na
# add labels missing from possible_labels but found in epoch data
new_labels_from_data = list(set(epoch['label'])-set(self.possible_labels))
if restrict_to_possible_labels:
assert len(new_labels_from_data)==0, 'epoch data contains labels not found in possible_labels: ' + str(new_labels_from_data)
assert len(new_labels_from_data)==0, f'epoch data contains labels not found in possible_labels: {new_labels_from_data}'
self.possible_labels += new_labels_from_data

# put the epochs into a canonical order after loading
Expand Down
15 changes: 7 additions & 8 deletions ephyviewer/datasource/spikeinterfacesources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Integrate
Data sources for SpikeInterface
"""

from .sourcebase import BaseDataSource
Expand All @@ -11,9 +11,8 @@
try:
from distutils.version import LooseVersion as V
import spikeinterface
if V(spikeinterface.__version__)>='0.90.0':
if V(spikeinterface.__version__)>='0.90.1':
HAVE_SI = True
from neo.rawio.baserawio import BaseRawIO
else:
HAVE_SI = False
except ImportError:
Expand All @@ -24,10 +23,10 @@
from .spikes import BaseSpikeSource


class FromSpikeinterfaceRecordingSource(BaseAnalogSignalSource):
class SpikeInterfaceRecordingSource(BaseAnalogSignalSource):
def __init__(self, recording, segment_index=0):
BaseAnalogSignalSource.__init__(self)

self.recording = recording
self.segment_index = segment_index

Expand Down Expand Up @@ -67,13 +66,13 @@ def index_to_time(self, ind):



class FromSpikeinterfaceSorintgSource(BaseSpikeSource):
class SpikeInterfaceSortingSource(BaseSpikeSource):
def __init__(self, sorting, segment_index=0):
BaseSpikeSource.__init__(self)

self.sorting = sorting
self.segment_index = segment_index

#TODO
self._t_stop = 10.

Expand Down
4 changes: 2 additions & 2 deletions ephyviewer/tests/test_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ def test_spikeinterface_sources():
from spikeinterface.core.testing_tools import generate_recording, generate_sorting

recording = generate_recording()
source = ephyviewer.FromSpikeinterfaceRecordingSource(recording=recording)
source = ephyviewer.SpikeInterfaceRecordingSource(recording=recording)
print(source)

print(source.t_start, source.nb_channel, source.sample_rate)

sorting = generate_sorting()
source = ephyviewer.FromSpikeinterfaceSorintgSource(sorting=sorting)
source = ephyviewer.SpikeInterfaceSortingSource(sorting=sorting)
print(source)

print(source.t_start, source.nb_channel, source.get_channel_name())
Expand Down
5 changes: 3 additions & 2 deletions ephyviewer/tests/test_spikeinterfaceviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ def test_spikeinterface_viewer(interactive=False):
import spikeinterface as si
from spikeinterface.core.testing_tools import generate_recording, generate_sorting


recording = generate_recording()
sig_source = ephyviewer.FromSpikeinterfaceRecordingSource(recording=recording)
sig_source = ephyviewer.SpikeInterfaceRecordingSource(recording=recording)

sorting = generate_sorting()
spike_source = ephyviewer.FromSpikeinterfaceSorintgSource(sorting=sorting)
spike_source = ephyviewer.SpikeInterfaceSortingSource(sorting=sorting)

app = ephyviewer.mkQApp()
win = ephyviewer.MainViewer(debug=True, show_auto_scale=True)
Expand Down
2 changes: 1 addition & 1 deletion ephyviewer/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '1.4.1.dev'
version = '1.5.0'
43 changes: 43 additions & 0 deletions examples/viewers_with_spikeinterface_objects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""
Here is an example of opening viewers directly from spikeinterface objects : recording and sorting.
In this example, recording and sorting are fake ones generated by spikeinterface but of you course
you can use any format supported by spikeinterface.
Note that you can display any lazy preprocessor from
`spikeinterface.toolkit.preprocessing` (filtering, denoising, whittening, ...) so you can see immediatly
the clean signal.
"""
import ephyviewer
import spikeinterface.full as si
from spikeinterface.core.testing_tools import generate_recording, generate_sorting


recording = generate_recording()
sig_source = ephyviewer.SpikeInterfaceRecordingSource(recording=recording)

filtered_recording = si.bandpass_filter(recording, freq_min=60., freq_max=100.)
sig_filtered_source = ephyviewer.SpikeInterfaceRecordingSource(recording=filtered_recording)

sorting = generate_sorting()
spike_source = ephyviewer.SpikeInterfaceSortingSource(sorting=sorting)

app = ephyviewer.mkQApp()
win = ephyviewer.MainViewer(debug=True, show_auto_scale=True)

view = ephyviewer.TraceViewer(source=sig_source, name='signals')
win.add_view(view)

view = ephyviewer.TraceViewer(source=sig_filtered_source, name='signals filtered')
win.add_view(view)

view = ephyviewer.SpikeTrainViewer(source=spike_source, name='spikes')
win.add_view(view)


win.show()
app.exec_()

0 comments on commit 68e524a

Please sign in to comment.