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

Fixes Apptainer bug plus small fixes #2053

Merged
merged 11 commits into from
Oct 2, 2023
2 changes: 1 addition & 1 deletion src/spikeinterface/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def dump_to_pickle(
Parameters
----------
file_path: str
Path of the json file
Path of the pickle file
include_properties: bool
If True, all properties are dumped
folder_metadata: str, Path, or None
Expand Down
8 changes: 6 additions & 2 deletions src/spikeinterface/extractors/mdaextractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,14 @@ def write_sorting(sorting, save_path, write_primary_channels=False):
times_list = []
labels_list = []
primary_channels_list = []
for unit_id in unit_ids:
for unit_index, unit_id in enumerate(unit_ids):
times = sorting.get_unit_spike_train(unit_id=unit_id)
times_list.append(times)
labels_list.append(np.ones(times.shape) * unit_id)
# unit id may not be numeric
if unit_id.dtype.kind in "iu":
labels_list.append(np.ones(times.shape, dtype=unit_id.dtype) * unit_id)
else:
labels_list.append(np.ones(times.shape, dtype=int) * unit_index)
if write_primary_channels:
if "max_channel" in sorting.get_unit_property_names(unit_id):
primary_channels_list.append([sorting.get_unit_property(unit_id, "max_channel")] * times.shape[0])
Expand Down
10 changes: 5 additions & 5 deletions src/spikeinterface/sorters/runsorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,19 +514,19 @@ def run_sorter_container(
res_output = container_client.run_command(cmd)
cmd = f"cp -r {si_dev_path_unix} {si_source_folder}"
res_output = container_client.run_command(cmd)
cmd = f"pip install {si_source_folder}/spikeinterface[full]"
cmd = f"pip install --user {si_source_folder}/spikeinterface[full]"
else:
si_source = "remote repository"
cmd = "pip install --upgrade --no-input git+https://github.com/SpikeInterface/spikeinterface.git#egg=spikeinterface[full]"
cmd = "pip install --user --upgrade --no-input git+https://github.com/SpikeInterface/spikeinterface.git#egg=spikeinterface[full]"
if verbose:
print(f"Installing dev spikeinterface from {si_source}")
res_output = container_client.run_command(cmd)
cmd = "pip install --upgrade --no-input https://github.com/NeuralEnsemble/python-neo/archive/master.zip"
cmd = "pip install --user --upgrade --no-input https://github.com/NeuralEnsemble/python-neo/archive/master.zip"
res_output = container_client.run_command(cmd)
else:
if verbose:
print(f"Installing spikeinterface=={si_version} in {container_image}")
cmd = f"pip install --upgrade --no-input spikeinterface[full]=={si_version}"
cmd = f"pip install --user --upgrade --no-input spikeinterface[full]=={si_version}"
res_output = container_client.run_command(cmd)
else:
# TODO version checking
Expand All @@ -540,7 +540,7 @@ def run_sorter_container(
if extra_requirements:
if verbose:
print(f"Installing extra requirements: {extra_requirements}")
cmd = f"pip install --upgrade --no-input {' '.join(extra_requirements)}"
cmd = f"pip install --user --upgrade --no-input {' '.join(extra_requirements)}"
res_output = container_client.run_command(cmd)

# run sorter on folder
Expand Down