[IPython-dev] IPython nosetests extension
Thu Nov 29 17:43:59 CST 2012
On Tue, Nov 27, 2012 at 3:10 PM, Brian Granger <firstname.lastname@example.org> wrote:
> Hi, this is really exciting and will be a huge improvement for using
> the notebook for real work. I will try to look a bit more at this
> over the next week (in the middle of finals right now). But a few
> * Why exactly do you need cell ids?
I've enhanced the test failure stack traces such that the function's
"filename" (like <ipython-input-DD-HHHHHHHHHHHH>) links to the cell that
defines that code. That makes it easy to click close to the definition of a
failing test or function. Even better would be linking directly to the line
of code in question… :) Unfortunately the current implementation has a
visual bug when linking to an anchor: the top IPython bar shifts up about
0.3em (it shifts back if you hit the empty fragment, "#").
> * We are soon going to completely remove the ability to publish
> are under review here:
> There is more work to do on this, but this will give you an idea of
> where we are headed. Please ask questions about the plugins on that
That makes a lot of sense. From a quick reading of it, an extension would
be able to register JS to be loaded onto the page, and the publish_json
method would allow the payload to be handed to one of those custom
functions. There's no reason I can't port this extension to that style once
I do have a few questions up-front:
1. Is there a better way than peeking at sys.displayhook to determine what
kind of output to produce?
2. I'd really like to have cell anchor generation happen always. Seems like
it would be useful to provide intra-notebook links to cells. I'm not sure
how one would manage those links as the execution order evolves, though.
For this extension, that migration is actually a good thing, as the anchor
points to the code that was actually run even if it's no longer visible.
3. I'd love to have a consistent interface to stream something like stdout
character-wise instead of line-wise. Right now it's hacked to hook stdout
directly on the console, and with even more horrible jQuery machinations on
the notebook side.
> On Tue, Nov 27, 2012 at 11:49 AM, Taavi Burns <email@example.com>
> > https://github.com/taavi/ipython_nose
> > I've gotten the %nose magic Greg Ward and I worked on at the PyCon Canada
> > sprints to a reasonable point. I'm not yet convinced that it's ready for
> > integration into IPython (I think I'd like to get IPython to add id
> > attributes on the cells so I don't have to add them myself with JS), but
> > should be good enough for some real-world testing.
> > It's pip-installable in development mode:
> > . YOUR/VIRTUALENV/activate
> > git clone https://github.com/taavi/ipython_nose.git
> > cd ipython_nose
> > pip install -e .
> > I might not bother putting it on PyPI if it's as likely to get included
> > the base IPython as Fernando was suggesting. ;)
> > I'd appreciate any feedback on features and bugs. Feel free to lodge
> them in
> > the github tracker. Pull requests are also welcome! Please keep in mind
> > the end goal is to integrate it into IPython proper, so some work might
> > deferred until then.
> > Thanks!
> > --
> > taa
> > /*eof*/
> > _______________________________________________
> > IPython-dev mailing list
> > IPythonfirstname.lastname@example.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> Brian E. Granger
> Cal Poly State University, San Luis Obispo
> email@example.com and firstname.lastname@example.org
> IPython-dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev