These are chat archives for ipython/ipython

3rd
Apr 2015
Min RK
@minrk
Apr 03 2015 00:56
@takluyver after strict whitelist filter-branch, parallel .git is 3.2MB. I think this is going to work okay.
Thomas Kluyver
@takluyver
Apr 03 2015 00:58
nice, that's much more like it
Min RK
@minrk
Apr 03 2015 00:58
I didn't include the parallel examples, and there's no longer a reason to leave them out, so it will get a little bigger.
But in general, it seems like most will fit under 10MB.
Min RK
@minrk
Apr 03 2015 01:47
@takluyver I guess we need to put the testing decorators (skipif, etc.) in genutils?
Jeff Tratner
@jtratner
Apr 03 2015 01:49
hey folks, with IPython 3.0, is there a way to run a Jupyter notebook with the execute preprocessor and have it exit non-zero if the notebook raises an exception (at least for Python or even better if language agnostic). Like ipython nbconvert failing_notebook.ipynb --ExecutePreprocessor.enabled=True --to=notebook output.ipynb and then the result would be output.ipynb with the output filled in as if you had run the notebook, but it would exit non-zero so you could tell the command had failed.
Happy to put this in a Github issue if that's the better location for this
runipy is nice but it doesn't support notebook v4
s/"tell the command had failed"/"tell the notebook failed"
Thomas Kluyver
@takluyver
Apr 03 2015 01:52
@minrk I guess so. Either that or just copy them to the projects that need them. I don't think that code changes very often, so copies of it probably aren't a big issue.
@jtratner there isn't, but I think it's something a couple of people have asked for. I sense a pull request in your future ;-) Though you may want to leave it a couple of weeks, because we're busy reorganising the repo into several repos.
Jeff Tratner
@jtratner
Apr 03 2015 01:56
@takluyver - well, luckily I need this for work, so not crazy that it'd end up as a PR. Looks like there's an error key so it wouldn't necessarily be that hard to run the execute preprocessor at Python level and then print traceback to stderr and exit non-zero if something fails.
@takluyver - would it make sense to update this - https://github.com/ipython/ipython/wiki/IPEP-17:-Notebook-Format-4 - to point the jsonschema set up in #5733?
Thomas Kluyver
@takluyver
Apr 03 2015 03:34
@jtratner that may well make sense. Note that we also have a document describing the notebook format (as opposed to the IPEP, which focuses on the changes between versions): http://ipython.org/ipython-doc/dev/notebook/nbformat.html
Jeff Tratner
@jtratner
Apr 03 2015 03:36
@takluyver yeah - turned out to be really simple to just iterate through a notebook to find the first cell with an error output and just print that.
but I'll try to circle back after you all split out the repo and see if I can put together a PR
Thomas Kluyver
@takluyver
Apr 03 2015 03:42
awesome, thanks
if it's simple, you can try making a PR against master now - we might get it merged before splitting that repo out.
but no promises
Jeff Tratner
@jtratner
Apr 03 2015 05:52
@takluyver - it's pretty clear how to hook into execute preprocessor, just not sure how to bubble exception to command line
Thomas Kluyver
@takluyver
Apr 03 2015 05:54
It won't raise an actual exception, because the code from the notebook is running in a separate process.
In this loop, you'll get a message with type 'error'
Jeff Tratner
@jtratner
Apr 03 2015 05:55
@takluyver - naw I mean: if I raise an Exception from within Execute (i.e., on receive output_type of 'error'), will that cause it to exit non-zero?
yeah, that was what I was going to do
Thomas Kluyver
@takluyver
Apr 03 2015 05:56
Yes, unless something catches the error - an uncaught exception automatically causes a non-zero exit code.
I don't think anything catches exceptions in preprocessors, but I could be wrong about that. Try it and see.
oh, and in case it's not clear, that behaviour should be a configurable option to ExecutePreprocessor
Jeff Tratner
@jtratner
Apr 03 2015 05:59
yeah
Thomas Kluyver
@takluyver
Apr 03 2015 05:59
timeout in that file is an example of how to add a configurable attribute
:)
Min RK
@minrk
Apr 03 2015 17:36
@/all anything in the way of releasing 3.1 today? 3.x is up to date, and there are currently no issues or PRs marked for backport.
Thomas Kluyver
@takluyver
Apr 03 2015 17:38
not that I'm aware of
Min RK
@minrk
Apr 03 2015 17:40
Okay, I'll cut it this afternoon, then.
Jonathan Frederic
@jdfreder
Apr 03 2015 17:46
:+1:
Damian Avila
@damianavila
Apr 03 2015 18:12
:+1:
Min RK
@minrk
Apr 03 2015 18:16
@takluyver testing.tools and testing.decorators are proving a bit more complicated than I expected.
Thomas Kluyver
@takluyver
Apr 03 2015 18:21
Can we just duplicate the bits we need?
the stuff about introspectable wrapping doesn't matter too much for test code, IMO.
or stick some bits into genutils
Min RK
@minrk
Apr 03 2015 18:27

