neuroinformatics-unit / spikewrap

A tool to streamline extracellular electrophysiology analysis using SpikeInterface
BSD 3-Clause "New" or "Revised" License
13 stars 0 forks source link

Things to Document #22

Open JoeZiminski opened 1 year ago

JoeZiminski commented 1 year ago
JoeZiminski commented 1 year ago

make sure all pubic / private methods and attributes are labelled correctly.

JoeZiminski commented 1 year ago

Some errors occur frequently, document their fixes here, in time open PRs where relevant to expand exception messagesa:

loops error with singularity - https://docs.sylabs.io/guides/3.5/admin-guide/configfiles.html KeyError: 'snsMnMaXaDw' is error when ...'exported' is in the name! stream_name in [] error is whever the path does not exist

when something is wrong in docker download when singularity=True, sovled by using pre-downloadd image, but I dont really know why this is happening, the image is never downloaded:

  File "/ceph/neuroinformatics/neuroinformatics/scratch/jziminski/ephys/code/spikeinterface_0.98.2/src/spikeinterface/sorters/runsorter.py", line 487, in run_sorter_container
    container_client = ContainerClient(mode, container_image, volumes, py_user_base_unix, extra_kwargs)
  File "/ceph/neuroinformatics/neuroinformatics/scratch/jziminski/ephys/code/spikeinterface_0.98.2/src/spikeinterface/sorters/runsorter.py", line 276, in __init__
    docker_image = self._get_docker_image(container_image)
  File "/ceph/neuroinformatics/neuroinformatics/scratch/jziminski/ephys/code/spikeinterface_0.98.2/src/spikeinterface/sorters/runsorter.py", line 301, in _get_docker_image
    docker_client = docker.from_env(timeout=300)
  File "/nfs/nhome/live/jziminski/.conda/envs/spikewrap/lib/python3.10/site-packages/docker/client.py", line 96, in from_env
    return cls(
  File "/nfs/nhome/live/jziminski/.conda/envs/spikewrap/lib/python3.10/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "/nfs/nhome/live/jziminski/.conda/envs/spikewrap/lib/python3.10/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/nfs/nhome/live/jziminski/.conda/envs/spikewrap/lib/python3.10/site-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

if docker python is installed then SI will try to use docker even if docker itself is not installed / if singularity is installed. This leads to a confusing FileNotFound error that docker throws. https://stackoverflow.com/questions/64952238/docker-errors-dockerexception-error-while-fetching-server-api-version

JoeZiminski commented 1 year ago

if hitting loop devices on the cluster (where no sudo), you need to remove existing instances singularity instance list singularity instance stop <instance_name>

JoeZiminski commented 1 year ago

Some notes:

JoeZiminski commented 1 year ago

how slurm options work / default hpc configs

JoeZiminski commented 1 year ago

https://neuroinformatics.zulipchat.com/.

JoeZiminski commented 1 year ago

and a sentence about providing support

JoeZiminski commented 1 year ago

installing images for HPC, what to do when updating a new version.

JoeZiminski commented 1 year ago

Corrupted .sif, I think this is simila to the loop devices issue (?)

Running `run_sorting`. The function was called with the arguments {'base_path': PosixPath('/ceph/margrie/slenzi/2023/probe/raw/ts_experiments'), 'sub_name': 'sub-005_id-1120923', 'sessions_and_runs': {'ses-001_type-pretest': ['run-001_1120923_pre_g0_imec0']}, 'sorter': 'kilosort2_5', 'concatenate_sessions': False, 'concatenate_runs': False, 'sorter_options': None, 'existing_sorting_output': 'overwrite', 'slurm_batch': False}.

Singularity is installed. Sorters such as Kilosort that
cannot be run in native Python will run in a virtual machine.

Starting kilosort2_5 sorting...

Sorting session: ses-001_type-pretest
run: ses-001_type-pretest...
Starting container
spikeinterface is already installed in /nfs/nhome/live/slenzi/.spikewrap/sorter_images/kilosort2_5-compiled-base.sif
Running kilosort2_5 sorter inside /nfs/nhome/live/slenzi/.spikewrap/sorter_images/kilosort2_5-compiled-base.sif
Stopping container
Traceback (most recent call last):
  File "/nfs/nhome/live/slenzi/code/swc_ephys/./spikewrap/examples/1120923.py", line 61, in <module>
run_sorting(
  File "/nfs/nhome/live/slenzi/code/swc_ephys/spikewrap/pipeline/sort.py", line 140, in run_sorting
run_sorting_on_all_runs(
  File "/nfs/nhome/live/slenzi/code/swc_ephys/spikewrap/pipeline/sort.py", line 249, in run_sorting_on_all_runs
ss.run_sorter(
  File "/nfs/nhome/live/slenzi/.conda/envs/spikewrap/lib/python3.10/site-packages/spikeinterface/sorters/runsorter.py", line 142, in run_sorter
return run_sorter_container(
  File "/nfs/nhome/live/slenzi/.conda/envs/spikewrap/lib/python3.10/site-packages/spikeinterface/sorters/runsorter.py", line 595, 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:
FATAL:   no instance found with name doopy_salad_5995