From 2fbc71d1ea06895219f2c1fb02f08020c4e6f9cb Mon Sep 17 00:00:00 2001 From: Benjamin Dichter Date: Wed, 11 Nov 2026 22:06:26 -0500 Subject: [PATCH] Adapt the 001636 and 001754 notebooks to the re-converted files The October re-uploads of 001636 use NWB core 2.11, so the 001636 group moves from pynwb 3.1.3 to 4.2.0 (hdmf 4.3.1 to 6.2.0). The re-converted 001754 file renamed the rate_maps columns (session_type -> epoch_name, cell_number -> cluster_id) and stores unvisited bins as NaN, so the rate map lookup uses the new names and drops the -900 sentinel handling. The notebooks read "draft" until a release with these files is published. Co-Authored-By: Claude Opus 5.5 --- .../antidromic_detection_tutorial.ipynb | 6 +++--- 001636/TurnerLab/motor_cortex/requirements.in | 4 ++-- 001636/TurnerLab/motor_cortex/turner_m1_glm.ipynb | 6 +++--- 001636/TurnerLab/motor_cortex/turner_m1_peth.ipynb | 6 +++--- 001636/TurnerLab/motor_cortex/turner_m1_usage.ipynb | 6 +++--- 001754/CatalystNeuro/001754_demo.ipynb | 13 ++++++------- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/001636/TurnerLab/motor_cortex/antidromic_detection_tutorial.ipynb b/001636/TurnerLab/motor_cortex/antidromic_detection_tutorial.ipynb index e9cc70d3..52d1ada2 100644 --- a/001636/TurnerLab/motor_cortex/antidromic_detection_tutorial.ipynb +++ b/001636/TurnerLab/motor_cortex/antidromic_detection_tutorial.ipynb @@ -70,7 +70,7 @@ " \"fsspec==2025.12.0\" \\\n", " \"google-crc32c==1.8.0\" \\\n", " \"h5py==3.16.0\" \\\n", - " \"hdmf==4.3.1\" \\\n", + " \"hdmf==6.2.0\" \\\n", " \"humanize==4.16.0\" \\\n", " \"idna==3.19\" \\\n", " \"interleave==0.3.0\" \\\n", @@ -120,7 +120,7 @@ " \"pydantic-settings==2.15.0\" \\\n", " \"pygments==2.21.0\" \\\n", " \"pynapple==0.10.3\" \\\n", - " \"pynwb==3.1.3\" \\\n", + " \"pynwb==4.2.0\" \\\n", " \"pyout==0.8.1\" \\\n", " \"pyparsing==3.3.2\" \\\n", " \"python-dateutil==2.9.0.post0\" \\\n", @@ -280,7 +280,7 @@ "\n", "# Connect to DANDI and get the dandiset\n", "dandiset_id = \"001636\"\n", - "dandiset_version = \"0.260518.1819\" # published version; \"draft\" changes without notice\n", + "dandiset_version = \"draft\" # TODO: set to the release with the re-converted files\n", "client = DandiAPIClient()\n", "dandiset = client.get_dandiset(dandiset_id, dandiset_version)\n", "\n", diff --git a/001636/TurnerLab/motor_cortex/requirements.in b/001636/TurnerLab/motor_cortex/requirements.in index 37bc7141..98463515 100644 --- a/001636/TurnerLab/motor_cortex/requirements.in +++ b/001636/TurnerLab/motor_cortex/requirements.in @@ -9,8 +9,8 @@ pynapple pynwb remfile scipy -pynwb<4 -hdmf<5 +# The re-uploaded files use NWB core 2.11 (ndx-hed 0.3 extends DurationVectorData) +pynwb>=4.2 pynapple<0.11 nemos<0.2.7 optimistix<0.1 diff --git a/001636/TurnerLab/motor_cortex/turner_m1_glm.ipynb b/001636/TurnerLab/motor_cortex/turner_m1_glm.ipynb index d865823c..201275d2 100644 --- a/001636/TurnerLab/motor_cortex/turner_m1_glm.ipynb +++ b/001636/TurnerLab/motor_cortex/turner_m1_glm.ipynb @@ -70,7 +70,7 @@ " \"fsspec==2025.12.0\" \\\n", " \"google-crc32c==1.8.0\" \\\n", " \"h5py==3.16.0\" \\\n", - " \"hdmf==4.3.1\" \\\n", + " \"hdmf==6.2.0\" \\\n", " \"humanize==4.16.0\" \\\n", " \"idna==3.19\" \\\n", " \"interleave==0.3.0\" \\\n", @@ -120,7 +120,7 @@ " \"pydantic-settings==2.15.0\" \\\n", " \"pygments==2.21.0\" \\\n", " \"pynapple==0.10.3\" \\\n", - " \"pynwb==3.1.3\" \\\n", + " \"pynwb==4.2.0\" \\\n", " \"pyout==0.8.1\" \\\n", " \"pyparsing==3.3.2\" \\\n", " \"python-dateutil==2.9.0.post0\" \\\n", @@ -227,7 +227,7 @@ "\n", "# Stream NWB file from DANDI\n", "dandiset_id = \"001636\"\n", - "dandiset_version = \"0.260518.1819\" # published version; \"draft\" changes without notice\n", + "dandiset_version = \"draft\" # TODO: set to the release with the re-converted files\n", "session_id = \"Venus++v2703++PreMPTP++Depth19880um++19990607\"\n", "\n", "client = DandiAPIClient()\n", diff --git a/001636/TurnerLab/motor_cortex/turner_m1_peth.ipynb b/001636/TurnerLab/motor_cortex/turner_m1_peth.ipynb index b5b6c668..16bfccd0 100644 --- a/001636/TurnerLab/motor_cortex/turner_m1_peth.ipynb +++ b/001636/TurnerLab/motor_cortex/turner_m1_peth.ipynb @@ -70,7 +70,7 @@ " \"fsspec==2025.12.0\" \\\n", " \"google-crc32c==1.8.0\" \\\n", " \"h5py==3.16.0\" \\\n", - " \"hdmf==4.3.1\" \\\n", + " \"hdmf==6.2.0\" \\\n", " \"humanize==4.16.0\" \\\n", " \"idna==3.19\" \\\n", " \"interleave==0.3.0\" \\\n", @@ -120,7 +120,7 @@ " \"pydantic-settings==2.15.0\" \\\n", " \"pygments==2.21.0\" \\\n", " \"pynapple==0.10.3\" \\\n", - " \"pynwb==3.1.3\" \\\n", + " \"pynwb==4.2.0\" \\\n", " \"pyout==0.8.1\" \\\n", " \"pyparsing==3.3.2\" \\\n", " \"python-dateutil==2.9.0.post0\" \\\n", @@ -209,7 +209,7 @@ "\n", "# Stream NWB file from DANDI\n", "dandiset_id = \"001636\"\n", - "dandiset_version = \"0.260518.1819\" # published version; \"draft\" changes without notice\n", + "dandiset_version = \"draft\" # TODO: set to the release with the re-converted files\n", "session_id = \"Venus++v4529++PostMPTP++Depth20600um++20000127\"\n", "\n", "client = DandiAPIClient()\n", diff --git a/001636/TurnerLab/motor_cortex/turner_m1_usage.ipynb b/001636/TurnerLab/motor_cortex/turner_m1_usage.ipynb index 89733485..7d1b38eb 100644 --- a/001636/TurnerLab/motor_cortex/turner_m1_usage.ipynb +++ b/001636/TurnerLab/motor_cortex/turner_m1_usage.ipynb @@ -70,7 +70,7 @@ " \"fsspec==2025.12.0\" \\\n", " \"google-crc32c==1.8.0\" \\\n", " \"h5py==3.16.0\" \\\n", - " \"hdmf==4.3.1\" \\\n", + " \"hdmf==6.2.0\" \\\n", " \"humanize==4.16.0\" \\\n", " \"idna==3.19\" \\\n", " \"interleave==0.3.0\" \\\n", @@ -120,7 +120,7 @@ " \"pydantic-settings==2.15.0\" \\\n", " \"pygments==2.21.0\" \\\n", " \"pynapple==0.10.3\" \\\n", - " \"pynwb==3.1.3\" \\\n", + " \"pynwb==4.2.0\" \\\n", " \"pyout==0.8.1\" \\\n", " \"pyparsing==3.3.2\" \\\n", " \"python-dateutil==2.9.0.post0\" \\\n", @@ -227,7 +227,7 @@ "\n", "# Connect to DANDI and get the dandiset\n", "dandiset_id = \"001636\"\n", - "dandiset_version = \"0.260518.1819\" # published version; \"draft\" changes without notice\n", + "dandiset_version = \"draft\" # TODO: set to the release with the re-converted files\n", "client = DandiAPIClient()\n", "dandiset = client.get_dandiset(dandiset_id, dandiset_version)\n", "\n", diff --git a/001754/CatalystNeuro/001754_demo.ipynb b/001754/CatalystNeuro/001754_demo.ipynb index 15c9effa..f64a907c 100644 --- a/001754/CatalystNeuro/001754_demo.ipynb +++ b/001754/CatalystNeuro/001754_demo.ipynb @@ -267,7 +267,7 @@ "source": [ "# List all NWB files in the dandiset\n", "dandiset_id = \"001754\"\n", - "dandiset_version = \"0.260728.1352\" # published version; \"draft\" changes without notice\n", + "dandiset_version = \"draft\" # TODO: set to the release with the re-converted files\n", "\n", "with DandiAPIClient() as client:\n", " dandiset = client.get_dandiset(dandiset_id, dandiset_version)\n", @@ -806,14 +806,13 @@ "print(f\"Rate maps table: {len(rm_table)} entries\")\n", "print(f\"Columns: {rm_table.colnames}\")\n", "\n", - "# Build a lookup: (tetrode, cell_number) → pre-computed ES rate map\n", + "# Build a lookup: (tetrode, cluster_id) → pre-computed ES rate map\n", "precomputed_es = {}\n", "for i in range(len(rm_table)):\n", - " if rm_table[\"session_type\"][i] == \"ES\" and rm_table[\"cell_number\"][i] > 0:\n", - " key = (rm_table[\"tetrode\"][i], rm_table[\"cell_number\"][i])\n", - " rm = rm_table[\"rate_map\"][i].copy().astype(float)\n", - " rm[rm < -900] = np.nan # sentinel value for unvisited bins\n", - " precomputed_es[key] = rm\n", + " if rm_table[\"epoch_name\"][i] == \"ES\":\n", + " key = (rm_table[\"tetrode\"][i], rm_table[\"cluster_id\"][i])\n", + " # Unvisited bins are stored as NaN\n", + " precomputed_es[key] = rm_table[\"rate_map\"][i].astype(float)\n", "\n", "print(f\"Pre-computed ES rate maps: {len(precomputed_es)} cells\")" ]