so just copy around the simplest:

def skipif(condition, msg):
    def dec(f):

      def wrapped(*a, **kw):
          if condition:
              raise SkipTest(msg)
          return f(*a, **kw)
    return dec

?

Introspection in skipped tests can't be important, since the tests don't run.
That seems simple enough. What about known failure, which is in external.decorators for numpy.
Thomas Kluyver
@takluyver
Apr 03 2015 18:30
how many knownfailures do we actually have?
Min RK
@minrk
Apr 03 2015 18:31
Good point - they are only in projects that depend on IPython - IPython', kernel, and parallel.
Okay, ignoring that one.
Yay!
Thomas Kluyver
@takluyver
Apr 03 2015 18:32
:)
Min RK
@minrk
Apr 03 2015 18:32
Do we remove the use of undoc on split packages before or after the split?
Thomas Kluyver
@takluyver
Apr 03 2015 18:32
and if some of the split packages end up using py.test, that has a notion of expected failure already
I'd say after
Min RK
@minrk
Apr 03 2015 18:32
sure
ok
Does that mean we should add the testing decorator copies after splitting, too?
skipif, etc.?
Thomas Kluyver
@takluyver
Apr 03 2015 18:47
I'm ambivalent about that
we could have a genutils.testing module for a while if it helps.
Min RK
@minrk
Apr 03 2015 18:49
Or we could have packages depend on IPython for testing while we work it out.
Thomas Kluyver
@takluyver
Apr 03 2015 18:50
Yep. If we think it's likely to last until after a release, though, genutils seems cleaner
Min RK
@minrk
Apr 03 2015 18:50
I might be slightly inclined to have a small genutils.testing with the basics, and try to keep it small.
Unlike other things, I would probably make them copies, rather than moves, since the originals will likely stay in IPython', even after downstream projects stop using them.
Thomas Kluyver
@takluyver
Apr 03 2015 18:52
that sounds reasonable
Min RK
@minrk
Apr 03 2015 18:52
...although isn't that true of everything in genutils?
Most of what's in utils.path is still IPython-specific.
Or rather, only used in IPython. Not IPython-specific in logic, but has no need to be shared in genutils.
Thomas Kluyver
@takluyver
Apr 03 2015 18:58
yeah, with more careful splitting, we could probably reduce genutils or eliminate it entirely
but the more careful we are, the longer it will take ;-)
Min RK
@minrk
Apr 03 2015 18:58
filefind is used in several places. So is get_ipython_dir, but obviously that will change to jupyter in many cases.
Thomas Kluyver
@takluyver
Apr 03 2015 18:58
but yes, we should consider whether it makes sense to leave copies in IPython prime
Min RK
@minrk
Apr 03 2015 18:59
If the goal is to kill genutils, I think it does.
Thomas Kluyver
@takluyver
Apr 03 2015 18:59
OK
probably worth mentioning at the dev meeting on Tuesday
Min RK
@minrk
Apr 03 2015 18:59
Yup.
Right? Because IPython's going to need them, so if we get rid of genutils, we are going to re-add things to IPython.
Thomas Kluyver
@takluyver
Apr 03 2015 19:00
I'll agenda it. Not sure if I'll be at the meeting.
Min RK
@minrk
Apr 03 2015 19:00
ok
right, PyCon.
Thomas Kluyver
@takluyver
Apr 03 2015 19:01
yep
Matthias Bussonnier
@Carreau
Apr 03 2015 22:30
Yeahhhh typescript ! 2 days to get it """working""" half a day to make a 3 line patch.
That's how I feel right now with TypeScript.
The guy beeing the compiler.
S. Chris Colbert
@sccolbert
Apr 03 2015 23:37
@Carreau what are you working on? With any new language, it takes a bit to get the feel of it. I'm confident you'll be feeling more productive soon. Feel free to ping me with any questions. I've probably suffered through most of the gotchas and wtfs by this point.
Matthias Bussonnier
@Carreau
Apr 03 2015 23:38
Nah, just getting the hang of typescript.
I know this is just the beginning.
I'm trying to understand https://github.com/KesterTong/phoshpor-notebook kester Prototype
Brian E. Granger
@ellisonbg
Apr 03 2015 23:39
LOL
Matthias Bussonnier
@Carreau
Apr 03 2015 23:39
which BTW, is phoshpor <- not typed correctly :-)
S. Chris Colbert
@sccolbert
Apr 03 2015 23:39
it is a hilarious vid. need more like that and "the expert"
yes, i nosted that. Maybe we should rename it PoshJS
noticed*
Matthias Bussonnier
@Carreau
Apr 03 2015 23:41
I'm slowly understanding things, still have issues with theses factories, and when what is called.
though I get docs building, and gulp watch working :-)
S. Chris Colbert
@sccolbert
Apr 03 2015 23:42
Ah yeah - the factories are subtle. Basically, you want it to "look" and "feel" like you are instantiating the object from the render method, but in reality the renderer needs to control when things are created and destroyed, because it may re-use an existing object from one render to the next
so, you have these factory functions
which simply return instances of VirtualElement, which is just a stand-in for the thing created by the renderer
Matthias Bussonnier
@Carreau
Apr 03 2015 23:44
So the constructor never takes args then ?
(when you have a factory)
S. Chris Colbert
@sccolbert
Apr 03 2015 23:45
correct. All data is passed to the component through the data object, which is the first argument passed to the factory
that gets given to the component instance in the "init" method
that "init" method is called every time a component is rendered
which means a single component can survive multiple renderings (depending on the diff) and be updated continuously with new data
what Phosphor calls "data", React calls "props"
Matthias Bussonnier
@Carreau
Apr 03 2015 23:47
Ok.
S. Chris Colbert
@sccolbert
Apr 03 2015 23:48
Matthias Bussonnier
@Carreau
Apr 03 2015 23:49
I suppose I should not reimplement init...
it does not seem to make Phosphor Happy.
S. Chris Colbert
@sccolbert
Apr 03 2015 23:49
you can, just call super.init(...)
at some point
Matthias Bussonnier
@Carreau
Apr 03 2015 23:50
ah.. Have to get used to typescript/es6 super... I was trying super(Classname,this).init()
and alike.
S. Chris Colbert
@sccolbert
Apr 03 2015 23:50
:)
i think i
i've done the same thing once or twice
nowadays though, I just litter my Python code with this's and semicons
Matthias Bussonnier
@Carreau
Apr 03 2015 23:53
I do that too...
also finish mails with :wq
S. Chris Colbert
@sccolbert
Apr 03 2015 23:54
lol