[IPython-dev] Ascii imshow

Brian Granger ellisonbg at gmail.com
Sun Feb 13 13:10:59 EST 2011


Hi,

On Sat, Feb 12, 2011 at 5:40 PM, Fernando Perez <fperez.net at gmail.com> wrote:
> Hey, Sat, Feb 12, 2011 at 10:42 AM, Brian Granger <ellisonbg at gmail.com> wrote:
>>
>> Do you think it would make sene to implement this as an object that
>> has special print methods like __pretty__, __png__, etc.  That would
>> make it super easy to add support for other frontends.
>
> Mmh, interesting...  Initially I thought of this as a purely
> functional thing, a terminal version of imshow() and nothing else.
> But what you're thinking of is connecting it to our extended display
> system... I actually do like that, especially since it would be code
> coming from IPython.

Great.

> Here's a suggestion.  Considering:
>
> 1. That Nicolas is new to IPython development and not likely to know
> all the details of the new display design.
>
> 2. That we're still sorting out (in the other thread) precisely how we
> want to go about that design, after some of the concerns Robert
> raised.

Definitely.

> I propose that we go for now with a purely functional implementation
> (basically a cleaned up, documented and tested version of Nicolas
> current code, but with the same overall approach).  This will make it
> easier for Nicolas to contribute his work now.  But we keep this as a
> prime candidate to test out the display system, and once we finalize
> the design decisions, it can be refactored in that direction.  The
> refactoring would be very easy, since it's basically replacing the
> current printing with assembling a string to be the return value of
> the repr.

Sounds good.

> I now realize this is probably the best course of action for another
> reason: in its current form, the code works even with the plain
> terminal ipython that has no knowledge of the full display machinery.
> If we move it to that model, I think it wouldn't quite work in our
> current terminal client (correct me if I'm wrong).

Correct, but I think we could make a version that did work with a
plain terminal at the same time.

> Does that sound reasonable?

Yep.

Cheers,

Brian

> Cheers,
>
> f
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the IPython-dev mailing list