-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement a simple reader for Sonata spikes * Integrate with replay manager
- Loading branch information
1 parent
f388c35
commit 9606979
Showing
6 changed files
with
114 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
import numpy.testing as npt | ||
from pathlib import Path | ||
|
||
SAMPLE_DATA_DIR = Path(__file__).parent.absolute() / "sample_data" | ||
|
||
|
||
@pytest.mark.forked | ||
def test_replay_manager_sonata(): | ||
from neurodamus.replay import SpikeManager, MissingSpikesPopulationError | ||
spikes_sonata = SAMPLE_DATA_DIR / "out.h5" | ||
|
||
timestamps, spike_gids = SpikeManager._read_spikes_sonata(spikes_sonata, "NodeA") | ||
npt.assert_allclose(timestamps[:8], [0.1, 0.15, 0.175, 2.275, 3.025, 3.45, 4.35, 5.7]) | ||
npt.assert_equal(spike_gids[:8], [0, 2, 1, 0, 1, 2, 0, 1]) | ||
|
||
# We do an internal assertion when the population doesnt exist. Verify it works as expected | ||
with pytest.raises(MissingSpikesPopulationError, match="Spikes population not found"): | ||
SpikeManager._read_spikes_sonata(spikes_sonata, "wont-exist") |