[IPython-dev] Ascii imshow

Fernando Perez fperez.net at gmail.com
Thu Feb 10 14:53:19 EST 2011


On Tue, Feb 1, 2011 at 9:56 AM, Nicolas Rougier
<Nicolas.rougier at inria.fr> wrote:
> I've made some time ago a kind of 'ascii imshow' function to render a numpy
> array directly within the console by exploiting the 256 colors capability of
> most modern terminal. I don't know how much interesting it can be for
> IPython but I found the code useful for myself.
> Code is located
> at: http://www.loria.fr/~rougier/coding/software/numpy_imshow.py
> (GPL license can be replaced by the BSD one if necessary)

Want. Now. Fabulous!!

If you'd be so kind as to officialy relicense it as BSD, we'd be
thrilled to have it in IPython right away.  For the curious, this is
what Nicolas' default example produces:

http://imgur.com/iZ13v

Note, this is a true terminal-only tool, it doesn't work correctly in
the Qt console nor in a bare Linux console (i.e.  outside X11).  Both
the Qt and Linux console show spurious codes and just two lines of
weird colors.  It would be cool to see if this can be adapted to
non-xterm environments later, but for now this is great as it is.

Nicolas, if you're willing to submit this as a pull request against
our trunk, by adding the code as a new module named
IPython/extensions/ascii_imshow.py, it would be fantastic.  If you're
not famliar with the github workflow let us know and we'll be happy to
provide some pointers.

If you can't spare the time to make a git-based pull request please
let us know, it's possible someone else can collaborate with you to
finish that part of the process.

This file:

https://github.com/ipython/ipython/blob/master/docs/source/development/template.py

can serve as a template for putting your code in our standard format.
Certainly do keep your original copyright statement in addition to
(moving forward) the team one, and also add to the docstring an
authorship line

Authors
--------
* Nicolas Rougier...

But it's good to have all source files similarly structured and
documented project-wide.

In any case, great little tool, I hope we can pull it in soon!

Regards,

f



More information about the IPython-dev mailing list