Skip to content

Commit 8501340

Browse files
committed
Fix to only change notebook kernels in the em-apps subdir
1 parent 4e12d76 commit 8501340

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

em-induction/update_notebook_kernels.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,14 @@ def main():
8888
root_dir = os.getcwd()
8989
print(f"📁 Root directory: {root_dir}")
9090

91-
# Find all notebooks
92-
notebooks = find_all_notebooks(root_dir)
91+
# Find all notebooks only in the em-apps subdirectory
92+
em_apps_dir = os.path.join(root_dir, "em-apps")
93+
if not os.path.exists(em_apps_dir):
94+
print(f"❌ Directory 'em-apps' not found in {root_dir}")
95+
return
96+
97+
print(f"📁 Searching in: {em_apps_dir}")
98+
notebooks = find_all_notebooks(em_apps_dir)
9399

94100
if not notebooks:
95101
print("❌ No notebooks found!")
@@ -104,9 +110,9 @@ def main():
104110

105111
for notebook_path in notebooks:
106112
# Make path relative for cleaner output
107-
rel_path = os.path.relpath(notebook_path, root_dir)
113+
rel_path = os.path.relpath(notebook_path, em_apps_dir)
108114

109-
if update_notebook_kernel(rel_path):
115+
if update_notebook_kernel(notebook_path):
110116
success_count += 1
111117
else:
112118
error_count += 1

0 commit comments

Comments
 (0)