Skip to content

Commit

Permalink
how to calculate templates
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed Apr 26, 2024
1 parent 6c415c8 commit 92a90ed
Show file tree
Hide file tree
Showing 2 changed files with 359 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
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 notebooks/how_to_calculate_templates_from_dandisets.ipynb

Large diffs are not rendered by default.

0 comments on commit 92a90ed

Please sign in to comment.