These are chat archives for ipython/ipython

16th
Sep 2014
Min RK
@minrk
Sep 16 2014 00:06
@rgbkrk cross-origin checking question!
Min RK
@minrk
Sep 16 2014 00:18
@rgbkrk #6480
Kyle Kelley
@rgbkrk
Sep 16 2014 01:21
I'm really unsure about #6480.
Maybe we're fixing the cross origin websockets in the wrong way for our application.
I feel like we should be checking the protocol, but then we hose everyone that is putting SSL externally.
I don't see how Origin and Host are differing in the Apache case.
Min RK
@minrk
Sep 16 2014 03:31
Host doesn't include the protocol, so you can't fully compare the two, since you only have one protocol value.
I think the apache case might be something about h
how it does proxying
Kyle Kelley
@rgbkrk
Sep 16 2014 03:41
We don't do any checking of the sec websockets key do we?
Min RK
@minrk
Sep 16 2014 04:11
don't think so
shouldn't that be part of the protocol implementation?
epifanio
@epifanio
Sep 16 2014 16:56
hi, have you any clue on why the “make image” (to build https://github.com/ipython/docker-notebook) is returning this error : https://gist.github.com/c52095d0d48ae28375e0
actually the first error is https://gist.github.com/96323bc6c3ecf3185e45
but i tought it was the package lang to give the problem. seems my docker is not able to fetch the repos
Kyle Kelley
@rgbkrk
Sep 16 2014 17:03
Hey @epifanio. Can we move this conversation to https://gitter.im/ipython/docker-notebook
I'll help in there
epifanio
@epifanio
Sep 16 2014 17:04
sure, thanks
Jason Grout
@jasongrout
Sep 16 2014 17:13
@jdfreder: just fyi, I'm working on testing widgets on the python side using a mock comm object
Jonathan Frederic
@jdfreder
Sep 16 2014 17:13
awesome! :)
Did you have any luck the other day with generating API docs automagically?
Jason Grout
@jasongrout
Sep 16 2014 17:24
yes, I ended up writing some custom sphinx code
both templates and extensions
it wasn't too bad in the end
Jason Grout
@jasongrout
Sep 16 2014 17:31
python tests for widgets and the protocol: ipython/ipython#6485 :)
I think it's a bit bothersome that the protocol for updates is not symmetric between the two directions. We really should have a symmetric protocol.
Jonathan Frederic
@jdfreder
Sep 16 2014 17:32
yay!
We've been inching towards symmetry, with the changes to how comms are used and the changes you made with the _trait_to/from_json PR
Jason Grout
@jasongrout
Sep 16 2014 17:36
I think we should make sure there's symmetry before 3.0, since that is where widgets come of age
We should nail down the protocol in an IPEP, and then make sure that's implemented. The protocol is the really important thing.
Jonathan Frederic
@jdfreder
Sep 16 2014 17:38
That shouldn't be hard to do, I think the only thing we need to do (other than the IPEP) is add some code in widget.js in the model sync function, that doesn't just forward the backbone request to the backend, but instead reads it and applies our protocol instead.
Jason Grout
@jasongrout
Sep 16 2014 17:56
Yep, I think you're right.
Jason Grout
@jasongrout
Sep 16 2014 18:22
@jdfreder: how do you run the casper.js tests in IPython/html/tests/widgets?
Jonathan Frederic
@jdfreder
Sep 16 2014 18:26
iptest js/widgets
Jason Grout
@jasongrout
Sep 16 2014 18:28
ah, and I just found the README in html/tests
thanks
Okay, some comments about gitter: 1. you have to click on the small area at the bottom in order to type a comment. It'd be nice if you could just focus on the chat window and immediately start typing. 2. it's somewhat convoluted that clicking on a PR number opens up a popup, and then you have to find and click on the open button to actually see the PR page, instead of just clicking and being taken there.
Min RK
@minrk
Sep 16 2014 18:48
@jasongrout feel free to tell gitter about it :)
Jonathan Frederic
@jdfreder
Sep 16 2014 18:50
@jasongrout they offer an OSX app, I haven't tried it yet: https://gitter.im/apps . It may behave differently...
epifanio
@epifanio
Sep 16 2014 18:51
i’m using it right now .. it’s great
Kyle Kelley
@rgbkrk
Sep 16 2014 18:54
I'm going to meet with gitter while I'm in London, though it's just a generic hangout
epifanio
@epifanio
Sep 16 2014 18:54
.. guys, (please apologize for all this text, that’s eventually OT ), little question that requires some advice from expert .. i’m buildong a geostack image for docker with some dependencies pre-installed. my aim is to help to have an image ready to develop a map canvas widget for the IPython notebook. I found online some examples on how to interact between openlayers and backbone http://stackoverflow.com/questions/14925913/how-can-i-set-up-openlayers-to-use-backbone-js & https://github.com/codrineugeniu/backbone-openlayers - openlayers3 has nice axamples on how to add html5 widgets input to “talk” with the map canvas http://openlayers.org/en/v3.0.0/examples/bind-input.html i wonder if that’s the way to follow for a “geo-widjet” in the notebook.
Jason Grout
@jasongrout
Sep 16 2014 18:55
Thanks. @jdfreder, if you've got a minute, could you walk me through exactly what happens when you do iptest js? I'm reading through the source, so I'll eventually figure this out, but if you have a moment, that'd be great.
Kyle Kelley
@rgbkrk
Sep 16 2014 18:56
I'm no geo or widget expert @epifanio, but have you checked out Brian Granger's leafletwidget? https://github.com/ellisonbg/leaftletwidget
Jason Grout
@jasongrout
Sep 16 2014 18:56
@epifanio: it might be useful to look at Brian Granger's leaflet widget: https://github.com/ellisonbg/leaftletwidget
Kyle Kelley
@rgbkrk
Sep 16 2014 18:56
inb4 @jasongrout ;)
Jason Grout
@jasongrout
Sep 16 2014 18:56
barefly.
barely
epifanio
@epifanio
Sep 16 2014 18:57
oh one more! i missed this .. i had a look at this one https://github.com/jwass/mplleaflet (but the comunication is not “bidirectional (python<->js”) . i’ll check it out! thanks
Jason Grout
@jasongrout
Sep 16 2014 19:00
@jdfreder: in particular, I'm interested in knowing how easy it would be to use the iptest js infrastructure to run my own tests.
Min RK
@minrk
Sep 16 2014 19:20
@jasongrout I think it would require some small changes to iptest, but shouldn't be too hard
iptest works fine with other Python modules, I think
Might just need to change how it interprets what module to test (I think it hardcodes expanding js/foo into IPython/html/tests/foo or something similar)
so if it only did that for a match, then turned js/anything/else into anything/else when it passes to casperjs, that might be all you need.
Jonathan Frederic
@jdfreder
Sep 16 2014 19:55
Hey @jasongrout , sorry I walked out for lunch before you sent that
Do you still want me to walk you through it?
Nicholas Bollweg
@bollwyvl
Sep 16 2014 20:05
@jasongrout I co-opted the iptest stuff to do my own tests in cookiecutter-iptyhon-widget
Damian Avila
@damianavila
Sep 16 2014 20:48
Hey... little question... if I copy this chunk in the js console?
lala = function() {
    console.log("Kernel loaded");
}

