Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying cell magics for multiple cells #1

Open
cschwem2er opened this issue Apr 1, 2016 · 1 comment
Open

Applying cell magics for multiple cells #1

cschwem2er opened this issue Apr 1, 2016 · 1 comment

Comments

@cschwem2er
Copy link

Hi,

first of all sorry for hijacking this issues as kind of a "feature/possibility request", but I had problems finding people familiar with jupyter nbextensions and hope that you can help me out.

Currently an implementation for using the statistics software Stata within Jupyter Notebooks is being developed. The current version uses cell magic %%stata to communicate with the software.

My question related to this: With the new multi-cells selection from 4.1, is it possible to automatically apply cell magic to multiple cells (or even the whole notebook)? If so it would not be necessary to rewrite the cell magic at the beginning of every cell.

Many thanks and cheers

@Carreau
Copy link
Owner

Carreau commented Apr 1, 2016

Hi @methodds ,

Thanks for the question, feel free to raise it also on the IPython mailing list or one of the main IPython repository to get more people reading.

So technically nothing is impossible, though what you ask seem to brea a lot of abstraction, and would require custom patching of a lots of methods plus would be highly brittle.

  • What if user execute cell out of order ?
  • on how many cell does the magic apply ?
  • How do you handle magic in non-notebook ?

Though, let me try to understand what you want. As far as I can tell from the example notebook, it just seem like writing %%stata on each cell is a hassle, but you still need to communicate with Python every now and then. I thus believe that you might be better implementing your own kernel on top of IPython which will default to Stata, and use a different syntax (%python ??) to switch one cell back to Python.

See for example this Stata kernel:

https://github.com/jrfiedler/stata-kernel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants