Skip to content

Commit 8101e20

Browse files
authored
Merge branch 'main' into fix-pca-multiprocessing
2 parents 1dfa55a + b9f50e3 commit 8101e20

File tree

6 files changed

+38
-12
lines changed

6 files changed

+38
-12
lines changed

.github/scripts/determine_testing_environment.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
sortingcomponents_changed = False
3232
generation_changed = False
3333
stream_extractors_changed = False
34+
github_actions_changed = False
3435

3536

3637
for changed_file in changed_files_in_the_pull_request_paths:
@@ -78,9 +79,12 @@
7879
sorters_internal_changed = True
7980
else:
8081
sorters_changed = True
82+
elif ".github" in changed_file.parts:
83+
if "workflows" in changed_file.parts:
84+
github_actions_changed = True
8185

8286

83-
run_everything = core_changed or pyproject_toml_changed or neobaseextractor_changed
87+
run_everything = core_changed or pyproject_toml_changed or neobaseextractor_changed or github_actions_changed
8488
run_generation_tests = run_everything or generation_changed
8589
run_extractor_tests = run_everything or extractors_changed or plexon2_changed
8690
run_preprocessing_tests = run_everything or preprocessing_changed
@@ -96,7 +100,7 @@
96100
run_sorters_test = run_everything or sorters_changed
97101
run_internal_sorters_test = run_everything or run_sortingcomponents_tests or sorters_internal_changed
98102

99-
run_streaming_extractors_test = stream_extractors_changed
103+
run_streaming_extractors_test = stream_extractors_changed or github_actions_changed
100104

101105
install_plexon_dependencies = plexon2_changed
102106

.github/workflows/all-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
python-version: ["3.9", "3.12"] # Lower and higher versions we support
29-
os: [macos-13, windows-latest, ubuntu-latest]
29+
os: [macos-latest, windows-latest, ubuntu-latest]
3030
steps:
3131
- uses: actions/checkout@v4
3232
- name: Setup Python ${{ matrix.python-version }}

src/spikeinterface/core/baserecording.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,30 @@ def _select_segments(self, segment_indices):
746746

747747
return SelectSegmentRecording(self, segment_indices=segment_indices)
748748

749+
def get_channel_locations(
750+
self,
751+
channel_ids: list | np.ndarray | tuple | None = None,
752+
axes: "xy" | "yz" | "xz" | "xyz" = "xy",
753+
) -> np.ndarray:
754+
"""
755+
Get the physical locations of specified channels.
756+
757+
Parameters
758+
----------
759+
channel_ids : array-like, optional
760+
The IDs of the channels for which to retrieve locations. If None, retrieves locations
761+
for all available channels. Default is None.
762+
axes : "xy" | "yz" | "xz" | "xyz", default: "xy"
763+
The spatial axes to return, specified as a string (e.g., "xy", "xyz"). Default is "xy".
764+
765+
Returns
766+
-------
767+
np.ndarray
768+
A 2D or 3D array of shape (n_channels, n_dimensions) containing the locations of the channels.
769+
The number of dimensions depends on the `axes` argument (e.g., 2 for "xy", 3 for "xyz").
770+
"""
771+
return super().get_channel_locations(channel_ids=channel_ids, axes=axes)
772+
749773
def is_binary_compatible(self) -> bool:
750774
"""
751775
Checks if the recording is "binary" compatible.

src/spikeinterface/core/baserecordingsnippets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def set_channel_locations(self, locations, channel_ids=None):
349349
raise ValueError("set_channel_locations(..) destroys the probe description, prefer _set_probes(..)")
350350
self.set_property("location", locations, ids=channel_ids)
351351

352-
def get_channel_locations(self, channel_ids=None, axes: str = "xy"):
352+
def get_channel_locations(self, channel_ids=None, axes: str = "xy") -> np.ndarray:
353353
if channel_ids is None:
354354
channel_ids = self.get_channel_ids()
355355
channel_indices = self.ids_to_indices(channel_ids)

src/spikeinterface/core/job_tools.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,8 @@ def divide_segment_into_chunks(num_frames, chunk_size):
136136
else:
137137
n = num_frames // chunk_size
138138

139-
frame_starts = np.arange(n) * chunk_size
140-
frame_stops = frame_starts + chunk_size
141-
142-
frame_starts = frame_starts.tolist()
143-
frame_stops = frame_stops.tolist()
139+
frame_starts = [i * chunk_size for i in range(n)]
140+
frame_stops = [frame_start + chunk_size for frame_start in frame_starts]
144141

145142
if (num_frames % chunk_size) > 0:
146143
frame_starts.append(n * chunk_size)

src/spikeinterface/extractors/tests/test_neoextractors.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class BlackrockSortingTest(SortingCommonTestSuite, unittest.TestCase):
234234
ExtractorClass = BlackrockSortingExtractor
235235
downloads = ["blackrock"]
236236
entities = [
237-
"blackrock/FileSpec2.3001.nev",
237+
dict(file_path=local_folder / "blackrock/FileSpec2.3001.nev", sampling_frequency=30_000.0),
238238
dict(file_path=local_folder / "blackrock/blackrock_2_1/l101210-001.nev", sampling_frequency=30_000.0),
239239
]
240240

@@ -278,8 +278,8 @@ class Spike2RecordingTest(RecordingCommonTestSuite, unittest.TestCase):
278278

279279

280280
@pytest.mark.skipif(
281-
version.parse(platform.python_version()) >= version.parse("3.10"),
282-
reason="Sonpy only testing with Python < 3.10!",
281+
version.parse(platform.python_version()) >= version.parse("3.10") or platform.system() == "Darwin",
282+
reason="Sonpy only testing with Python < 3.10 and not supported on macOS!",
283283
)
284284
class CedRecordingTest(RecordingCommonTestSuite, unittest.TestCase):
285285
ExtractorClass = CedRecordingExtractor
@@ -293,6 +293,7 @@ class CedRecordingTest(RecordingCommonTestSuite, unittest.TestCase):
293293
]
294294

295295

296+
@pytest.mark.skipif(platform.system() == "Darwin", reason="Maxwell plugin not supported on macOS")
296297
class MaxwellRecordingTest(RecordingCommonTestSuite, unittest.TestCase):
297298
ExtractorClass = MaxwellRecordingExtractor
298299
downloads = ["maxwell"]

0 commit comments

Comments
 (0)