[IPython-User] Refactoring in ipynb
Sat Jul 14 12:46:09 CDT 2012
If the variable name is a fairly unique one, you could do a find and
replace in the JSON itself using a text editor. I think there might also be
a way to export the notebook to a .py file and reimport it, in which case
you can use any Python refactoring tool under the sun (others will have to
say how to do this or correct me if I'm wrong here).
On Jul 14, 2012, at 10:55 AM, "firstname.lastname@example.org" <email@example.com>
The fact that the ipynb saves all your variables in memory is great, but it
makes refactoring a little more tricky since you have to remember to delete
your old function/variable names. Otherwise, if you miss changing a name
somewhere it can lead to hard to fix bugs since the old variable/function
still exists but is invisible to the user.
How do people deal with this other than being extremely careful when
refactoring? I've taken to restarting the kernel after I make extensive
changes to make sure I haven't forgotten to delete any variables, but I
assume some of the more experienced users have better methods. I'd
definitely be interested in suggestions.
IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User