Skip to content

Commit

Permalink
Merge pull request SpikeInterface#3129 from h-mayorquin/remove_stream…
Browse files Browse the repository at this point in the history
…ing_extractors

Add streaming extractor tests to main  test script
  • Loading branch information
samuelgarcia authored Jul 3, 2024
2 parents 9513be4 + 578a7de commit 2af38a3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 63 deletions.
12 changes: 11 additions & 1 deletion .github/determine_testing_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,25 @@
exporters_changed = False
sortingcomponents_changed = False
generation_changed = False
stream_extractors_changed = False


for changed_file in changed_files_in_the_pull_request_paths:

file_is_in_src = changed_file.parts[0] == "src"


if changed_file.name == "pyproject.toml":
pyproject_toml_changed = True
elif changed_file.name == "neobaseextractor.py":
neobaseextractor_changed = True
extractors_changed = True
elif changed_file.name == "plexon2.py":
plexon2_changed = True
elif changed_file.name == "nwbextractors.py":
extractors_changed = True # There are NWB tests that are not streaming
stream_extractors_changed = True
elif changed_file.name == "iblextractors.py":
stream_extractors_changed = True
elif "core" in changed_file.parts:
core_changed = True
elif "extractors" in changed_file.parts:
Expand Down Expand Up @@ -90,8 +96,11 @@
run_sorters_test = run_everything or sorters_changed
run_internal_sorters_test = run_everything or run_sortingcomponents_tests or sorters_internal_changed

run_streaming_extractors_test = stream_extractors_changed

install_plexon_dependencies = plexon2_changed


environment_varaiables_to_add = {
"RUN_EXTRACTORS_TESTS": run_extractor_tests,
"RUN_PREPROCESSING_TESTS": run_preprocessing_tests,
Expand All @@ -106,6 +115,7 @@
"RUN_SORTERS_TESTS": run_sorters_test,
"RUN_INTERNAL_SORTERS_TESTS": run_internal_sorters_test,
"INSTALL_PLEXON_DEPENDENCIES": install_plexon_dependencies,
"RUN_STREAMING_EXTRACTORS_TESTS": run_streaming_extractors_test,
}

# Write the conditions to the GITHUB_ENV file
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
echo "RUN_SORTERS_TESTS=${RUN_SORTERS_TESTS}"
echo "RUN_INTERNAL_SORTERS_TESTS=${RUN_INTERNAL_SORTERS_TESTS}"
echo "INSTALL_PLEXON_DEPENDENCIES=${INSTALL_PLEXON_DEPENDENCIES}"
echo "RUN_STREAMING_EXTRACTORS_TESTS=${RUN_STREAMING_EXTRACTORS_TESTS}"
- name: Install packages
run: |
Expand Down Expand Up @@ -136,6 +137,13 @@ jobs:
pip install -e .[extractors,streaming_extractors,test_extractors]
./.github/run_tests.sh "extractors and not streaming_extractors" --no-virtual-env
- name: Test streaming extracotors
shell: bash
if: env.RUN_STREAMING_EXTRACTORS_TESTS
run: |
pip install -e .[streaming_extractors,test_extractors]
./.github/run_tests.sh "streaming_extractors" --no-virtual-env
- name: Test preprocessing
shell: bash
if: env.RUN_PREPROCESSING_TESTS == 'true'
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/streaming-extractor-test.yml

This file was deleted.

12 changes: 0 additions & 12 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import pytest
import shutil
import os
from pathlib import Path


ON_GITHUB = bool(os.getenv('GITHUB_ACTIONS'))


# define marks
mark_names = ["core", "extractors", "preprocessing", "postprocessing",
"sorters_external", "sorters_internal", "sorters",
"qualitymetrics", "comparison", "curation",
"widgets", "exporters", "sortingcomponents", "generation"]


@pytest.fixture(scope="module")
def create_cache_folder(tmp_path_factory):
cache_folder = tmp_path_factory.mktemp("cache_folder")
Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/extractors/iblextractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class IblSortingExtractor(BaseSorting):
name = "ibl"
installation_mesg = "IBL extractors require ibllib as a dependency." " To install, run: \n\n pip install ibllib\n\n"

def __init__(self, pid, good_clusters_only=False, load_unit_properties=True, one=None):
def __init__(self, pid: str, good_clusters_only: bool = False, load_unit_properties: bool = True, one=None):
try:
from one.api import ONE
from brainbox.io.one import SpikeSortingLoader
Expand Down

0 comments on commit 2af38a3

Please sign in to comment.