IPython magic commands need to be runnable from comments so other tools can work with them.
See original GitHub issueIncluding magic commands in an interactive python file breaks automatic code formatting. For instance, this
#%%
%load_ext autoreload
%autoreload 2
#%%
a,b,c = [1 , 2 , 3]
will only be formatted to
#%%
# %load_ext autoreload
# %autoreload 2
#%%
a, b, c = [1, 2, 3]
if the magic commands are commented out. It would be nice if magic commands didn’t throw off the formatter, at least if the file contains #%%
cell delimiters.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (12 by maintainers)
Top Results From Across the Web
IPython magic commands need to be runnable from ... - GitHub
IPython magic commands need to be runnable from comments so other tools can work with them. Issue #3263 · microsoft/vscode-jupyter · GitHub.
Read more >Built-in magic commands — IPython 8.7.0 documentation
To work properly, Magics must use a syntax element which is not valid in the underlying language.
Read more >Useful IPython magic commands - Towards Data Science
In this post, we will get familiar with a few useful magic commands that you could use in Jupyter Notebook.
Read more >Introducing IPython — IPython 3.2.1 documentation
The %run magic command allows you to run any python script and load all of its data directly into the interactive namespace. Since...
Read more >Top 12 Magic Commands in Jupyter - Medium
Jupyter notebook has been the de-facto environment for developing all ... is also the magic command but can run on multiple lines in...
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
Are you suggesting this? #! - shell assignment #!% - line magic #!%% - cell magic
I think that would work. At least I can’t think of a better idea.
So are you asking for a new feature - run magics in comments?