[IPython-user] Idioms for using custom profiles

Fernando Perez fperez.net@gmail....
Sun Sep 14 21:57:02 CDT 2008


Hi Matthew.

On Sun, Sep 14, 2008 at 10:24 AM, Matthew Turk <matthewturk@gmail.com> wrote:
>> As I see it, profiles are for stuff that
>> fundamentally change how ipython works.
>
> That sounds fair, and of course I will defer to your judgment.  Plus,

Well, I figured I'd pitch in a bit.  Given how I wrote the profile
machinery initially and it was very much one of the reasons I started
ipython to begin with, I might have an opinion :)  I actually very
much disagree with Ville's view of profiles as fundamentally altering
ipython.  The original motivation for profiles was to have a
lightweight mechanism for easily customizing your interactive python
session in various ways without having to constantly play environment
gymnastics with $PYTHONSTARTUP, the only thing honored by python
itself.  The idea was to let you keep your main config in your base
profile and easily layer on top of it 'versions' of ipython tailored
for specific tasks.  See slide 11 in this old talk from 5 years ago:

https://cirl.berkeley.edu/fperez/talks/0309_scipy03_ipython.pdf

I still keep a lot of profiles around in my home dir, to quickly
switch between different light customizations that all reuse my common
options (colors, prompts, etc).  Some profiles just preload a few
modules and nothing else, and that's perfectly OK.  Some of them may
'fundamentally change how ipython works', but many don't at all,
they're just a convenient configuration mechanism.

As we move forward with the new unified codebase, we'll be revisiting
the configuration machinery in depth to make everyone's life easier,
deprecate the old plaintext profiles and use the new pure-python
system but retaining all of the old functionality.  We'll be happy to
listen to feedback.

> it seems to be easier that way, as we can wrap all of the
> initialization code into a single script that gets installed into
> $LOCAL/bin/ .  So, to that end, something like the following seems to
> be the best way to proceed -- have I made any obvious mistakes?

There's in principle no problem with this, it really depends exactly
on your needs.  Writing your own custom script gives you more control,
but it also may be nicer to let people start ipython in any way they
want, as Ville suggests.

BTW, you may be interested in the new work on making ipython available
as a WX component that Gael and Laurent have been doing.  With the
iptyhonx widget, you can put ipython into a larger WX app that uses
VTK and matplotlib, something that seems in the line of work of yt :)

Cheers,

f

ps - it would be very nice to hear from you a bit more detail once
you're settled.  We try to collect user stories about ipython in the
real world, especially in scientific contexts.  It always helps the
project...


More information about the IPython-user mailing list