Skip to content

Commit 2308781

Browse files
Update to spikeinterface 0.102.3 (#240)
* pin neo. * Rename 'neurpixels' to 'imec0' in get_probe. * Always offset times. * Update docs link. * Update documentation. * Troubleshooting the test. * Fix run loading. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1890277 commit 2308781

File tree

9 files changed

+20
-11
lines changed

9 files changed

+20
-11
lines changed

docs/source/galleries/how_to/01_preprocess_a_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
plots = session.plot_preprocessed(
3636
show=True,
37-
time_range=(0, 0.5),
37+
time_range=(0, 0.5), # time relative to the first sample (not absolute)
3838
show_channel_ids=False, # also, "mode"="map" or "line"
3939
)
4040

docs/source/get_started/supported_formats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Use [catGT](https://billkarsh.github.io/SpikeGLX/help/dmx_vs_gbl/dmx_vs_gbl) for
141141

142142
:::{tab-item} OpenEphys
143143

144-
Currently, the [flat binary format](https://open-ephys.github.io/gui-docs/User-Manual/Recording-data/Binary-format.html)
144+
Currently, the [flat binary format](https://open-ephys.github.io/gui-docs/User-Manual/Data-formats/Binary-format.html)
145145
(the OpenEphys default) is supported.
146146

147147
[OpenEphys](https://open-ephys.org/) flat binary recordings

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ classifiers = [
2121
]
2222

2323
dependencies = [
24-
"spikeinterface[full]==0.102.0",
24+
"spikeinterface[full]==0.102.3",
25+
"neo==0.14.1",
2526
"submitit",
2627
"slurmio",
2728
"psutil",

spikewrap/process/_loading.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,14 @@ def get_raw_run_paths(
133133
if passed_run_names == "all":
134134
run_paths = detected_run_paths
135135
else:
136-
detected_run_names = [path_.name for path_ in detected_run_paths]
136+
detected_runs = {path_.name: path_ for path_ in detected_run_paths}
137137

138138
for passed_name in passed_run_names:
139-
if passed_name not in detected_run_names:
139+
if passed_name not in detected_runs:
140140
raise ValueError(f"{passed_name} not found in folder: {ses_path}")
141141

142-
run_paths = [
143-
path_ for path_ in detected_run_paths if path_.name in detected_run_names
144-
]
142+
# We need to maintain the same order as `passed_run_names`
143+
run_paths = [detected_runs[name] for name in passed_run_names]
145144

146145
if not _utils._paths_are_in_datetime_order(run_paths, "creation"):
147146
warnings.warn(

spikewrap/structure/_preprocess_run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ def plot_preprocessed(
192192
The type of plot to generate. ``"map"`` for a heatmap and ``"line"`` for a line plot.
193193
time_range
194194
The time range (start, end) to plot the data within, in seconds.
195+
This is relative to the first sample, and not the absolute time.
196+
i.e. `0` is always the first timepoint.
195197
show_channel_ids
196198
If True, the plot will display channel IDs.
197199
show

spikewrap/structure/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ def plot_preprocessed(
234234
Determines the plotting style, a heatmap-style or line plot.
235235
time_range
236236
Time range (start, end), in seconds, to plot. e.g. (0.0, 1.0)
237+
This is relative to the first sample, and not the absolute time.
238+
i.e. `0` is always the first timepoint.
237239
show_channel_ids
238240
If ``True``, displays the channel identifiers on the plots.
239241
show

spikewrap/visualise/_visualise.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,19 @@ def visualise_run_preprocessed(
7171
preprocessed, "last"
7272
)
7373

74+
time_range_adjusted = time_range + recording_to_plot.get_times()[0]
75+
7476
si.plot_traces(
7577
recording_to_plot,
7678
order_channel_by_depth=True,
77-
time_range=time_range,
79+
time_range=time_range_adjusted,
7880
return_scaled=True,
7981
show_channel_ids=show_channel_ids,
8082
mode=mode,
8183
ax=ax,
8284
segment_index=0,
8385
)
86+
8487
if key == canon.grouped_shankname():
8588
ax.set_title(f"Session: {ses_name}, Run: {run_name}")
8689
else:

tests/test_integration/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ def get_mock_probe(self):
2424
"""
2525
Get an arbitrary probe to use on the test recording (16 channels).
2626
"""
27-
mock_probe = pi.get_probe("neuropixels", "NP2014")
27+
mock_probe = pi.get_probe("imec", "NP2014")
2828
mock_probe = mock_probe.get_slice(np.arange(16))
2929
return mock_probe

tests/test_integration/test_sync.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def test_run_name_matches_index(self, session):
3232

3333
for run_idx, run_name in enumerate(session.get_raw_run_names()):
3434
assert session._raw_runs[run_idx]._run_name == run_name
35-
assert run_name == session._passed_run_names[run_idx]
35+
assert (
36+
run_name == session._passed_run_names[run_idx]
37+
), f"session.get_raw_run_names(){session.get_raw_run_names()} ------ session._passed_run_names {session._passed_run_names}"
3638

3739
def test_get_sync(self, session):
3840
"""

0 commit comments

Comments
 (0)