-
Notifications
You must be signed in to change notification settings - Fork 514
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
- When
nbdev_exportfails, it’s hard to pinpoint which.ipynband line caused the error. - 当
nbdev_export报错时,往往难以快速定位到底是哪个.ipynb、哪一行出错。
What Is It
nbscholar_checkperforms strict Python AST checks per notebook and prints VSCode-clickable errors (/abs/path.ipynb:line:column: SyntaxError: ...).nbscholar_exportacts as a drop-in companion tonbdev_export: on failure, it guides you to runnbscholar_checkfor fast pinpointing.nbscholar_check对每个笔记本进行严格的 Python AST 校验,并以 VSCode 可点击格式输出错误(/abs/path.ipynb:line:column: SyntaxError: ...)。nbscholar_export是nbdev_export的伴侣:失败时提示使用nbscholar_check快速定位问题。
Why It Helps
- Export cells are enforced with strict AST (cells starting with
#| export/#| exporti); non-export cells tolerate common IPython syntax (%%,%,?/??) to avoid false positives. - Errors show as clickable links in VSCode’s terminal, taking you directly to the file, line, and column.
- 对导出单元(以
#| export/#| exporti开头)严格 AST;普通单元兼容 IPython 常见语法,减少误报。 - VSCode 终端中以可点击链接展示错误,直达文件、行列位置,定位更高效。
Quick Start
- Install
pip install git+https://github.com/THU-CVML/ScholarlyInfrastructure.git- Check a file or directory
nbscholar_check .- Export companion (same usage as nbdev_export)
nbscholar_export- 安装
pip install git+https://github.com/THU-CVML/ScholarlyInfrastructure.git- 检查单个文件或整目录
nbscholar_check .- 作为导出伴侣(与 nbdev_export 用法一致)
nbscholar_exportExample Output
/absolute/path/to/notebooks/03_nbscholar (nbdev extensions).ipynb:123:7: SyntaxError: invalid syntax (cell 5)- 点击该链接即可在 VSCode 中打开对应
.ipynb并跳到相应行列。 - 在 VSCode 终端中点击即可直达错误位置与上下文。
Call To Action
- Try
nbscholar_check/nbscholar_exportand share feedback:https://github.com/THU-CVML/ScholarlyInfrastructure.git - If this improves your export and debugging workflow, please give us a Star!
- 欢迎试用并反馈:
https://github.com/THU-CVML/ScholarlyInfrastructure.git - 如果觉得好用,欢迎点 Star 支持我们!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working