These are chat archives for ipython/ipython

17th
Mar 2015
epifanio
@epifanio
Mar 17 2015 00:57
Hi, after a while .. i was trying to inject some metadata in a notebook … i was using this : display(Javascript("IPython.notebook.metadata.ecoop_prov['nao_get'] = jj" ))
but now i got a js log saying :
Javascript error adding output!
ReferenceError: jj is not defined
See your browser Javascript console for more details.
how can i ipdate this old code ?
epifanio
@epifanio
Mar 17 2015 01:14
my falut .. buggy code converting from py2 to py3
epifanio
@epifanio
Mar 17 2015 01:50
i see the difference, if a key in the metadata doesn’t exist yet, it no longer assign a metadata.key[’subkey’] = value
in my case i was assigning : metadata.ecoop_prov['nao_get'] = jj” when metadata was empty (this wa sworking bedore) now i have first to initialize metadata.ecoop_prov = {}
then fill it with other key:value pair
Jason Grout
@jasongrout
Mar 17 2015 16:24
Javascript pro-tip: to get the real undefined, use void 0.
(bonus is that it is shorter than typing undefined!)
Sylvain Corlay
@SylvainCorlay
Mar 17 2015 16:26
a nice way to compare with undefined === void 0.
Jason Grout
@jasongrout
Mar 17 2015 16:26
You could also do: void 'javascript is horrible, this is really undefined!'
Jonathan Frederic
@jdfreder
Mar 17 2015 16:47
interesting
Jason Grout
@jasongrout
Mar 17 2015 16:47
brought to you by the letter C and the number 0 (and @sccolbert)
Jonathan Frederic
@jdfreder
Mar 17 2015 16:50
Interesting that it mentions undefined being assigned a different value. I wonder...
Nope, can't seem to change it.
@/all meeting at 10 today?
Min RK
@minrk
Mar 17 2015 16:51
Don't think so. Fernando and I are at SIAM, Brian is still in New York, I think.
Jonathan Frederic
@jdfreder
Mar 17 2015 16:52
Ok, I'll take note that we are skipping it in the hackpad.
Jason Grout
@jasongrout
Mar 17 2015 16:53
Brian is in NY, sitting right beside me.
Jonathan Frederic
@jdfreder
Mar 17 2015 16:53
Hi Brian!
Cool :D
Kyle Kelley
@rgbkrk
Mar 17 2015 17:08
Cool, my family is still sick so I'm out
ill meet with Arfon later today but that's about it
Jonathan Frederic
@jdfreder
Mar 17 2015 17:11
:(
@rgbkrk sorry everyone is still sick
get better soon
Matthias Bussonnier
@Carreau
Mar 17 2015 18:55
seem to use widget and have "some kind" of static widgets.
Jonathan Frederic
@jdfreder
Mar 17 2015 19:01
Cool!
Scott Sanderson
@ssanderson
Mar 17 2015 19:14
that looks super slick
also, impressively well-documented!
Matthias Bussonnier
@Carreau
Mar 17 2015 20:04
Haven't read a lot.
trust you to do it :-)
Matthias Bussonnier
@Carreau
Mar 17 2015 20:14
@jdfreder @ssanderson their doc seem to be notebook ! And they are exported !
Jason Grout
@jasongrout
Mar 17 2015 20:26
@minrk - is there an easy way to schedule a task for the main ipython thread from another ipython thread?
using the event loop?
perhaps the better question - how do we get a handle on the IPython event loop?
Scott Sanderson
@ssanderson
Mar 17 2015 20:28
@jasongrout I think ioloop.add_callback is what you want
Jason Grout
@jasongrout
Mar 17 2015 20:28
where do we import ioloop from?
that sounds right; just trying to figure out where to get ioloop from.
Scott Sanderson
@ssanderson
Mar 17 2015 20:30
in the notebook case it looks like they do from zmq.eventloop import ioloop
and ioloop.install()
which presumably is patching out tornado's ioloop machinery to be zmq-friendly
and then later do something like
ioloop.IOLoop.current().add_callback(self._restore_sigint_handler)
ioloop.IOLoop.instance() gets the main thread loop
and current() gets the current thread loop
Min RK
@minrk
Mar 17 2015 21:34
Yup, you want IOLoop.instance() to grab the global eventloop.
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:23
Is there a reason why the “Using existing profile dir” message is at the info level rather than debug?
Matthias Bussonnier
@Carreau
Mar 17 2015 23:25
Hum, don't see any reason.
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:26
It’s kind of annoying that it prints out every single time
I guess it’s not so bad when you’re just running the notebook
But for nbconvert you see it a lot
Matthias Bussonnier
@Carreau
Mar 17 2015 23:27
might be copy and past.
appear twice in same file;
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:27
(I guess I also think nbconvert is overly verbose in general)
Both are at the info level though
Matthias Bussonnier
@Carreau
Mar 17 2015 23:29
there is 7 nested branch in this logic, so it might probably be wrong.
it may be before config parsing though, so debug might have no effect.
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:30
Well, if I use the warn level then it doesn’t appear
So I think it’s obeying the config
But in general I want the level to be at info, I just think that particular message is more suitable to debug
Matthias Bussonnier
@Carreau
Mar 17 2015 23:31
Then just send PR. Seem legit to me to change to debug.
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:31
Ok, cool, will do
Matthias Bussonnier
@Carreau
Mar 17 2015 23:52
@jhamrick While I am at it, do you want me to open the PR?
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:53
If you want to
I’m also happy to do it, I am just finishing up some other stuff first
Matthias Bussonnier
@Carreau
Mar 17 2015 23:53
Oh, I have the changes ready and already a PR with cleanup I can just add to it.
Jessica B. Hamrick
@jhamrick
Mar 17 2015 23:54
Ok, cool
Then yeah, go ahead and add that to it