← スキル一覧に戻る

fix-notebook
by tatsuki-washimi
gwpy expansions for experiments
⭐ 0🍴 0📅 2026年1月25日
SKILL.md
name: fix_notebook description: ノートブックのエラーを、そのノートブック自体の修正(セル内容・JSONスキーマ)またはソースコードの修正により解決する
Fix Notebook Errors
This skill handles fixing errors encountered during notebook execution, ranging from Python code bugs to Jupyter JSON schema violations.
Instructions
-
Analyze the Failure:
- Examine the traceback to determine if the error is in the notebook cell's logic, a JSON schema violation, or the underlying library.
-
Strategy A: Fix Code Cell (Local):
- If the usage is wrong, imports are missing, or data paths are incorrect, edit the
.ipynbcells. - Modify the
"source"field of the failing code cell in the notebook JSON. - Unit-Safe Assignment: When updating
astropy.unitsobjects, preferseries.value[:] = new_datato keep metadata.
- If the usage is wrong, imports are missing, or data paths are incorrect, edit the
-
Strategy B: Fix JSON Schema:
- If
nbconvertor validators fail with "Additional properties are not allowed ('id' was unexpected)": - Remove Cell IDs: Delete the
"id"key from all cells in the JSON. - Normalize nbformat_minor: Set
nbformat_minorto4(ifnbformatis 4) to prevent auto-adding IDs.
- If
-
Strategy C: Fix Library Source Code:
- If the bug is in the
gwexpy/package, trace it to the source file and apply the fix.
- If the bug is in the
-
Verification:
- Re-run the notebook using
jupyter nbconvert --executeortest_notebooksto confirm it passes.
- Re-run the notebook using
# Utility for Strategy B
import json
def fix_nb_schema(path):
with open(path, 'r') as f:
data = json.load(f)
for cell in data.get('cells', []):
cell.pop('id', None)
if data.get('nbformat') == 4 and data.get('nbformat_minor', 0) >= 5:
data['nbformat_minor'] = 4
with open(path, 'w') as f:
json.dump(data, f, indent=1)
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です