These are chat archives for ipython/ipython

8th
Apr 2015
Jessica B. Hamrick
@jhamrick
Apr 08 2015 01:32 UTC
Is it possible for the IPython 3.x version number to use a valid version instead of ipython-3.2.0-maint? It means I can’t specify ipython>3.0, because the comparison when pip is checking dependencies fails :(
(This is annoying because if I have 3.x installed from source and then try to install nbgrader from pip, it goes and installs 3.1 when what I really want is for it to use the source version that’s already been installed)
Min RK
@minrk
Apr 08 2015 01:40 UTC
Arg. I hate PEP440.
We'll switch to dev, since PEP440 doesn't allow anything else.
Jessica B. Hamrick
@jhamrick
Apr 08 2015 01:43 UTC
Ok
Yeah, that’s annoying. I would have expected + to work, but as I’m reading PEP440 it seems like that wouldn’t do it either.
Min RK
@minrk
Apr 08 2015 01:46 UTC
I'm just checking to see if 'post' makes sense, otherwise we'll just use dev. It's no big deal, just an annoying regression in pip.
post doesn't seem quite appropriate, we can use dev.
Jessica B. Hamrick
@jhamrick
Apr 08 2015 01:52 UTC
Yeah, dev seems more appropriate to me too
Min RK
@minrk
Apr 08 2015 01:53 UTC
#8276
Jessica B. Hamrick
@jhamrick
Apr 08 2015 01:55 UTC
Awesome
Scott Sanderson
@ssanderson
Apr 08 2015 02:01 UTC
I'm trying to diagnose why my IPython kernels are launching remarkably slowly; my ipython_kernel_config.py takes on the order of .3 seconds, and specify an ipython_extension that itself takes ~half a second to initialize. Between the logs from the config and the extension startup, I'm seeing a window of around 6 seconds of inactivity. Any ideas what kernel process does that's computationally interesting in the window between executing the config and loading extensions?
Sylvain Corlay
@SylvainCorlay
Apr 08 2015 02:03 UTC
I observed that as well, but only on Windows.
Bas Nijholt
@basnijholt
Apr 08 2015 12:15 UTC
Is there a way to use IPython.html.widgets.interact and setting the RangeSlider to a default value on the first run?
Bas Nijholt
@basnijholt
Apr 08 2015 12:22 UTC
Never mind, I found IPython.html.widgets.FloatSlider(min=0, max=0.5, step=0.05, value=0.25)
Armin Burgmeier
@aburgm
Apr 08 2015 17:46 UTC
I'm a bit confused by how the notebook interacts with python logging
When I do logging.getLogger('XXX').info('bla'), this is not shown, because the log level is too low
But when I change the log level with logging.getLogger('XXX').setLever(logging.INFO) it shows up in the ipython notebook
Now I'm wondering whether there is a way to add my own handler to the XXX logger that logs INFO messages, but without them showing up in the ipython notebook as well
Matthias Bussonnier
@Carreau
Apr 08 2015 17:49 UTC
Where do you want them to be shown ?
Armin Burgmeier
@aburgm
Apr 08 2015 17:50 UTC
In this particular case, in a file. I'm installing my own handler with logging.getLogger('XXX').addHandler(...) to do that.
Matthias Bussonnier
@Carreau
Apr 08 2015 17:51 UTC
I don't think they shoudl show up in the notebook then.
that seem weird.
Min RK
@minrk
Apr 08 2015 17:52 UTC
you may want to set logger.propagate = False
the root logger will log to sys.stderr by default, which is redirected to the notebook, and all loggers are descendents of the root logger.
Armin Burgmeier
@aburgm
Apr 08 2015 17:52 UTC
@Carreau, do I need to initialize ipython/my handler in a particular order then, or how does ipython now that I have installed my own handler?
@minrk, but that would disable propagation of all log messages, even ones higher than INFO, right?
Matthias Bussonnier
@Carreau
Apr 08 2015 17:54 UTC
You add the handler only your logger no ?
Armin Burgmeier
@aburgm
Apr 08 2015 17:55 UTC
yes, only to my logger, not the root logger
Min RK
@minrk
Apr 08 2015 17:57 UTC
@aburgm yes, propagation is all or nothing.
What's your log handler?
Do you want your logger to also log to the root logger?
Armin Burgmeier
@aburgm
Apr 08 2015 17:58 UTC
logging.handlers.RotatedFileHandler
Min RK
@minrk
Apr 08 2015 17:59 UTC
If you don't want your log statements to also be logged on the root logger, then you want to disable propagation for your logger.
Armin Burgmeier
@aburgm
Apr 08 2015 17:59 UTC
No, I only want my XXX log messages to go to my logger, and the notebook should handle everything else as usual
Min RK
@minrk
Apr 08 2015 17:59 UTC
it only affects your logger - it's a property of each logger, whether they should send their log messages to their parent.
disabling propagation on your logger only affects your logger.
Armin Burgmeier
@aburgm
Apr 08 2015 17:59 UTC
ah okay, I misunderstood that before
let me try that :)
perfect, that seems to do exactly what I want
thanks :)
Min RK
@minrk
Apr 08 2015 18:07 UTC
no problem
Armin Burgmeier
@aburgm
Apr 08 2015 18:10 UTC
hmm, thinking about it a bit more I might want higher-level messages to still show up in the notebook, but this is probably good enough for now
Setting the log level of this root handler that prints to stderr might come closer to what I really want
just for my curiosity, do you know whether that one is set up explicitly in ipython, or does it come from the logging module itself?
Min RK
@minrk
Apr 08 2015 18:12 UTC
the logging module
logging.getLogger('root')
Armin Burgmeier
@aburgm
Apr 08 2015 18:18 UTC
okay, right, so this is not notebook-specific at all
Armin Burgmeier
@aburgm
Apr 08 2015 18:36 UTC
Somehow I'm not particularly impressed by how this default handler is managed by the logging module:
In [1]: import logging

