This file contains hidden or 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
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from typing import List, Optional | |
| def grouped_barplot( | |
| data, | |
| clabels: List[str], | |
| xlabels: List[str], |
This file contains hidden or 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
| from itertools import chain, repeat | |
| from bisect import bisect_left | |
| from datetime import datetime, timedelta | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| data = [ | |
| { |
This file contains hidden or 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
| # first run: | |
| # | |
| #!git log --all --numstat --pretty=format:'--%h--%ad--%aN' --no-renames > git.log | |
| import datetime | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| from pprint import pprint | |
| import matplotlib.ticker |
This file contains hidden or 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
| 2022-06-01 11:34:17,098 [ INFO] Logs saved in /Users/bendichter/Library/Logs/dandi-cli/20220601153356Z-59646.log | |
| (base) MacBook-Pro-3:~ bendichter$ dandi download https://dandiarchive.org/dandisets/000053/versions/"draft"/assets/?path="sub-npJ3/sub-npJ3_ses-20190504_behavior.nwb" | |
| (base) MacBook-Pro-3:~ bendichter$ | |
| (base) MacBook-Pro-3:~ bendichter$ | |
| (base) MacBook-Pro-3:~ bendichter$ | |
| (base) MacBook-Pro-3:~ bendichter$ dandi download https://dandiarchive.org/dandisets/000053/versions/"draft"/assets/?path="sub-npJ3/sub-npJ3_ses-20190504_behavior.nwb" | |
| (base) MacBook-Pro-3:~ bendichter$ | |
| (base) MacBook-Pro-3:~ bendichter$ cat /Users/bendichter/Library/Logs/dandi-cli/20220601153356Z-59646.log | |
| 2022-06-01T11:33:56-0400 [INFO ] dandi 59646:8602854912 dandi v0.40.0, hdmf v3.2.1, pynwb v2.0.1, h5py v3.1.0 | |
| 2022-06-01T11:33:56-0400 [INFO ] dandi 59646:8602854912 sys.argv = ['/Users/bendichter/opt/miniconda3/bin/dandi', 'download', 'https://dandiarchive.org/dandisets/000053/versions/draft/assets/?path=sub-npJ3/ |
This file contains hidden or 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
| import h5py | |
| def print_group(group: h5py.Group): | |
| name = group.name.split('/')[-1] | |
| return f"{name} ({len(group.keys())} objects)/" | |
| def print_dataset(dataset: h5py.Dataset): | |
| name = dataset.name.split('/')[-1] | |
| return f"{name} {dataset.shape}, {dataset.dtype}" |
This file contains hidden or 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
| from jinja2 import Template | |
| _str = """## Converting data to NWB | |
| Below is a collection of simple conversion scripts that are all tested against small | |
| proprietary examples files. They are all optimized to handle very large data by iteratively | |
| steping through large files and read/writing them one piece at a time. They also leverage | |
| lossless compression within HDF5, which allows you to make large datasets smaller without | |
| losing any data. We have seen this reduce large datasets by up to 66%! | |
| {% for modality_name, modality_value in _dict.items() %} |
This file contains hidden or 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
| ## set up env via bash: | |
| conda create -n stream_nwb -c conda-forge -y python=3.7 hdf5=1.12.0 jupyter pip | |
| conda activate stream_nwb | |
| pip install nwbwidgets | |
| pip install git+https://github.com/NeurodataWithoutBorders/pynwb | |
| pip install git+https://github.com/hdmf-dev/hdmf | |
| git clone https://github.com/satra/h5py.git | |
| cd h5py | |
| HDF5_DIR=~/Users/bendichter/opt/anaconda3/envs/stream_nwb/ pip install --force-reinstall --no-binary=h5py . |
This file contains hidden or 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
| from datetime import datetime, timedelta | |
| import plotly.graph_objs as go | |
| from plotly.subplots import make_subplots | |
| import numpy as np | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import dash | |
| def discrete_colorscale(bvals, colors): | |
| """ |
This file contains hidden or 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
| from datetime import datetime, timedelta | |
| import plotly.graph_objs as go | |
| import numpy as np | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import dash | |
| def display_eletrode_turns(all_turn_data): | |
| """ |