From 074fe8673935dcbfdb5c0514701d26c4e3323e6f Mon Sep 17 00:00:00 2001 From: luiz Date: Mon, 20 Jan 2025 16:08:20 +0100 Subject: [PATCH 1/5] env linux --- environments/environment-Linux.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/environments/environment-Linux.yml b/environments/environment-Linux.yml index 3d37525a5..a8376219e 100644 --- a/environments/environment-Linux.yml +++ b/environments/environment-Linux.yml @@ -1,4 +1,4 @@ -name: nwb-guide +name: nwb-guide-2 channels: - conda-forge - defaults @@ -17,9 +17,9 @@ dependencies: - flask_restx == 1.1.0 - werkzeug < 3.0 # werkzeug 3.0 deprecates features used by flask 2.3.2. Remove this when updating flask. # For stability, NeuroConv is pinned at a commit just prior to breaking SpikeInterface compatibility - - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@fa636458aa5c321f1c2c08f6e682b4a52d5a83f3#neuroconv[dandi,compressors,ecephys,ophys,behavior,text] + - neuroconv[full] == 0.6.6 # For stability, pinning SpikeInterface to a version that works with NeuroConv and with tutorial generation - - spikeinterface == 0.100.5 + - spikeinterface >= 0.101.0 - scikit-learn == 1.4.0 # Tutorial data generation - tqdm_publisher >= 0.0.1 # Progress bars - tzlocal >= 5.2 # Frontend timezone handling From 0b4a5ad27808086be58e58be72d6edb65fa4ae38 Mon Sep 17 00:00:00 2001 From: luiz Date: Tue, 21 Jan 2025 16:26:16 +0100 Subject: [PATCH 2/5] use sorting analyzer --- src/pyflask/manageNeuroconv/manage_neuroconv.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pyflask/manageNeuroconv/manage_neuroconv.py b/src/pyflask/manageNeuroconv/manage_neuroconv.py index 391f5b462..5385efcf9 100644 --- a/src/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/src/pyflask/manageNeuroconv/manage_neuroconv.py @@ -1726,12 +1726,19 @@ def generate_test_data(output_path: str): io.write(lf_meta_content) # Make Phy folder - waveform_extractor = spikeinterface.extract_waveforms( - recording=artificial_ap_band_in_uV, sorting=spiking, mode="memory" + sorting_analyzer = si.create_sorting_analyzer( + recording=artificial_ap_band_in_uV, + sorting=spiking, ) + sorting_analyzer.compute(['random_spikes', 'waveforms', 'templates', 'noise_levels']) + _ = sorting_analyzer.compute('spike_amplitudes') + _ = sorting_analyzer.compute('principal_components', n_components = 5, mode="by_channel_local") export_to_phy( - waveform_extractor=waveform_extractor, output_folder=phy_output_folder, remove_if_exists=True, copy_binary=False + sorting_analyzer=sorting_analyzer, + output_folder=phy_output_folder, + remove_if_exists=True, + copy_binary=False, ) From fb8e7d11cfeedcfe401ee30b099b8f443ef2c6f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:27:11 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pyflask/manageNeuroconv/manage_neuroconv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pyflask/manageNeuroconv/manage_neuroconv.py b/src/pyflask/manageNeuroconv/manage_neuroconv.py index 5385efcf9..b79bc9642 100644 --- a/src/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/src/pyflask/manageNeuroconv/manage_neuroconv.py @@ -1730,9 +1730,9 @@ def generate_test_data(output_path: str): recording=artificial_ap_band_in_uV, sorting=spiking, ) - sorting_analyzer.compute(['random_spikes', 'waveforms', 'templates', 'noise_levels']) - _ = sorting_analyzer.compute('spike_amplitudes') - _ = sorting_analyzer.compute('principal_components', n_components = 5, mode="by_channel_local") + sorting_analyzer.compute(["random_spikes", "waveforms", "templates", "noise_levels"]) + _ = sorting_analyzer.compute("spike_amplitudes") + _ = sorting_analyzer.compute("principal_components", n_components=5, mode="by_channel_local") export_to_phy( sorting_analyzer=sorting_analyzer, From 7173cec20b57b559426e8846da9cbf94d2490659 Mon Sep 17 00:00:00 2001 From: luiz Date: Tue, 21 Jan 2025 16:34:01 +0100 Subject: [PATCH 4/5] import --- src/pyflask/manageNeuroconv/manage_neuroconv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyflask/manageNeuroconv/manage_neuroconv.py b/src/pyflask/manageNeuroconv/manage_neuroconv.py index 5385efcf9..20b872b0b 100644 --- a/src/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/src/pyflask/manageNeuroconv/manage_neuroconv.py @@ -1726,7 +1726,7 @@ def generate_test_data(output_path: str): io.write(lf_meta_content) # Make Phy folder - sorting_analyzer = si.create_sorting_analyzer( + sorting_analyzer = spikeinterface.create_sorting_analyzer( recording=artificial_ap_band_in_uV, sorting=spiking, ) From de9c7189bc5dc8cc29c92f51885430674af94c83 Mon Sep 17 00:00:00 2001 From: luiz Date: Tue, 21 Jan 2025 16:42:49 +0100 Subject: [PATCH 5/5] envs for other OS --- environments/environment-Linux.yml | 4 +--- environments/environment-MAC-apple-silicon.yml | 4 ++-- environments/environment-MAC-intel.yml | 6 ++---- environments/environment-Windows.yml | 6 ++---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/environments/environment-Linux.yml b/environments/environment-Linux.yml index a8376219e..16b777957 100644 --- a/environments/environment-Linux.yml +++ b/environments/environment-Linux.yml @@ -16,10 +16,8 @@ dependencies: - flask-cors == 4.0.0 - flask_restx == 1.1.0 - werkzeug < 3.0 # werkzeug 3.0 deprecates features used by flask 2.3.2. Remove this when updating flask. - # For stability, NeuroConv is pinned at a commit just prior to breaking SpikeInterface compatibility - neuroconv[full] == 0.6.6 - # For stability, pinning SpikeInterface to a version that works with NeuroConv and with tutorial generation - - spikeinterface >= 0.101.0 + - spikeinterface >= 0.101.2 - scikit-learn == 1.4.0 # Tutorial data generation - tqdm_publisher >= 0.0.1 # Progress bars - tzlocal >= 5.2 # Frontend timezone handling diff --git a/environments/environment-MAC-apple-silicon.yml b/environments/environment-MAC-apple-silicon.yml index d193ce791..1b93f3712 100644 --- a/environments/environment-MAC-apple-silicon.yml +++ b/environments/environment-MAC-apple-silicon.yml @@ -25,9 +25,9 @@ dependencies: # NOTE: the NeuroConv wheel on PyPI includes sonpy which is not compatible with arm64, so build and install # NeuroConv from GitHub, which will remove the sonpy dependency when building from Mac arm64 # For stability, NeuroConv is pinned at a commit just prior to breaking SpikeInterface compatibility - - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@fa636458aa5c321f1c2c08f6e682b4a52d5a83f3#neuroconv[dandi,compressors,ecephys,ophys,behavior,text] + - neuroconv[dandi,compressors,ecephys,ophys,behavior,text] == 0.6.6 # For stability, pinning SpikeInterface to a version that works with NeuroConv and with tutorial generation - - spikeinterface == 0.100.5 + - spikeinterface >= 0.101.2 - scikit-learn == 1.4.0 # Tutorial data generation - tqdm_publisher >= 0.0.1 # Progress bars - tzlocal >= 5.2 # Frontend timezone handling diff --git a/environments/environment-MAC-intel.yml b/environments/environment-MAC-intel.yml index 61d38320d..83de9cd7c 100644 --- a/environments/environment-MAC-intel.yml +++ b/environments/environment-MAC-intel.yml @@ -19,10 +19,8 @@ dependencies: - flask-cors == 4.0.0 - flask_restx == 1.1.0 - werkzeug < 3.0 # werkzeug 3.0 deprecates features used by flask 2.3.2. Remove this when updating flask. - # For stability, NeuroConv is pinned at a commit just prior to breaking SpikeInterface compatibility - - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@fa636458aa5c321f1c2c08f6e682b4a52d5a83f3#neuroconv[dandi,compressors,ecephys,ophys,behavior,text] - # For stability, pinning SpikeInterface to a version that works with NeuroConv and with tutorial generation - - spikeinterface == 0.100.5 + - neuroconv[dandi,compressors,ecephys,ophys,behavior,text] == 0.6.6 + - spikeinterface >= 0.101.2 - scikit-learn == 1.4.0 # Tutorial data generation - tqdm_publisher >= 0.0.1 # Progress bars - tzlocal >= 5.2 # Frontend timezone handling diff --git a/environments/environment-Windows.yml b/environments/environment-Windows.yml index b7d650661..b25d64c2b 100644 --- a/environments/environment-Windows.yml +++ b/environments/environment-Windows.yml @@ -19,10 +19,8 @@ dependencies: - flask-cors === 3.0.10 - flask_restx == 1.1.0 - werkzeug < 3.0 # werkzeug 3.0 deprecates features used by flask 2.3.2. Remove this when updating flask. - # For stability, NeuroConv is pinned at a commit just prior to breaking SpikeInterface compatibility - - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@fa636458aa5c321f1c2c08f6e682b4a52d5a83f3#neuroconv[dandi,compressors,ecephys,ophys,behavior,text] - # For stability, pinning SpikeInterface to a version that works with NeuroConv and with tutorial generation - - spikeinterface == 0.100.5 + - neuroconv[dandi,compressors,ecephys,ophys,behavior,text] == 0.6.6 + - spikeinterface >= 0.101.2 - scikit-learn == 1.4.0 # Tutorial data generation - tqdm_publisher >= 0.0.1 # Progress bars - tzlocal >= 5.2 # Frontend timezone handling