In [2]: logging.getLogger('XXX').addHandler(logging.StreamHandler())

In [3]: logging.getLogger('XXX').warn('bla')
bla

In [4]: logging.warn('bla2')
WARNING:root:bla2

In [5]: logging.getLogger('XXX').warn('bla3')
bla3
WARNING:XXX:bla3
In the notebook, it seems that something causes the default handler to be installed like in step [4] above, even though it's not there normally as long as nobody writes a log message directly to the root logger.
Min RK
@minrk
Apr 08 2015 19:12 UTC
@/all we're planning to split the notebook into its own repo, and then split widgets out from there, right? Rather than detangling notebook and widgets while still in IPython?
Jonathan Frederic
@jdfreder
Apr 08 2015 19:14 UTC
That sounds like a good plan
It would make it easier for me to help too
Min RK
@minrk
Apr 08 2015 19:14 UTC
ok, I think we're about ready to split HTML, which means we can do the actual repo split in the next day or two.
Jonathan Frederic
@jdfreder
Apr 08 2015 19:14 UTC
notebook/widgets will be the "small split"
Min RK
@minrk
Apr 08 2015 19:14 UTC
ha, yes
effing submodules
Matthias Bussonnier
@Carreau
Apr 08 2015 19:21 UTC
Split ! Split ! Split ! Split ! Split ! Split ! Split ! Split ! Split !
Sylvain Corlay
@SylvainCorlay
Apr 08 2015 19:30 UTC
@Carreau regarding autocomplete, I hae some cool stuff with twitter.typeahead which I should be able to push upstream
Matthias Bussonnier
@Carreau
Apr 08 2015 19:32 UTC
you mean upstream to twitter ?
Sylvain Corlay
@SylvainCorlay
Apr 08 2015 20:33 UTC
no to ipython
I saw you moved eventful back to widgets
Do you guys as specific plans regarding eventful
Min RK
@minrk
Apr 08 2015 20:35 UTC
No
Sylvain Corlay
@SylvainCorlay
Apr 08 2015 20:36 UTC
would have been interesting to have an extensions of traitlets doing something like this for sequences.
Min RK
@minrk
Apr 08 2015 20:37 UTC
It may make sense at some point in the future
Andrew Gibiansky
@gibiansky
Apr 08 2015 21:16 UTC
Has anyone used tmpnb?
I'm having issues where the kernel crashes if downloading a 200mb file.
Are there some sort of memory restrictions or something?
Min RK
@minrk
Apr 08 2015 21:27 UTC
I believe there are memory restrictions
Maybe 512MB total for the container?
Andrew Gibiansky
@gibiansky
Apr 08 2015 21:35 UTC
@minrk How can I remove them?
I need to use a 200mb file in the container
Min RK
@minrk
Apr 08 2015 21:35 UTC
On your own tmpnb instance?
Andrew Gibiansky
@gibiansky
Apr 08 2015 21:35 UTC
So probably need at least 1gb
Yes
I am running the tmpnb instance
Min RK
@minrk
Apr 08 2015 21:36 UTC
--mem-limit=1g
Andrew Gibiansky
@gibiansky
Apr 08 2015 21:36 UTC
With my own container built from my own Dockerfile
What do I pass that to?
Min RK
@minrk
Apr 08 2015 21:37 UTC
You might be able to disable the memory limit with --mem-limit=, but I'm not sure if that works.
Andrew Gibiansky
@gibiansky
Apr 08 2015 21:37 UTC
Passed to what?
Min RK
@minrk
Apr 08 2015 21:39 UTC
orchestrate.py
It's a property of the container, not the image, so it's set in the orchestration script that manages the containers.
Andrew Gibiansky
@gibiansky
Apr 08 2015 21:40 UTC
Thank you! you are a lifesaver. I should do this more than five minutes before the presentation next time.... >_<
Antonino Ingargiola
@tritemio
Apr 08 2015 23:32 UTC
Can ExecutePreprocessor stop the execution at the first exception and save the backtrace in the output cell?
I was using runipy in this way. It is convenient to save the notebook with the error in order to understand where the problem is.
Matthias Bussonnier
@Carreau
Apr 08 2015 23:35 UTC
that shoudl be the default behavior isn't it ?
I know there should be a flag on master.
Antonino Ingargiola
@tritemio
Apr 08 2015 23:35 UTC
No, it continues the execution on 3
Matthias Bussonnier
@Carreau
Apr 08 2015 23:37 UTC
Hum, I would open an issue for that.
Antonino Ingargiola
@tritemio
Apr 08 2015 23:40 UTC
Sure, I'll open an issue. Is there a workaround I can use? I need the execution to stop and hopefully to catch the exception so I can display it . I'm calling a bunch of notebooks from a single master notebook.
Jessica B. Hamrick
@jhamrick
Apr 08 2015 23:42 UTC
You could iterate through the cells and check if there are any errors
I have some code in nbgrader that does this for our documentation notebooks:
Matthias Bussonnier
@Carreau
Apr 08 2015 23:46 UTC
issues is --ExecutePreprocessor behavior is different than notebook one.
So we should at least have an option to behave the same.
Jessica B. Hamrick
@jhamrick
Apr 08 2015 23:50 UTC
Yeah, it definitely would be nice to have an option for that
Antonino Ingargiola
@tritemio
Apr 08 2015 23:54 UTC
Opened ipython/ipython#8286
Matthias Bussonnier
@Carreau
Apr 08 2015 23:54 UTC
thanks !
Antonino Ingargiola
@tritemio
Apr 08 2015 23:55 UTC
@jhamrick , thanks