[IPython-User] Fortran cell magic
Mon Sep 9 10:16:55 CDT 2013
Le 9 sept. 2013 à 16:16, Martín Gaitán a écrit :
> Hi everybody,
> This is my first message to the list and I want to begin by thanking every collaborator for the amazing tool that IPython is.
> I've just finish a (sci)python training course I gave to my company's interns and some researchers from the university based on IPython Notebook (following the emphatic advice of Damián Ávila) and the experience was very successful. Btw, the lecture material (in spanish) is available under a CC license here:
> My first contribution to IPython is an alpha/hackish cell magic, inspired a bit in the cython one, to embed fortran code directly in the notebook, compile it via f2py and automatically import every symbol to the interactive namespace.
Great, thanks, this is a good start. I think there was an embryo of f2py magic at some point.
Maybe you can also scape some code from there ( I don't know maybe there was more functionality)
> feedback and PRs more than welcome
Did you know wether or not CodeMirror support Fortran highlighting.
If so it should be pretty easy to have the notebook switch to fortran mode if it sees the %%fortran
at the start of cell.
You can also add your magic into the ipython cookbook. And don't forget that if yo unmake it a python package it can be installed via PIP.
I would also suggest to get closer to f2py and see if they would like to integrate this into their own repo, so that importing f2py into ipython
would almost automagically load fortran magic.
See (Break out language magics into their own repos) https://github.com/ipython/ipython/issues/3803 for more info.
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User