Skip to content

Commit

Permalink
Merge pull request #2112 from zm711/check-install
Browse files Browse the repository at this point in the history
Add actual test for `check_your_install`
  • Loading branch information
alejoe91 authored Oct 20, 2023
2 parents e4460d6 + 4b98a2e commit 8b31b33
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/installation-tips-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ jobs:
uses: conda-incubator/[email protected]
with:
environment-file: ./installation_tips/full_spikeinterface_environment_${{ matrix.label }}.yml
activate-environment: si_env
- name: Check Installation Tips
run: python ./installation_tips/check_your_install.py --ci # ci flag turns off gui
- name: Windows cleanup
if: ${{ matrix.label == 'windows' }}
run: python .installation_tips/cleanup_for_windows.py
21 changes: 14 additions & 7 deletions installation_tips/check_your_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
import platform
import os
import shutil

import argparse

def check_import_si():
import spikeinterface as si


def check_import_si_full():
import spikeinterface.full as si

Expand All @@ -25,7 +24,6 @@ def _run_one_sorter_and_exctract_wf(sorter_name):
si.extract_waveforms(rec, sorting, f'{sorter_name}_waveforms',
n_jobs=1, total_memory="10M", max_spikes_per_unit=500, return_scaled=False)


def run_tridesclous():
_run_one_sorter_and_exctract_wf('tridesclous')

Expand All @@ -49,7 +47,6 @@ def open_sigui():
win.show()
app.exec_()


def export_to_phy():
import spikeinterface.full as si
we = si.WaveformExtractor.load_from_folder("tridesclous_waveforms")
Expand All @@ -73,22 +70,32 @@ def _clean():
if Path(folder).exists():
shutil.rmtree(folder)

parser = argparse.ArgumentParser()
# add ci flag so that gui will not be used in ci
# end user can ignore
parser.add_argument('--ci', action='store_false')

if __name__ == '__main__':

args = parser.parse_args()

_clean()
_create_recording()

steps = [
('Import spikeinterface', check_import_si),
('Import spikeinterface.full', check_import_si_full),
('Run tridesclous', run_tridesclous),
('Open spikeinterface-gui', open_sigui),
('Export to phy', export_to_phy),
]

# backwards logic because default is True for end-user
if args.ci:
steps.insert(3, ('Open spikeinterface-gui', open_sigui) )

steps.append(('Export to phy', export_to_phy)),
# phy is removed from the env because it force a pip install PyQt5
# which break the conda env
# ('Open phy', open_phy),
]

if platform.system() == "Windows":
pass
Expand Down

0 comments on commit 8b31b33

Please sign in to comment.