$([IPython.events]).on('status_started.Kernel', lala);
and change the kernel... I don't see the log...
if I use status_idle, I see it after executing a cell... what I am missing here?
I need to execute some code after the kernel has started but it does not seem to answer to the event...
Thomas Kluyver
@takluyver
Sep 16 2014 20:52
I assume the status_started.Kernel event isn't firing on kernel change
try...
started.Session
Damian Avila
@damianavila
Sep 16 2014 20:53
ok, let me try...
Damian Avila
@damianavila
Sep 16 2014 21:02
that works... but it get triggered at the first kernel change...
so I miss the starting kernel event... OK, I will figured out some hack... ideas welcome :wink:
Thomas Kluyver
@takluyver
Sep 16 2014 21:05
you mean it doesn't get triggered when the initial kernel is started? That seems odd.
Damian Avila
@damianavila
Sep 16 2014 21:06
yes...
exactly...
ok... it seems to work...
the problem seems to be because I have another event in the extension...
Fernando Perez
@fperez
Sep 16 2014 22:03
@jdfreder, quick Q. When creating a FloatSlider() with min, max, initial value, what's the kw name for the initial value?
Or anyone who's around and happens to remember off the top of their head...
:)
Brian E. Granger
@ellisonbg
Sep 16 2014 22:04
it is just value
all widgets that work with interact use value for the initial and current value
Fernando Perez
@fperez
Sep 16 2014 22:04
Mmh, that's what I thought. But I'm not seeing the behavior I want...
Hold on.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:05
In master?
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:05
btw, regarding sliders, would you consider in IPython's scope for us to propose two modes: linspace and arange
Fernando Perez
@fperez
Sep 16 2014 22:05
Yup, typing f1 = FloatSlider( description="f1", min=220, max=230, value=225)
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:05
the current, and default value being arange
Fernando Perez
@fperez
Sep 16 2014 22:05
I still get the slider initialized at 220.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:06
Screen Shot 2014-09-16 at 3.05.40 PM.png
Trying what you did
Try making them floats?
Hmm, your code works for me
cache clear - update to master?
Fernando Perez
@fperez
Sep 16 2014 22:06
Super weird.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:07
Yes, very
Fernando Perez
@fperez
Sep 16 2014 22:07
Works in a new notebook fine, but not in a more complex one...
Brian E. Granger
@ellisonbg
Sep 16 2014 22:07
Ohhh, do you have other things imported - is there a conflict with min/max builtins?
Are you passing the values of value, min, max as literals or variables set elsewher
Brian E. Granger
@ellisonbg
Sep 16 2014 22:08
It could be that link is messing things up=
Fernando Perez
@fperez
Sep 16 2014 22:09
Ah, it seems to be picking up the values from the class instance...
Brian E. Granger
@ellisonbg
Sep 16 2014 22:09
It might be that the value starts out right, but then yes - it quickly updates to the linked value
synchronization doing its job
Fernando Perez
@fperez
Sep 16 2014 22:09
Yup.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:09
Yeah
Fernando Perez
@fperez
Sep 16 2014 22:09
that's it.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:10
Is it a bug or just the code doing its job in a way that surprised you?
Did you see my interact mixin class?
Fernando Perez
@fperez
Sep 16 2014 22:10
I guess there's no easy way for the initial value of the widget to differ from the class values.
Saw it go by, but after I'd written this :)
Brian E. Granger
@ellisonbg
Sep 16 2014 22:10
Which class values?
Fernando Perez
@fperez
Sep 16 2014 22:10
f1, f2, L are instance attributes in another class.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:11
OK, that is what I thought - yes, it all will be sync'd. Try reversing the order of the link -
Fernando Perez
@fperez
Sep 16 2014 22:11
I wanted to use Nicholas' example (slightly simplified) to illustrate a manually built GUI.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:11
It could be that the order of the traits passed into the link matter for this
Maybe first one listed wins the initial sync contest?
Fernando Perez
@fperez
Sep 16 2014 22:12
Ah, that did the trick!
Yup.
thx!!
Just reversing them gives the behavior I was naively expecting.
Not a bug, makes sense now.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:12
Subtle though for sure
Makes me happy that you are writing code today ;-)
I got to write code myself a lot this week - nbgrader is coming along really nicely
Also wrote a vizarray package that turns numpy arrays into ipythonblocks - for teaching numpy array slicing, etc.
Sooo, nice to write code!
@fperez I fly into Seattle this afternoon, let me know if you need a ride anywhere - I will have a car
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:15
hi
Brian E. Granger
@ellisonbg
Sep 16 2014 22:15
hi
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:16
sorry, I squeezed a question on slider in your conversation.
wanted to add a "mode" traitlet into a slider. (arange vs linspace)
would you consider this in the scope of IPython?
ie: fixed number of points, btween two values
Brian E. Granger
@ellisonbg
Sep 16 2014 22:17
You want a version that allows you to give min, max, steps?
Min RK
@minrk
Sep 16 2014 22:17
I wouldn't think so
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:17
yes
(@ellisonbg
Brian E. Granger
@ellisonbg
Sep 16 2014 22:17
What about just adding steps on the python side and use that to compute the step size using traitlets
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:18
because 0.1+ ... + 0.1 10 times is not 1
Brian E. Granger
@ellisonbg
Sep 16 2014 22:18
I mean add nsteps=int as a shorthand in python for setting step
step = (max-min)/nsteps wouldn't work?
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:19
We happen to often set the min or the max value of a slider from another step
no it would no
t
I meant, we often set the min and the max value of a slider from another slider
Brian E. Granger
@ellisonbg
Sep 16 2014 22:19
Are you saying you end up with small floating point errors that accumulate?
I guess I dont' see how your solution of a "mode" is any different from my solution.
But @SylvainCorlay I have to run to catch a plane. I am open to a really simple solution to this issue - but probably not a full blown alternate mode for the slider
I will be back later tonight
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:21
have you gotten a chance to look at the bulk update PR?
Brian E. Granger
@ellisonbg
Sep 16 2014 22:22
No, let me do that really quick before I get on the plane...
Fernando Perez
@fperez
Sep 16 2014 22:22
see you later, Brian! Have a good flight...
I'm good, thx for the offer.
BTW, for @ellisonbg or anyone else... Another really odd behavior with a widget...
has a working Audio control
But when the same exact thing is instantiated inside a widget:
the audio control is grayed out and inoperative.
Does that make sense to anyone?
epifanio
@epifanio
Sep 16 2014 22:25
does it make sense to store the actual values of the “widget” in the cell-output metadata ? .. so that if i share the notebook as gist to someone … if the new user doesn’t run “clear all output” he will be able to recreate the plot using the parameters as I left it ? (in this case the gui class should look for that metadata .. if available, before to make the first plot) .. does it make sense ?
Fernando Perez
@fperez
Sep 16 2014 22:26
We're still sorting out exactly what the model for persisting widget data will be. Not sure what the final answer will be quite yet...
Min RK
@minrk
Sep 16 2014 22:26
yes, the plan is to store widget data in the notebook file
still working on how we should do that
Jonathan Frederic
@jdfreder
Sep 16 2014 22:26
@fperez I had that problem earlier
epifanio
@epifanio
Sep 16 2014 22:26
that’s so cool! .. thank you!
Jonathan Frederic
@jdfreder
Sep 16 2014 22:26
the grayed out audio control
I had an invalid bitrate set
is it possible that that's happening with your explorer?
Min RK
@minrk
Sep 16 2014 22:28
@fperez is the notebook public? Not sure why it would be different.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:29
@fperez - you should just be able to drag images onto the chat area - gitter will upload them to s3 automatically and show them inline
@jdfreder @jasongrout and @SylvainCorlay I am looking at the bulk update PR
have a second to chat here
Jonathan Frederic
@jdfreder
Sep 16 2014 22:30
yes
Brian E. Granger
@ellisonbg
Sep 16 2014 22:30
I don't think that on_change expresses what this method does well - sounds too similar to all the other change event names
Jonathan Frederic
@jdfreder
Sep 16 2014 22:32
We could try to brainstorm better names here
Brian E. Granger
@ellisonbg
Sep 16 2014 22:32
I just posted a comment recommending all_changed or on_all_change
Jonathan Frederic
@jdfreder
Sep 16 2014 22:33
it's special because it only raise the event once even if multiple traits have been changes
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:33
on_change_of_any(["key1", "key2"]
ok
Jonathan Frederic
@jdfreder
Sep 16 2014 22:33
what about any instead of all
?
Fernando Perez
@fperez
Sep 16 2014 22:33
let me push that nb to a gist now
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:33
on_any_change(["a", "b"])
Brian E. Granger
@ellisonbg
Sep 16 2014 22:33
any isn't the right word. any implies that the event will fire if any of the attributes change one at a time
Jonathan Frederic
@jdfreder
Sep 16 2014 22:33
thanks @fperez
Brian E. Granger
@ellisonbg
Sep 16 2014 22:34
What you mean is all right - the event won't fire unless all the attributes change?
Brian E. Granger
@ellisonbg
Sep 16 2014 22:34
Think of the difference between any and all in numpy
Jonathan Frederic
@jdfreder
Sep 16 2014 22:34
yeah exactly
all sounds like AND
where any sounds like AND/OR
Brian E. Granger
@ellisonbg
Sep 16 2014 22:34
Will this event fire if only one is changed?
Jonathan Frederic
@jdfreder
Sep 16 2014 22:34
yes
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:34
"either"
Brian E. Granger
@ellisonbg
Sep 16 2014 22:34
Hmmmm, confused
Fernando Perez
@fperez
Sep 16 2014 22:35
@jdfreder, could be... Let me check.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:35
I thought that the idea of this event is that it only fires if all of the attrs change - in which case "all" is the right word. But if that is not what the event actually does then the name should be different than that.
Jonathan Frederic
@jdfreder
Sep 16 2014 22:35
@fperez I retract my suggestion... I think the bit rate problem was with pyaudio
Fernando Perez
@fperez
Sep 16 2014 22:35
aha!
Nope, you were right.
Don't retract it :)
Jonathan Frederic
@jdfreder
Sep 16 2014 22:36
oh
ok
:)
Fernando Perez
@fperez
Sep 16 2014 22:36
it worked
Jonathan Frederic
@jdfreder
Sep 16 2014 22:36
got worried for a second
because I was playing with both
Fernando Perez
@fperez
Sep 16 2014 22:36
I'd moved the sampling rate outside the valid range, I guess.
Though by having a print statement in there, I'm realizing that the initialization makes a bunch of sync calls that fire a full object redraw every time.
Will need to think more about how to do that, so that control panel creation only passes all params once to the objects.
Jonathan Frederic
@jdfreder
Sep 16 2014 22:37
@ellisonbg it fires once if all change, or once if one or more changes but not all
Fernando Perez
@fperez
Sep 16 2014 22:38
Right now, each new parameter added to the widget at construction time fires, so the initialization gets slow with a lot of args.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:38
@jdfreder when doesn't if fire?
Jonathan Frederic
@jdfreder
Sep 16 2014 22:38
if none of the listed traits change
so if you have a widget with traits A-F
Brian E. Granger
@ellisonbg
Sep 16 2014 22:38
So it is really "any or all" right?
Jonathan Frederic
@jdfreder
Sep 16 2014 22:38
yes
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:38
sorry, I got pulled by another thing
Jonathan Frederic
@jdfreder
Sep 16 2014 22:38
and you're interested in A-C
Brian E. Granger
@ellisonbg
Sep 16 2014 22:39
But that still doesn't capture the fact that they all changed in the same message right?
Jonathan Frederic
@jdfreder
Sep 16 2014 22:39
if D changes, it wont fire
yes
if C changes, it fires once
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:39
Not, with hold_sync, you can send many changes to the front_end at once
Jonathan Frederic
@jdfreder
Sep 16 2014 22:39
if B, C both change, it fires once
Brian E. Granger
@ellisonbg
Sep 16 2014 22:39
what about the word "atomic" to suggest that all changed in an atomic way?
Jonathan Frederic
@jdfreder
Sep 16 2014 22:39
if A-C all change, it just fires once
Brian E. Granger
@ellisonbg
Sep 16 2014 22:39
on_atomic_change?
Jonathan Frederic
@jdfreder
Sep 16 2014 22:39
yeah
I like that
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:39
or back to on_bulk_change
Brian E. Granger
@ellisonbg
Sep 16 2014 22:40
That is fine too - much better than on_change or the any/all variants
OK got to run!!!
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:40
so what is the decision BDFL
arg, we missed him :)
Fernando Perez
@fperez
Sep 16 2014 22:41
sorry...
wasn't paying attention to this discussion!
I was focused on my code for a talk tomorrow :)
should I read the thread above here or is it in a PR?
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 22:42
PR #6463
cool, we can edit past comments :)
Jonathan Frederic
@jdfreder
Sep 16 2014 22:43
@SylvainCorlay yeah it's nice
you can make ninja edits
Fernando Perez
@fperez
Sep 16 2014 22:44
reading now
Fernando Perez
@fperez
Sep 16 2014 22:54
comment over on PR so decision is all recorded there.
Brian E. Granger
@ellisonbg
Sep 16 2014 22:57
Back again
Kyle Kelley
@rgbkrk
Sep 16 2014 22:59
Hey so, check this out y'all: http://rgbkrkdemo.jupyter.org:8000/
annnd I'm getting 404s on the apis now
/api/sessions, etc.
Min RK
@minrk
Sep 16 2014 23:00
ha
Kyle Kelley
@rgbkrk
Sep 16 2014 23:00
Right as I wanted to demo
darn it
Useless notebook server
:P
Min RK
@minrk
Sep 16 2014 23:00
might be the ==
Kyle Kelley
@rgbkrk
Sep 16 2014 23:01
Awww I thought I did url safe
alright tear that down
Min RK
@minrk
Sep 16 2014 23:01
might not be your fault, might be url-encoding problem in one side or the other of IPython
it's unreasonably difficult to get that right, and we never seem to
Kyle Kelley
@rgbkrk
Sep 16 2014 23:02
I'll just use UUIDs
Ok everyone, try again!
Sylvain Corlay
@SylvainCorlay
Sep 16 2014 23:03
@ellisonbg Fernando prefers on_atomic_change
Fernando Perez
@fperez
Sep 16 2014 23:05
mildly :)
Brian E. Granger
@ellisonbg
Sep 16 2014 23:07
I am fine with the atomic ver
Min RK
@minrk
Sep 16 2014 23:07
I prefer on_nuclear_change, personally :)
Fernando Perez
@fperez
Sep 16 2014 23:08
cute ;)
Kyle Kelley
@rgbkrk
Sep 16 2014 23:14
I'll move http://rgbkrkdemo.jupyter.org:8000/ to a better domain later, set up some better metrics so we can see how the node proxy handles it
Damian Avila
@damianavila
Sep 16 2014 23:53
@takluyver, I am looking into the KernelSelector and I do not see a way to update the kernels options on the fly... I tried making IPython.kernelselector.kernelspecs empty and the call the request_kernelspecs(), but this add a new updated list over the old one... some workaround?
Thomas Kluyver
@takluyver
Sep 16 2014 23:55
It doesn't currently do anything to clear the menu, because it assumes it only fetches the kernelspecs once on page load