Mon, 29 Sep 2008 16:31:46 +0100, João Quinta da Fonseca wrote:
I have given up Matlab and I it feels great to use scipy for my scientific computing needs. However, I find that I use scipy just like I used matlab, with ipython as my terminal. Although this works OK, some things are a little frustrating: updated modules need to be reimported after modification, running scripts requires the run command etc., but this is to be expected because scipy is not matlbab. Now I don't want the matlab way necessarily and I am happy to learn a new way to do things. I guess what I would like to do is do things the python way, which I think means writing my code as classes with the _main_ bit at the end etc., but I am not sure whether that is the best way and if so, what is the best way to learn it. Does any one feel like sharing what their workflow with scipy is? Any tips for me?
My workflow consists of two parts: 1) Long-running scripts 2) Interactive use For 1), I typically write programs that have main() and which take parameters on the command line. No code is at the module level, everything is in functions or classes. For 2), I use Ipython with ipy_autoreload and matplotlib, which gets quite close to Matlab-like usage. I can easily import routines from the script files when needed, and the autoreload takes care of reloading them for me. The usual caveats for reloading modules apply, but most of the time they are not a problem. -- Pauli Virtanen