Skip to content

Instantly share code, notes, and snippets.

View rly's full-sized avatar

Ryan Ly rly

View GitHub Profile
@rly
rly / dandiset_000409_exploration.ipynb
Created March 26, 2025 20:11
Notebook saved from nbfiddle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rly
rly / dandiset_000409_exploration_no_explore.ipynb
Created March 26, 2025 19:41
Notebook saved from nbfiddle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rly
rly / dandiset_001174_exploration_1.ipynb
Created March 26, 2025 19:02
Notebook saved from nbfiddle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rly
rly / get_nwb_extension_names_versions.py
Created March 10, 2025 18:59
A Python function to extract specification names and versions from NWB files.
"""
A Python function to extract specification names and versions from NWB files.
Can be easily modified to extract only extensions. core, hdmf-common, hdmf-experimental are not extensions.
The script uses h5py to open the NWB file instead of PyNWB because it is faster.
"""
import h5py
from packaging import version
@rly
rly / compare_scipy_lfilter_vs_matlab_filter.ipynb
Created January 2, 2025 19:10
Demonstration of differences between filtering using MATLAB and Scipy (Python)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rly
rly / test_h5py_checksum.ipynb
Created September 18, 2024 03:08
Demonstration that modifying variable-length strings in an HDF5 file changes the bytes/checksum
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rly
rly / fix_dandiset_000776.py
Last active February 8, 2024 02:01
Script to fix invalid "order_optical_channels" group in NWB files in dandiset 000776
# In dandiset 000776, the data is invalid against the spec. See https://github.com/dandi/helpdesk/issues/126
# To fix the files in dandiset 000776, run this script on dandihub. This script performs the following data surgery
# steps:
#
# 1. Replace the "order_optical_channels" link from all `ImagingVolume` objects with a subgroup
# that is the link target (at /processing/NeuroPAL/OpticalChannelRefs)
# 2. Add the "ndx-multichannel-volume" version 0.1.12 schema
# 3. Remove the "ndx-multichannel-volume" version 0.1.9 schema
# 4. Remove the "order_optical_channels" group from all "MultiChannelVolume" objects
# 5. Remove the "OpticalChannelRefs" group within "/processing"
@rly
rly / remove_units_table.ipynb
Created January 16, 2024 19:28
Demonstration of how to remove the Units table from an NWB file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rly
rly / measure_hdf5_group_overhead.ipynb
Created January 5, 2024 22:10
Measure the space overhead of creating many HDF5 groups
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.