magic load/run: option to update new content #2600

wants to merge 1 commit into


None yet
4 participants

kyleam commented Nov 18, 2012

flag that runs or loads a python file only after a change from previous
load/run of that file is encountered

Kyle Meyer
magic load/run: option to update new content
flag that runs or loads a python file only after a change from previous
load/run of that file is encountered

takluyver commented Nov 19, 2012


I think my first reaction, however, is that this is quite a bit of extra complexity, and I'm not sure what problem it's trying to solve. %run especially is one of the most fragile bits of IPython, so we're wary of adding anything there. And as I envisage %load, you would normally load some code once, then break it up into smaller fragments to run and rerun.

Can you describe what problem you're having, so that we can work out how best to handle it?

kyleam commented Nov 19, 2012

Thanks for the response.

The main reason I was using this is to get the workflow I have when I use emacs/ess with R, where I mostly work from a script and then send changes to the interactive environment. I'm aware that ipython.el can do this, but I hadn't had much luck getting things to run smoothly and didn't necessarily want to run IPython from within emacs.

For very small things, it isn't a problem to load or run the file again, but if there is a rate limiting step (loading in/manipulating a larger data set), it is nice to be able to only load that once.

So, this makes me think I'm just not going about it the right way. I'm assuming the typical approach to above is to use %save to append lines to a file, and that I'm just making it more complicated by wanting to work mostly from a script.

Thanks again for the response. It certainly makes sense not to incorporate a change that only solves a problem one user is making for himself :) Please let me know if you have any suggestions for a better workflow.


ellisonbg commented Jan 9, 2013

There are a couple of ways I deal with this:

  • I break my code into a different pieces. I run the time consuming parts once and then %run the other parts as needed.
  • I just run in the notebook where you can have full control over which cells get executed when.

I agree with @takluyver that the approach in this pull request is to much complexity to add to a fragile part of our code base, when most of our users won't probably use this.


bfroehle commented Jan 10, 2013

@kyleam Thanks for the contribution, but unfortunately I agree with @takluyver and @ellisonbg that this is beyond the scope of the IPython project.

I encourage you to make your own custom IPython extension and post it to our extension list.

If the extension finds a significant user base we can re-examine adding this feature to IPython core.

@bfroehle bfroehle closed this Jan 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment