-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c415c8
commit 92a90ed
Showing
2 changed files
with
359 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
# hybrid_template_library | ||
Library of templates to create hybrid data for spike sorting benchmarks | ||
|
||
[click here for access to the library](https://spikeinterface.github.io/hybrid_template_library/) | ||
|
||
How to run a python server | ||
|
||
## Testing locally | ||
|
||
How to run a python server for testing zarr access | ||
|
||
|
||
The following code makes use of the local python server to serve the zarr files. This is useful for testing the zarr files in the browser. You can run this code in the folder where your zarr files are to start the server and make the zarr files accessible in the browser. | ||
|
||
```python | ||
from http.server import HTTPServer, SimpleHTTPRequestHandler | ||
import sys | ||
|
||
class CORSHTTPRequestHandler(SimpleHTTPRequestHandler): | ||
def end_headers(self): | ||
self.send_header('Access-Control-Allow-Origin', '*') | ||
super().end_headers() | ||
|
||
def log_message(self, format, *args): | ||
sys.stderr.write("%s - - [%s] %s\n" % | ||
(self.client_address[0], | ||
self.log_date_time_string(), | ||
format % args)) | ||
|
||
httpd = HTTPServer(('localhost', 8000), CORSHTTPRequestHandler) | ||
httpd.serve_forever() | ||
|
||
``` | ||
|
||
Execute a script with this code in bash directly or save it to a file and run it with python. | ||
|
||
```bash | ||
python -m http.server | ||
python -c "from http.server import HTTPServer, SimpleHTTPRequestHandler; import sys; class CORSHTTPRequestHandler(SimpleHTTPRequestHandler): def end_headers(self): self.send_header('Access-Control-Allow-Origin', '*'); super().end_headers(); def log_message(self, format, *args): sys.stderr.write('%s - - [%s] %s\n' % (self.client_address[0], self.log_date_time_string(), format % args)); httpd = HTTPServer(('localhost', 8000), CORSHTTPRequestHandler); httpd.serve_forever()" | ||
``` | ||
|
||
|
||
|
327 changes: 327 additions & 0 deletions
327
notebooks/how_to_calculate_templates_from_dandisets.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.