Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update yaml files for installation + add a new one #2548

Merged
merged 6 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions installation_tips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ This environment will install:
* spikeinterface-gui
* phy
* tridesclous
* spyking-circus (not on mac)
* herdingspikes (not on windows)

Kilosort, Ironclust and HDSort are MATLAB based and need to be installed from source.
Klusta does not work anymore with python3.8 you should create a similar environment with python3.6.

### Quick installation

Steps:

1. Download anaconda individual edition [here](https://www.anaconda.com/products/individual)
1. Download anaconda individual edition [here](https://www.anaconda.com/download)
2. Run the installer. Check the box “Add anaconda3 to my Path environment variable”. It makes life easier for beginners.
3. Download with right click + save the file corresponding to your OS, and put it in "Documents" folder
* [`full_spikeinterface_environment_windows.yml`](https://raw.githubusercontent.com/SpikeInterface/spikeinterface/master/installation_tips/full_spikeinterface_environment_windows.yml)
Expand Down Expand Up @@ -64,3 +61,10 @@ This script tests the following:
* running herdingspikes (not on windows)
* opening the spikeinterface-gui
* exporting to Phy


## Installing before release

Some tools in the spikeinteface ecosystem are getting regular bug fixes (spikeinterface, spikeinterface-gui, probeinterface, python-neo, sortingview).
We are making releases 2 to 4 times a year. In between releases if you want to install from source you can use the `full_spikeinterface_environment_rolling_updates.yml` file to create the environment. This will install the packages of the ecosystem from source.
This is a good way to test if patch fix your issue.
76 changes: 45 additions & 31 deletions installation_tips/check_your_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,54 @@ def _create_recording():
rec.save(folder='./toy_example_recording')


def _run_one_sorter_and_exctract_wf(sorter_name):
def _run_one_sorter_and_analyzer(sorter_name):
job_kwargs = dict(n_jobs=-1, progress_bar=True, chunk_duration="1s")
import spikeinterface.full as si
rec = si.load_extractor('./toy_example_recording')
sorting = si.run_sorter(sorter_name, rec, output_folder=f'{sorter_name}_output', verbose=False)
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')
recording = si.load_extractor('./toy_example_recording')
sorting = si.run_sorter(sorter_name, recording, output_folder=f'./sorter_with_{sorter_name}', verbose=False)

sorting_analyzer = si.create_sorting_analyzer(sorting, recording,
format="binary_folder", folder=f"./analyzer_with_{sorter_name}",
**job_kwargs)
sorting_analyzer.compute("random_spikes", method="uniform", max_spikes_per_unit=500)
sorting_analyzer.compute("waveforms", **job_kwargs)
sorting_analyzer.compute("templates")
sorting_analyzer.compute("noise_levels")
sorting_analyzer.compute("unit_locations", method="monopolar_triangulation")
sorting_analyzer.compute("correlograms", window_ms=100, bin_ms=5.)
sorting_analyzer.compute("principal_components", n_components=3, mode='by_channel_global', whiten=True, **job_kwargs)
sorting_analyzer.compute("quality_metrics", metric_names=["snr", "firing_rate"])


def run_spykingcircus():
_run_one_sorter_and_exctract_wf('spykingcircus')
def run_tridesclous():
_run_one_sorter_and_analyzer('tridesclous')

def run_tridesclous2():
_run_one_sorter_and_analyzer('tridesclous2')

def run_herdingspikes():
_run_one_sorter_and_exctract_wf('herdingspikes')


def open_sigui():
import spikeinterface.full as si
import spikeinterface_gui
app = spikeinterface_gui.mkQApp()
waveform_forlder = 'tridesclous_waveforms'
we = si.WaveformExtractor.load_from_folder(waveform_forlder)
pc = si.compute_principal_components(we, n_components=3, mode='by_channel_local', whiten=True, dtype='float32')
win = spikeinterface_gui.MainWindow(we)

sorter_name = "tridesclous2"
folder = f"./analyzer_with_{sorter_name}"
analyzer = si.load_sorting_analyzer(folder)

win = spikeinterface_gui.MainWindow(analyzer)
win.show()
app.exec_()

def export_to_phy():
import spikeinterface.full as si
we = si.WaveformExtractor.load_from_folder("tridesclous_waveforms")
sorter_name = "tridesclous2"
folder = f"./analyzer_with_{sorter_name}"
analyzer = si.load_sorting_analyzer(folder)

phy_folder = "./phy_example"
si.export_to_phy(we, output_folder=phy_folder, verbose=False)
si.export_to_phy(analyzer, output_folder=phy_folder, verbose=False)


def open_phy():
Expand All @@ -61,10 +74,12 @@ def open_phy():
def _clean():
# clean
folders = [
'toy_example_recording',
"tridesclous_output", "tridesclous_waveforms",
"spykingcircus_output", "spykingcircus_waveforms",
"phy_example"
"./toy_example_recording",
"./sorter_with_tridesclous",
"./analyzer_with_tridesclous",
"./sorter_with_tridesclous2",
"./analyzer_with_tridesclous2",
"./phy_example"
]
for folder in folders:
if Path(folder).exists():
Expand All @@ -86,25 +101,24 @@ def _clean():
('Import spikeinterface', check_import_si),
('Import spikeinterface.full', check_import_si_full),
('Run tridesclous', run_tridesclous),
('Run tridesclous2', run_tridesclous2),
]

# backwards logic because default is True for end-user
if args.ci:
steps.insert(3, ('Open spikeinterface-gui', open_sigui) )
steps.append(('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
# steps.insert(3, ('Run spykingcircus', run_spykingcircus))
elif platform.system() == "Darwin":
steps.insert(3, ('Run herdingspikes', run_herdingspikes))
else:
steps.insert(3, ('Run spykingcircus', run_spykingcircus))
steps.insert(4, ('Run herdingspikes', run_herdingspikes))
# if platform.system() == "Windows":
# pass
# elif platform.system() == "Darwin":
# pass
# else:
# pass

for label, func in steps:
try:
Expand Down
28 changes: 13 additions & 15 deletions installation_tips/full_spikeinterface_environment_linux_dandi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,35 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.10
- pip>=21.0
- mamba
- numpy<1.22
- python=3.11
- pip
- numpy
- scipy
- joblib
- tqdm
- matplotlib
- h5py
- pandas
- xarray
- zarr
- scikit-learn
- hdbscan
- networkx
- pybind11
- loky
- hdbscan
- numba
- jupyter
- mpi4py
- cxx-compiler
- libxcb
- pyqt=5
- pyqtgraph
- htop
- ipywidgets
- ipympl
- htop
- cxx-compiler
- libxcb
- pip:
- ephyviewer
- neo>=0.12
- probeinterface>=0.2.11
- MEArec>=1.8
- spikeinterface[full, widgets]
- MEArec
- spikeinterface[full,widgets]
- spikeinterface-gui
- tridesclous>=1.6.8
- spyking-circus>=1.1.0
- tridesclous
# - phy==2.0b5
25 changes: 10 additions & 15 deletions installation_tips/full_spikeinterface_environment_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,32 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.10
- pip>=21.0
- python=3.11
- pip
- numpy
- scipy
- joblib
- tqdm
- matplotlib
- h5py
- pandas
- xarray
- zarr
- scikit-learn
- hdbscan
- networkx
- pybind11
- loky
- hdbscan
- numba
# - jupyter
- mpi
- mpi4py
- compilers
- jupyter
- pyqt=5
- pyqtgraph
- ipywidgets
- ipympl
- pip:
# - PyQt5
- ephyviewer
- neo>=0.12
- probeinterface>=0.2.11
- MEArec>=1.8
- spikeinterface[full, widgets]
- MEArec
- spikeinterface[full,widgets]
- spikeinterface-gui
- tridesclous>=1.6.8
- tridesclous
# - phy==2.0b5
# - mountainsort4>=1.0.0 isosplit5 fails on pip install for mac
# - mountainsort5>=0.3.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: si_env_rolling
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- pip
- numpy
- scipy
- joblib
- tqdm
- matplotlib
- h5py
- pandas
- xarray
- hdbscan
- scikit-learn
- networkx
- pybind11
- loky
- numba
- jupyter
- pyqt=5
- pyqtgraph
- ipywidgets
- ipympl
- pip:
- ephyviewer
- docker
- https://github.com/SpikeInterface/MEArec/archive/main.zip
- https://github.com/NeuralEnsemble/python-neo/archive/master.zip
- https://github.com/SpikeInterface/probeinterface/archive/main.zip
- https://github.com/SpikeInterface/spikeinterface/archive/main.zip
- https://github.com/SpikeInterface/spikeinterface-gui/archive/main.zip
- https://github.com/magland/sortingview/archive/main.zip
18 changes: 9 additions & 9 deletions installation_tips/full_spikeinterface_environment_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.10
- pip>=21.0
# numpy 1.21 break numba which break tridesclous
- python=3.11
- pip
- numpy
- scipy
- joblib
- tqdm
- matplotlib
- h5py
- pandas
- xarray
- zarr
- scikit-learn
- hdbscan
- networkx
- pybind11
- loky
- hdbscan
- numba
- jupyter
- pyqt=5
Expand All @@ -25,10 +27,8 @@ dependencies:
- ipympl
- pip:
- ephyviewer
- neo>=0.12
- probeinterface>=0.2.11
- MEArec>=1.8
- spikeinterface[full, widgets]
- MEArec
- spikeinterface[full,widgets]
- spikeinterface-gui
- tridesclous>=1.6.8
- tridesclous
# - phy==2.0b5
Loading