[IPython-user] scipy profile

Fernando Perez fperez at colorado.edu
Mon May 19 16:53:08 CDT 2003

Arnd Baecker wrote:
> Hi,
> I encountered the following when using
> 'ipython -p scipy':
> 1.) help(scipy):
> In [1]: help(scipy)
> ---------------------------------------------------------------------------
> NameError                                 Traceback (most recent call
> last)
> ?
> NameError: name 'scipy' is not defined
> This can be cured by adding (as in ipython-numeric)
> the following two lines to ipython-scipy
> # Load scipy by itself so that 'help scipy' works
> import_mod scipy
> 2.) Now, scipy also provides scipy.info
> Doing with the above profile an `info(scipy)` gives
> In [2]: info(scipy)
> In [3]:
> However, doing the following in a normal ipython
> session (ie no -p options) gives what I expect
> In [1]: import scipy
> scipIn [2]: scipy.info(scipy)
> SciPy --- A scientific computing package for Python
> Available subpackages
> ======================
> cow         --- Cluster of Workstations
> [...]

Confirmed, and utterly bizarre.  I have _no idea_ how this can even happen. 
I'll have to look into the code for info.  However, there's a good chance that 
this is caused by the overly baroque initialization mechanism which ipython 
currently has.  I wrote that early on, and it's one of the first things I 
intend to yank out as soon as I start cleaning up the ipython internals.

In the meantime, the best I can suggest is using ipython's ?, sorry.  The 
initialization code as currently written is best fixed by simply removing it. 
  It's a relatively big job, but in the end the payoff will be big:

- less code in ipython overall -> easier maintainability

- no special-syntax ipythonrc files -> ipython will be customized using plain 
python files.  Much easier for users, and also for me (all that special syntax 
handling code will go away).

- namespace handling will be simplified -> problems like this will hopefully 
just go away.  The current setup is so tricky to manage it's not even funny.

So unfortunaetly for the time being, this wart will stay.  Hopefully now with 
0.4.0 out (coming soon, a day at most) I'll have a bit of time to start the 



More information about the IPython-user mailing list