[IPython-dev] [QUAR] Using Ipython cache as file proxy

Gökhan Sever gokhansever at gmail.com
Thu Oct 21 18:21:51 EDT 2010

On Wed, Oct 20, 2010 at 2:30 PM, Mark Voorhies <mark.voorhies at ucsf.edu> wrote:
> If you factor your script in to reading/analysis/plotting functions then
> you can do:
> 1) Start iPython
> 2) import yourmodule and run full pipeline
> 3) hack on analysis/plotting functions
> 4) reload(yourmodule) and rerun just the analysis and/or plotting parts
> I use an object oriented equivalent of this a lot, e.g.:
>>>> import mymodule
> # First load (e.g., 30 minutes of reading and pre-processing)
>>>> data = mymodule.Data()
> # First analysis (e.g. 30 seconds)
>>>> data.analyze()
> # hack on mymodule
>>>> reload(mymodule)
> # re-link methods rather than re-loading data
>>>> data.__class__ = mymodule.Data
> # Updated analysis
>>>> data.analyze()
> HTH,
> Mark

Hello Mark,

Thanks for your suggestion. This is a super-long term sturdier
solution. I was initially thinking to base my analysis on OOP
constructs. However, the number of cases that I analyse isn't that
many (only 4 so far) which procedural approach works fine, except
making me wait a bit too much.

This said, the number of cases might possibly jump over 40 and (with
much bigger data-files) in the upcoming analysis work, which I will
definitely consider your approach, primarily because not suffocating
myself in front of the screen :) and have better control on the
growing complexity.


More information about the IPython-dev mailing list