Skip to content

Added cleanup of temp files after Kilosort run - #1709

Merged
alejoe91 merged 5 commits into
SpikeInterface:mainfrom
DradeAW:kilosort_cleanup
Jun 8, 2023
Merged

alejoe91 merged 5 commits into
SpikeInterface:mainfrom
DradeAW:kilosort_cleanup

Conversation

@DradeAW

@DradeAW DradeAW commented Jun 8, 2023

Copy link
Copy Markdown
Contributor

Tested this: works for a local run but not when using container :/

Is this because I need to clear Singularity cache and rebuild?

@DradeAW

DradeAW commented Jun 8, 2023

Copy link
Copy Markdown
Contributor Author

So after clearing the cache for singularity and trying again:

The temporary files are still not deletd, and if I explicitly set ss.run_sorter("kilosort3", recording, "test/", delete_tmp_files=True, singularity_image=True), I get the following crash:

Traceback (most recent call last):
  File "/mnt/raid0/data/test_docker/test_docker.py", line 11, in <module>
    ss.run_sorter("kilosort3", recording, "test/", delete_tmp_files=True, singularity_image=True)
  File "/export/home1/users/nsr/wyngaard/dev/forked_repo/spikeinterface/src/spikeinterface/sorters/runsorter.py", line 135, in run_sorter
    return run_sorter_container(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/export/home1/users/nsr/wyngaard/dev/forked_repo/spikeinterface/src/spikeinterface/sorters/runsorter.py", line 585, in run_sorter_container
    raise SpikeSortingError(f"Spike sorting in {mode} failed with the following error:\n{run_sorter_output}")
spikeinterface.sorters.utils.misc.SpikeSortingError: Spike sorting in singularity failed with the following error:
Traceback (most recent call last):
  File "/mnt/raid0/data/test_docker/in_container_sorter_script.py", line 17, in <module>
    sorting = run_sorter_local(
  File "/mnt/raid0/data/test_docker/in_container_python_base/lib/python3.8/site-packages/spikeinterface/sorters/runsorter.py", line 165, in run_sorter_local
    SorterClass.set_params_to_folder(recording, output_folder, sorter_params, verbose)
  File "/mnt/raid0/data/test_docker/in_container_python_base/lib/python3.8/site-packages/spikeinterface/sorters/basesorter.py", line 176, in set_params_to_folder
    raise AttributeError("Bad parameters: " + str(bad_params))
AttributeError: Bad parameters: ['delete_tmp_files']

The same line without singularity_image=True works without a crash, and with expected behaviour.

@alejoe91 any idea?

@alejoe91

alejoe91 commented Jun 8, 2023

Copy link
Copy Markdown
Member

@DradeAW to use local changes in the container, just set this env variable:

export SPIKEINTERFACE_DEV_PATH="path-to-cloned-repo"

Then when running the container you should see: Installing dev spikeinterface from local machine

@DradeAW

DradeAW commented Jun 8, 2023

Copy link
Copy Markdown
Contributor Author

Ah you're right, I completely forgot about that!
This variable is set, but points to the main depo, not the forked one with the changes ^^

Then I guess this PR is ready to be merged (on my side at least)

@alejoe91

alejoe91 commented Jun 8, 2023

Copy link
Copy Markdown
Member

Can you test that it works in the container before merging? :)

@DradeAW

DradeAW commented Jun 8, 2023

Copy link
Copy Markdown
Contributor Author

I can confirm it works!

@alejoe91 alejoe91 added the sorters Related to sorters module label Jun 8, 2023
@alejoe91 alejoe91 added this to the 0.98.0 milestone Jun 8, 2023
@alejoe91
alejoe91 merged commit a6c4355 into SpikeInterface:main Jun 8, 2023
@DradeAW
DradeAW deleted the kilosort_cleanup branch June 8, 2023 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sorters Related to sorters module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants