ENH try parsing code after cell magic, ignore if can't
See original GitHub issueI haven’t (yet) got to the root of the issue, but the notebook in question is
I get
$ nbqa black scenarios/detection/20_deployment_on_kubernetes.ipynb
error: cannot format scenarios/detection/20_deployment_on_kubernetes.ipynb: Cannot parse: 50:1: [print(f) for f in Path(data_path()/"odFridgeObjects"/"models").glob('**/*')]
Oh no! 💥 💔 💥
1 file failed to reformat.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Inside of a notebook, magic cells should not cause an error in ...
Not having a syntax error is one thing, trying to autocomplete them is another. Does the notebook code already discard the syntax error...
Read more >turn warning off in a cell jupyter notebook - Stack Overflow
I want to turn off these warnings in a particular cell only, so not in the rest of the ipynb-file. Does someone know...
Read more >nbQA Documentation
3.3 Cell magics. By default, nbQA will ignore line magics (e.g. %matplotlib inline), as well as most cell magics. To process code in....
Read more >Tim's Magic-8.2 Information Page - Open Circuit Design
This provides a way to remove contact cuts from a layout without affecting the surrounding metals, which is something that the "erase" command...
Read more >Plotting and Programming in Python - Our Lessons
A “code cell” in a Notebook is a cell that contains software; a “text cell” is one that ... Won't even try to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We could do, but then there are cases when cells with cell magics contain valid code, e.g.
%%time
. Maybe we could do something similar to your idea of what to do with inline magics - check if what follows is valid Python code, and if it is, keep it, else ignore it?closing as I think the current solution of
--process-cells
is good enough