AnswerDotAI / AnswerDotAI/nbdev

[Feature Requests] What about making `nbdev_separate` to automatically separate imports and codes?

Open
#1,468 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

https://nbdev.fast.ai/getting_started.html#q-what-is-the-warning-found-a-cell-containing-mix-of-imports-and-computations.-please-use-separate-cells

This is a strong limitations to the usability of nbdev.

Every time I try to export docs, I spend hours cleaning up my code to sepearte imports and codes, reading tedious and annoying error messages from `nbdev_docs`.

We definitely have the ability to do this automatically. (since nbdev can produce warning messages about the situation)

Why not provide a simple tool like `nbdev_separate`, to automatically detect import lines in a cell and reformat them to a new cell above the original cell.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.