mhhennig / HS2

Software for high density electrophysiology
GNU General Public License v3.0
26 stars 17 forks source link

Issue using tutorial jupyter notebook (localised_spikes_clustered-biocam) #71

Closed GrimmSnark closed 1 year ago

GrimmSnark commented 1 year ago

Hello,

I am trying to play around with herding spikes installed in a conda enviroment alongside spike interface. But when I try and run the first cell of the localised_spikes_clustered-biocam.ipynb file I get the following error:

Downloading data file - around 8GB, so this may take a while, patience...
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Cell In[3], line 10
      8 handler = urllib.request.HTTPBasicAuthHandler(password_mgr)
      9 opener = urllib.request.build_opener(handler)
---> 10 opener.open(file_url)
     11 urllib.request.install_opener(opener)
     12 with urllib.request.urlopen(file_url) as response, open('biocam_data.brw', 'wb') as out_file:

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
    523 for processor in self.process_response.get(protocol, []):
    524     meth = getattr(processor, meth_name)
--> 525     response = meth(req, response)
    527 return response

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
    631 # According to RFC 2616, "2xx" code indicates that the client's
    632 # request was successfully received, understood, and accepted.
    633 if not (200 <= code < 300):
--> 634     response = self.parent.error(
    635         'http', request, response, code, msg, hdrs)
    637 return response

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:557, in OpenerDirector.error(self, proto, *args)
    555     http_err = 0
    556 args = (dict, proto, meth_name) + args
--> 557 result = self._call_chain(*args)
    558 if result:
    559     return result

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
    494 for handler in handlers:
    495     func = getattr(handler, meth_name)
--> 496     result = func(*args)
    497     if result is not None:
    498         return result

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:1056, in HTTPBasicAuthHandler.http_error_401(self, req, fp, code, msg, headers)
   1054 def http_error_401(self, req, fp, code, msg, headers):
   1055     url = req.full_url
-> 1056     response = self.http_error_auth_reqed('www-authenticate',
   1057                                       url, req, headers)
   1058     return response

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:1005, in AbstractBasicAuthHandler.http_error_auth_reqed(self, authreq, host, req, headers)
    999             continue
   1001         if realm is not None:
   1002             # Use the first matching Basic challenge.
   1003             # Ignore following challenges even if they use the Basic
   1004             # scheme.
-> 1005             return self.retry_http_basic_auth(host, req, realm)
   1007 if unsupported is not None:
   1008     raise ValueError("AbstractBasicAuthHandler does not "
   1009                      "support the following scheme: %r"
   1010                      % (scheme,))

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:1020, in AbstractBasicAuthHandler.retry_http_basic_auth(self, host, req, realm)
   1018         return None
   1019     req.add_unredirected_header(self.auth_header, auth)
-> 1020     return self.parent.open(req, timeout=req.timeout)
   1021 else:
   1022     return None

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
    523 for processor in self.process_response.get(protocol, []):
    524     meth = getattr(processor, meth_name)
--> 525     response = meth(req, response)
    527 return response

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
    631 # According to RFC 2616, "2xx" code indicates that the client's
    632 # request was successfully received, understood, and accepted.
    633 if not (200 <= code < 300):
--> 634     response = self.parent.error(
    635         'http', request, response, code, msg, hdrs)
    637 return response

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:563, in OpenerDirector.error(self, proto, *args)
    561 if http_err:
    562     args = (dict, 'default', 'http_error_default') + orig_args
--> 563     return self._call_chain(*args)

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
    494 for handler in handlers:
    495     func = getattr(handler, meth_name)
--> 496     result = func(*args)
    497     if result is not None:
    498         return result

File D:\Anaconda\envs\spikeInterface\lib\urllib\request.py:643, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
    642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643     raise HTTPError(req.full_url, code, msg, hdrs, fp)

HTTPError: HTTP Error 401: Unauthorized

Any help would be greatly appreciated!

mhhennig commented 1 year ago

Apologies, this download location is no longer valid. You can now download the file here: https://dandiarchive.org/dandiset/000034/0.211030.0713/files?location=sub-P29-16-05-14-retina02-left It comes in nwb format, so can be read with SpikeInterface. To speed up spike sorting I recommend to convert it into a flat binary first.

GrimmSnark commented 1 year ago

Thanks a lot! I will do that now.