Skip to content

Commit

Permalink
Merge pull request #2053 from SpikeInterface/matthias
Browse files Browse the repository at this point in the history
Fixes Apptainer bug plus small fixes
  • Loading branch information
alejoe91 authored Oct 2, 2023
2 parents cb16ff8 + 5cefdac commit ca48f6b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
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

0 comments on commit ca48f6b

Please sign in to comment.