Open JoeZiminski opened 1 year ago
make sure all pubic / private methods and attributes are labelled correctly.
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
if hitting loop devices on the cluster (where no sudo), you need to remove existing instances
singularity instance list
singularity instance stop <instance_name>
Some notes:
When visualising traces, if the time is too long, the number of pixels is insufficient to show all of the available spikes. For example, plotting even 2 seconds of NP2 recording is 60K samples, most screens have say ~2000 pixels. I do not know how the number of displayed pixels is determined. Nonetheless, if you extract say 2 s of a recording plot, then extract 2.01 s and plot, it can look completely different. This is because due to a change in the number of samples, a different subset of pixels are actually displyaed on the screen. This can make spikes appear / dissappear and is very confusing. Two solutions are 1) To visualsie small regions such that all pixels can be displayed 2) interpolate, in particular I read billinear with matplotlib will interpolate sufficiently to keep the display constant, though not sure about this. Nonetheless, even with interpolation, because the spikes are so narrow, it is possible to interpolate out a spike when visualising, so it not a perfect solution.
phase_shift
can change samples by +/- 1 depending on the length of the recording extracted. This essentially performs an interpolation and so this is probably a rounding error. However, with further preprocessing this can increase to a difference of +/- 3 and so introduce a maximum error of 6. It would be cool to remove this error because in theory the phase shift should be identical for all early samples in the recording when get_traces() is used for different length data.
how slurm options work / default hpc configs
and a sentence about providing support
installing images for HPC, what to do when updating a new version.
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