'''...after prototyping in the notebook, I usually refactor some of my code into individual Python files so that I can edit more comfortably using my preferred text editor. I then import those modules [back] in the...notebook.'''
I found this to be quite a headache myself, going between the iPython notebook and vim, until I discovered this great Firefox addon called "It's all text" [not affiliated] -- for those unaware, it lets you pop open a gui editor of your choice, whereupon you can send the text entered from that back down into the iPython notebook. Doing it this way you get the best of both worlds.
We're thinking of ways to improve moving code from a notebook into a module. One idea we're currently hoping to develop is a 'modulify' function/button, which will save a cell to a Python file and replace the cell contents with import statements.
You can export a notebook as a .py file, or you can save segments of your history into a .py file. But it would be nice to have something a bit more convenient as you're developing code in a notebook, when you find you want to move a couple of functions to a module but keep using them in that notebook.
We also plan to have a simple text file editor so that you can work on a module in the same environment. We're not going to try to build an entire web-based IDE, though.
I use the mentioned "It's all Text" in Firefox (to pop open gvim) alongside another addon called "Vim Fx"; these two addons together provide for a far superior experience than the vanilla iPython notebook. Though I'm still hoping they integrate vim keybindings eventually -- I've noticed that there are some branches on github w/ these, but can hardly wait to see that kind of thing surface in master.
Awesome, didn't realize it worked in pentadactyl as well.
One small caveat: i use macvim, it opens a new window in macvim, i close/sync it with :wq. Any idea how I can have it so it jumps back to the firefox window instead another macvim window?
mvim -f --nomru -c "au VimLeave * !open -a Terminal"'
for refocusing the terminal after editing a commit message. Think it'll work fine if you change Terminal to Firefox.
The --nomru is to make sure the file isn't added to the recently edited files list, which is also helpful.
there is the %edit magic, too bad that it doesn't appear to work (at least not now that I tested) with the web notebooks. it works in qtconsole though. and then there is the emacs ipython notebook mode which is kinda interesting. i'm currently in progress of evaluating it.
IPython has been great for me doing statistics with students' assessments. Though I only deal with several hundred students I can get pretty quick results working with IPython.
Personally I like IPython qtconsole. It is basically a terminal with all the graphics turned on. Not as feature rich as the IPython notebook but it is faster and cleaner for what I use it for.
Cheers, that looks really interesting. I usually use pythonxy[0] nowadays on operating systems without package managers, but I'll give that a go next time.
You can actually install it alongside Python(x,y), though I get you don't need two Python installs. But at least you can experiment with some of Anaconda's interesting features, without breaking Python(x,y).
One reason I find Sage cumbersome is that it forces me to have many things installed twice; once standalone, once as part of Sage: Scipy, IPython, Numpy... Sage should figure out a way of using dependencies, like any other package.
blutack, I apologize for the trouble you got with EPD. If you can spare a few minutes to explain me the pb, I will try to understand what went wrong (see my HN page for contact)
Looks great. I can understand what Philip goes through because I do pretty similar things for my work. I need to try the IPython once to check its feasibility for my tasks.
Morespecifically, does anybody know of an attempt to do something similar in JavaScript (and ideally, languages that compile to it)? Having a notebook that could be entirely handled client side in a browser would be incredible.
There are a few rather immature ones, but you can do a lot more with a notebook than just data analysis.
I often need to do calculations involving many parameters, and there are three important considerations I usually have to deal with:
1. I'm probably going to want to tweak the parameters.
2. The calculation is going to be difficult to express as a succinct equation.
3. I may want to look back over the result later.
Using an ordinary calculator is cumbersome because of 1 and 2, and doesn't satisfy 3. AN alternative is to use an ordinary interactive shell to put everything together, which helps with 2, but still makes for a lot of work on 1 and doesn't fix 3.
Writing a whole program to do the calculation is an improvement because it fixes 1 and 2, and it helps with 3 because I can leave myself lots of comments. I've found literate CoffeeScript to be very effective here (you can even turn it into a nice webpage to share your math with others), but there are still some drawbacks. The results are not interleaved with the code, so when I look back over it, it's not easy to check my work and debug. The workflow also leaves a bit to be desired. You can't, for example, quickly play with a small snippet as you're working through your thoughts.
A notebook, on the other hand, elegantly handles all of these considerations. I can use markdown to create a nice article for my future self explaining all of my calculations, have comments, code, and results all next to each other, and tweak parameters on the fly.
Yet I still find myself using literate CoffeeScript instead. And the main reason for that is that whenever I use Python, I constantly wish that I was using CoffeeScript instead.
Do they really need to develop a new environment? The IPython notebook environment can be adapted to different underlying language kernels--I think they've gotten the notebook at least partially working for Ruby and Julia. Why develop a whole new front-end just for R, instead of working with what's already an effective and tested environment?
I've had several conversations with R folks who insist that RStudio + Knitr does everything the IPython notebook does, and I feel like I've had a hard time conveying why I like the notebook for data exploration, prototyping, and demoing.
E.g., the R notebook linked to below looks neat, but it's still just markdown compiled to a static document. That's a different workflow--not a better or worse one; but certainly different.
People are certainly welcome to build an R kernel for the notebook. It could either be written in R, or you could write it in Python, subclassing the existing machinery to evaluate code with R using a library like rpy2.
Personally, I find it more interesting to mix languages in a single notebook - we have a %%R cell magic which allows you to have R cells in amongst your Python code, passing data between the two. An R kernel would only run R code.
The notebook format looks similar to Mathematica. Using Mathematica, I found it did indeed solve the problems mentioned in the article (e.g., having to choose names for graphs), but led to its own problems (e.g., I would organize graphs by idea, but then lose track of the chronology). Still, used the right way, it was an improvement. (And of course Mathematica is proprietary and not free.)
The essay doesn't touch this issue, but I think it should also be mentioned that the iPython notebook's ability to issue parallel jobs (particularly across multiple machines) is really amazing! This was a huge draw for me in starting to use it.
The awesomeness of IPython notebooks (and the fact that my wife has been trying to learn python and primarily uses a Chromebook) was the main reason that I finally took the plunge and signed up with a cheap VPS.
'''...after prototyping in the notebook, I usually refactor some of my code into individual Python files so that I can edit more comfortably using my preferred text editor. I then import those modules [back] in the...notebook.'''
I found this to be quite a headache myself, going between the iPython notebook and vim, until I discovered this great Firefox addon called "It's all text" [not affiliated] -- for those unaware, it lets you pop open a gui editor of your choice, whereupon you can send the text entered from that back down into the iPython notebook. Doing it this way you get the best of both worlds.