From b9b55754bae9621d452af36dc7a923e7c6a7dcd3 Mon Sep 17 00:00:00 2001 From: Ben Dichter Date: Wed, 13 May 2026 14:42:06 -0400 Subject: [PATCH] Fix curl missing --create-dirs for helper files in subdirectories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three notebooks fetch a helper .py file via curl into a subdirectory that doesn't exist yet on a fresh Colab runtime: 001075/001075_paper_figure_1d.ipynb -> utils_001075/ 000458/.../001_summarize_contents.ipynb -> helpers/ 000402/.../microns_nwb_coreg_notebook.ipynb -> ng_visualization/ `curl -o subdir/file.py URL` without --create-dirs fails silently when `subdir/` doesn't exist — and with -s (silent) you don't even see the error. The install cell appears to succeed, then the next cell hits 'ModuleNotFoundError: No module named helpers' (or similar). Adding --create-dirs makes curl mkdir -p the parent first. User report from a Colab run of 001_summarize_contents.ipynb: ModuleNotFoundError: No module named 'helpers' Co-Authored-By: Claude Opus 4.7 (1M context) --- .../MICrONS/coregistration/microns_nwb_coreg_notebook.ipynb | 6 +++--- 000458/FlatironInstitute/001_summarize_contents.ipynb | 2 +- 001075/001075_paper_figure_1d.ipynb | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/000402/MICrONS/coregistration/microns_nwb_coreg_notebook.ipynb b/000402/MICrONS/coregistration/microns_nwb_coreg_notebook.ipynb index 53cb377..de83885 100644 --- a/000402/MICrONS/coregistration/microns_nwb_coreg_notebook.ipynb +++ b/000402/MICrONS/coregistration/microns_nwb_coreg_notebook.ipynb @@ -160,8 +160,8 @@ " \"zarr-checksum==0.4.7\"\n", "\n", "!curl -sL -o ng_utils.py https://raw.githubusercontent.com/dandi/example-notebooks/master/000402/MICrONS/coregistration/ng_utils.py\n", - "!curl -sL -o ng_visualization/functional_base_state.json https://raw.githubusercontent.com/dandi/example-notebooks/master/000402/MICrONS/coregistration/ng_visualization/functional_base_state.json\n", - "!curl -sL -o ng_visualization/structural_base_state.json https://raw.githubusercontent.com/dandi/example-notebooks/master/000402/MICrONS/coregistration/ng_visualization/structural_base_state.json\n", + "!curl --create-dirs -sL -o ng_visualization/functional_base_state.json https://raw.githubusercontent.com/dandi/example-notebooks/master/000402/MICrONS/coregistration/ng_visualization/functional_base_state.json\n", + "!curl --create-dirs -sL -o ng_visualization/structural_base_state.json https://raw.githubusercontent.com/dandi/example-notebooks/master/000402/MICrONS/coregistration/ng_visualization/structural_base_state.json\n", "!curl -sL -o ScanUnit.pkl https://raw.githubusercontent.com/dandi/example-notebooks/master/000402/MICrONS/coregistration/ScanUnit.pkl" ] }, @@ -240,7 +240,7 @@ "from tqdm import tqdm\n", "import pandas as pd\n", "import numpy as np\n", - "import matplotlib.pyplot as plt\n" + "import matplotlib.pyplot as plt" ] }, { diff --git a/000458/FlatironInstitute/001_summarize_contents.ipynb b/000458/FlatironInstitute/001_summarize_contents.ipynb index 404d183..9ab3900 100644 --- a/000458/FlatironInstitute/001_summarize_contents.ipynb +++ b/000458/FlatironInstitute/001_summarize_contents.ipynb @@ -129,7 +129,7 @@ " \"zarr==2.18.7\" \\\n", " \"zarr-checksum==0.4.7\"\n", "\n", - "!curl -sL -o helpers/stream_nwbfile.py https://raw.githubusercontent.com/dandi/example-notebooks/master/000458/FlatironInstitute/helpers/stream_nwbfile.py" + "!curl --create-dirs -sL -o helpers/stream_nwbfile.py https://raw.githubusercontent.com/dandi/example-notebooks/master/000458/FlatironInstitute/helpers/stream_nwbfile.py" ] }, { diff --git a/001075/001075_paper_figure_1d.ipynb b/001075/001075_paper_figure_1d.ipynb index 773e7a5..d05b848 100644 --- a/001075/001075_paper_figure_1d.ipynb +++ b/001075/001075_paper_figure_1d.ipynb @@ -136,9 +136,9 @@ " \"zarr==2.18.7\" \\\n", " \"zarr-checksum==0.4.7\"\n", "\n", - "!curl -sL -o utils_001075/__init__.py https://raw.githubusercontent.com/dandi/example-notebooks/master/001075/utils_001075/__init__.py\n", - "!curl -sL -o utils_001075/_stream_nwbfile.py https://raw.githubusercontent.com/dandi/example-notebooks/master/001075/utils_001075/_stream_nwbfile.py\n", - "!curl -sL -o utils_001075/_waterfall.py https://raw.githubusercontent.com/dandi/example-notebooks/master/001075/utils_001075/_waterfall.py" + "!curl --create-dirs -sL -o utils_001075/__init__.py https://raw.githubusercontent.com/dandi/example-notebooks/master/001075/utils_001075/__init__.py\n", + "!curl --create-dirs -sL -o utils_001075/_stream_nwbfile.py https://raw.githubusercontent.com/dandi/example-notebooks/master/001075/utils_001075/_stream_nwbfile.py\n", + "!curl --create-dirs -sL -o utils_001075/_waterfall.py https://raw.githubusercontent.com/dandi/example-notebooks/master/001075/utils_001075/_waterfall.py" ] }, {