These are chat archives for ipython/ipython

8th
Oct 2014
Jessica B. Hamrick
@jhamrick
Oct 08 2014 00:00
Hmm, seems to still be sending the same keypress regardless of chrome/firefox/safari
Thomas Kluyver
@takluyver
Oct 08 2014 00:00
interesting
is there a way to see what keypresses it thinks it's getting?
Ctrl-J and return do the same thing here
Jessica B. Hamrick
@jhamrick
Oct 08 2014 00:01
Try doing M-x describe-key <enter> <enter>
Through the ipython terminal, it tells me enter equals C-j, but everywhere else it’s equal to RET
Thomas Kluyver
@takluyver
Oct 08 2014 00:02
you're quite right, I see the same thing
I'll see what data is getting sent
Kyle Kelley
@rgbkrk
Oct 08 2014 00:03
Yeah I can't use vim-mode in Atom. It gives me that uncanny valley feeling.
Thomas Kluyver
@takluyver
Oct 08 2014 00:05
It's a carriage return being sent over the wire, but terminado converts that to a newline. I wonder what happens if we don't do the conversion.
yep, that did it
Jessica B. Hamrick
@jhamrick
Oct 08 2014 00:07
Sweet!
Thomas Kluyver
@takluyver
Oct 08 2014 00:09
takluyver/terminado@a40f54d should fix it
Jessica B. Hamrick
@jhamrick
Oct 08 2014 00:11
It does indeed!
Thanks!
Thomas Kluyver
@takluyver
Oct 08 2014 00:12
you're welcome :)
now we don't need a text editor at all, right? Everyone is happy with one of emacs or vi, right? Or nano, for the uninitiated.
Damian Avila
@damianavila
Oct 08 2014 00:37
NANO rules!!!
jaja...
Thomas Kluyver
@takluyver
Oct 08 2014 00:39
I refer my honourable friend to XKCD: http://xkcd.com/378/
Damian Avila
@damianavila
Oct 08 2014 00:41
jaja... every time I see it, I laugh a lot!!
Thomas Kluyver
@takluyver
Oct 08 2014 00:42
:)
Brian E. Granger
@ellisonbg
Oct 08 2014 00:45
I don't use emacs or vi, so nano please :)
Damian Avila
@damianavila
Oct 08 2014 00:47
yeah... +2 for nano... who else?
Chris Friedline
@cfriedline
Oct 08 2014 01:08
posted this in the irc room, as well, but wondering if there is a recommended way to store an ipython session from the notebook. dill.dump/load_session? %store?
Thomas Kluyver
@takluyver
Oct 08 2014 01:13
store will store individual variables
I think dill is your best bet if you want to try saving the whole namespace
Chris Friedline
@cfriedline
Oct 08 2014 01:17
thanks. getting some errors doing this will dill (IPy 2.3.0, dill 0.2.2.dev), but i'll revisit.
Thomas Kluyver
@takluyver
Oct 08 2014 01:18
yeah, it's not something we've ever really focussed on
depending on what the errors look like, you may have luck asking Mike McKerns, the author of dill
Chris Friedline
@cfriedline
Oct 08 2014 01:20
cool. thanks.
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 02:34
terminado, it is more like sharknado than terminator.
Chris Friedline
@cfriedline
Oct 08 2014 03:25
from before - seems my issue with dump_ and load_session are related to matplotlib figures in the global namespace.
Jonathan Frederic
@jdfreder
Oct 08 2014 05:46
Lol I had never heard of that movie - http://www.imdb.com/title/tt2724064/
Jessica B. Hamrick
@jhamrick
Oct 08 2014 05:47
I remember it being all over the twittersphere like a year ago
Andreas Klostermann
@akloster
Oct 08 2014 13:39
A monkey hitting random keys on a keyboard, for an infinite amount of time, still won't be able to exit Vim.
Jonathan Frederic
@jdfreder
Oct 08 2014 15:30
Please take a quick look at ipython/ipython#6650 . It fixes a test that's failing in master right now.
dooz
@fooziex
Oct 08 2014 17:16
howdy all
is there an IPuthon IRC channel?
lmgtfy
Jonathan Frederic
@jdfreder
Oct 08 2014 17:27
what's IPuthon :trollface: ?
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 17:28
Small issue with styling keys:
btn1 = Button(width=200)
btn2 = Button()
btn2.width=500
display(btn1, btn2)
Jonathan Frederic
@jdfreder
Oct 08 2014 17:28
idk about IPuthon, but there's an IPython IRC
I don't use it though
dooz
@fooziex
Oct 08 2014 17:29
sorry
I meant iPython
:fire:
Jonathan Frederic
@jdfreder
Oct 08 2014 17:29
:smile:
I was just kidding
dooz
@fooziex
Oct 08 2014 17:29
ya <3
don't yall hate "iPython"? or is that just my bias
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:30
so the correct way to add classes to widgets is to change _dom_classes directly?
Thomas Kluyver
@takluyver
Oct 08 2014 17:31
ha, @jdfreder missed the capitalisation trolling
Jonathan Frederic
@jdfreder
Oct 08 2014 17:31
Hate is a strong word
Thomas Kluyver
@takluyver
Oct 08 2014 17:31
...hopefully the correct way to do anything doesn't involve a private attribute, @bollwyvl .
IDK what the right way is, though
Jon?
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:32
here's the ipython/ipython@e3aa983 where the behavior changed
Jonathan Frederic
@jdfreder
Oct 08 2014 17:32
@SylvainCorlay I don't see the problem. Does it not work?
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 17:32
actually, _dom_class should probably be a Set
it does not apply the styling to btn1
Jonathan Frederic
@jdfreder
Oct 08 2014 17:32
@bollwyvl yes, _dom_classes
It only applies the outer most element
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 17:33
do you see that behavior @jdfreder
Jonathan Frederic
@jdfreder
Oct 08 2014 17:33
@SylvainCorlay I'll check right now
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:33
is there a CSet?
Jonathan Frederic
@jdfreder
Oct 08 2014 17:34
Not that I'm aware of, but I do agree, it would make sense to use a set
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:34
and does the message protocol support sets? JS doesn't, to my knowledge...
Jonathan Frederic
@jdfreder
Oct 08 2014 17:34
No it would be passed as a list
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 17:34
Just that the api in python should be the one of a set
eventful set!
Matthias Bussonnier
@Carreau
Oct 08 2014 17:36
When recompiling the css Less always drop me the -webkit-box-flex: 0; and some other. Am I the only one that saw that ?
Jonathan Frederic
@jdfreder
Oct 08 2014 17:38
@SylvainCorlay I do see the problem
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:39
hm... i don't think i ever used the selector argument to add_class... but it seems a bit odd to lose that while the new _css directives (must?) take a selector
Jonathan Frederic
@jdfreder
Oct 08 2014 17:42
It is a little odd. The 'new' _css directive has been there all along. Just the helper method to access it was removed. _dom_classes itself is new, it's predecessors were implemented using stateless custom messages.
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:42
don't get me wrong: definitely like the trait pattern
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 17:43
Another issue is that the traits name for styling that were added are very common. We use to have them in some classes inheriting from DOMWidget, and it is conflicting
Jonathan Frederic
@jdfreder
Oct 08 2014 17:43
A series of selectors cannot reliable be made stateful without maintaining a full stack of all of selectors and add./remove_class commands used
@SylvainCorlay that's the whole point
So they are easy to remember
or easy to guess
My suggestion is to just override them if you don't need them
If you still need them, you could always create a property that referenced the trait in the base class (I'm pretty sure this is possible, I could be wrong though).
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:47
i guess _dom_classes could be a tuple of (selector, class)...
Sylvain Corlay
@SylvainCorlay
Oct 08 2014 17:47
Yeah, I think it makes sense for core IPython widgets, but for more complex ones, I might as well inherit from Widget rather than DOMWidget and use the approach of styling with proxies.
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:48
not sure how that would work with do_diff
Jonathan Frederic
@jdfreder
Oct 08 2014 17:48
@SylvainCorlay wait I don't see the problem with the code you posted earlier
from IPython.display import display
from IPython.html.widgets import *
btn1 = Button(width=200)
btn2 = Button()
btn2.width=500
display(btn1, btn2)
works for me
Jason Grout
@jasongrout
Oct 08 2014 17:48
@jdfreder: the tricky part about overriding things like the width attribute is that the View automatically registers a handler. Perhaps if the registration of css handlers was refactored into a separate function that could also be overridden, it would be easier.
Jonathan Frederic
@jdfreder
Oct 08 2014 17:49
you may be getting confused because the second width is set to 500
from IPython.display import display
from IPython.html.widgets import *
btn1 = Button(width=200)
btn2 = Button()
btn2.width=200
display(btn1, btn2)
displays buttons with the same width
@bollwyvl I suppose it could, but the decision in the end was just to remove the support for that altogether to encourage people to inherit from the widgets and create their own if they need to seriously style things. _dom_classes was left as a backdoor to give some addressability to individual widgets.
@jasongrout ah I see why that would be a problem.
a workaround would be to use properties overriding the trait names, that actually get/set to traits with a different name
(ugly though)
Jonathan Frederic
@jdfreder
Oct 08 2014 17:54
I think moving that code into a separate function is quick and harmless enough
Jason Grout
@jasongrout
Oct 08 2014 17:54
and I admit it's also ugly to repurpose names in a child class to do something different than a parent class
Nicholas Bollweg
@bollwyvl
Oct 08 2014 17:54
@jdfreder sounds good: will see if it still scratches all the current itches
Jonathan Frederic
@jdfreder
Oct 08 2014 17:56
yes
@jasongrout I'm not even sure I believe there is a valid reason for that...
Can't you just get away with overriding update_attr in the JS
?
That's what I do with widgets that need to do special things with those traits.
See int slider for an example
Jason Grout
@jasongrout
Oct 08 2014 17:59
ah, yes, I suppose so. I guess it's a little ugly that the event handlers are still registered, but you're right that we can override things at the update_attr level
Jonathan Frederic
@jdfreder
Oct 08 2014 18:02
Also, looking at initialize of DOMWidgetView, it's almost entirely code that registers handles for the various styling traits. If you wanted to override them, you could just override initialize. The only boiler plate appears to be
            DOMWidgetView.__super__.initialize.apply(this, [parameters]);
            this.on('displayed', this.show, this);
            this.model.on('change:_css', this.update_css, this);

            this.model.on('change:_dom_classes', function(model, new_classes) {
                var old_classes = model.previous('_dom_classes');
                this.update_classes(old_classes, new_classes);
            }, this);
I suppose that is a significant amount of boilerplate ...
Jason Grout
@jasongrout
Oct 08 2014 18:05
I don't feel strongly about it at this point, given that I'm also reticent to repurpose back names that you repurposed to CSS traits :).
Jonathan Frederic
@jdfreder
Oct 08 2014 18:05
Ok, I'll resume my output widget work then :)
Jason Grout
@jasongrout
Oct 08 2014 18:09
and given that we can technically override the update_attr if we really need to.
Thomas Kluyver
@takluyver
Oct 08 2014 18:15
@Carreau @minrk @jdfreder - for some reason, the fix for the JS tests is not propagating through to all pull requests. Some of them are still failing with the same errors, e.g. https://travis-ci.org/ipython/ipython/builds/37377289
Jonathan Frederic
@jdfreder
Oct 08 2014 18:15
yeah
That's the same reason I merge the PR that conflicted in the first place
Travis doesn't automatically re-run every test once a PR gets merged
Matthias Bussonnier
@Carreau
Oct 08 2014 18:16
Hum, werid. The mail you receive of on the PR page, cause the mail I receive from travis are always from HEAD, and the PR actually test MERGE.
Jonathan Frederic
@jdfreder
Oct 08 2014 18:17
we have to poke Travis to run again
for each PR that is failing
Matthias Bussonnier
@Carreau
Oct 08 2014 18:17
So it can be confusing you receive failling tests, but the PR is actually passing.
Jonathan Frederic
@jdfreder
Oct 08 2014 18:17
or in my case
I received passing
Matthias Bussonnier
@Carreau
Oct 08 2014 18:17
I already poked a few PR just after merging
Jonathan Frederic
@jdfreder
Oct 08 2014 18:17
and it was failing
Thomas Kluyver
@takluyver
Oct 08 2014 18:17
yeah, that's one that just finished
Matthias Bussonnier
@Carreau
Oct 08 2014 18:17
hum....
Thomas Kluyver
@takluyver
Oct 08 2014 18:17
that's what I'm saying, even after restarting them, some are still failing
not all, though
Jonathan Frederic
@jdfreder
Oct 08 2014 18:17
Oh that's weird
same exact error?
Thomas Kluyver
@takluyver
Oct 08 2014 18:18
looks like it, yeah
Jonathan Frederic
@jdfreder
Oct 08 2014 18:18
Maybe GitHub needs to perform the merge, is it not Travis's responsibility?
Thomas Kluyver
@takluyver
Oct 08 2014 18:19
as I understand it, Travis pulls the PR merge ref from Github
maybe Github doesn't automatically update that
Matthias Bussonnier
@Carreau
Oct 08 2014 18:19
no, merge is done by github, and is accessible through git directly with right config
Thomas Kluyver
@takluyver
Oct 08 2014 18:20
but I'm sure it's worked for others where the PR hasn't been updated
Matthias Bussonnier
@Carreau
Oct 08 2014 18:20
Oh, maybe you need to the full travis test suite, not individual JS ones !
Thomas Kluyver
@takluyver
Oct 08 2014 18:20
I think I've tried both by now
(here's one that has worked without a new commit on the PR https://travis-ci.org/ipython/ipython/builds/37398461)
yep, here's one where I reran them all https://travis-ci.org/ipython/ipython/builds/37360203
Min RK
@minrk
Oct 08 2014 18:23
I'm not sure updating master always automatically changes the merge commit fetched from GitHub
Thomas Kluyver
@takluyver
Oct 08 2014 18:24
fair enough
We just have to manually discount that when reviewing a few PRs, then
Min RK
@minrk
Oct 08 2014 18:33
@Carreau you don't need any git config to get the merge ref, it's just not fetched by default. You can get it with git fetch origin pr/XXX/merge
Matthias Bussonnier
@Carreau
Oct 08 2014 19:32
@minrk, but you need to fetch explicitely, which is painful and don't work with sha if you haven't fetched.
I got that in my global git config to fetch automatically
[remote "origin"]
    fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
Min RK
@minrk
Oct 08 2014 19:38
@Carreau yes, I used to have that, and removed it because it fetches a bunch of stuff I don't use, making everything much slower
and the explicit fetch isn't painful, and does always work
so I just use git cpr which simply expands to git fetch origin pr/[num]/[head|fetch] && git checkout FETCH_HEAD
Tom Brander
@dartdog
Oct 08 2014 20:49
I just tried to update the dev version I had been
running, when I started the notebook server up and opened a notebook I got "kernel busy" so I blew it
away and reinstalled the dev version, same result I'm on Ubuntu 14.04, any ideas? I'm even getting kernel busy opening a blank Notebook?
Min RK
@minrk
Oct 08 2014 20:50
What version were you using before?
What browser, and what versions of tornado and pyzmq?
Tom Brander
@dartdog
Oct 08 2014 20:50
It was an old dev version..
Min RK
@minrk
Oct 08 2014 20:50
What do you see in the server logs?
Tom Brander
@dartdog
Oct 08 2014 20:50
nothing in server log except start notebook
Min RK
@minrk
Oct 08 2014 20:50
what do you see in the js console?
Does it work if you open in incognito / private window?
Tom Brander
@dartdog
Oct 08 2014 20:52
Uncaught TypeError: undefined is not a function :8888/static/services/kernels/js/kernel.js:48
Uncaught TypeError: Cannot read property 'interrupt' of null :8888/static/services/sessions/js/session.js:127
Uncaught TypeError: Cannot read property 'restart' of null :8888/static/services/sessions/js/session.js:123
Uncaught TypeError: Cannot read property 'execute' of null :8888/static/notebook/js/codecell.js:286
Uncaught Error: Attempting to use a disconnected port object extensions::messaging:73
Min RK
@minrk
Oct 08 2014 20:53
And if you refresh the page and/or load in an incognito window?
Tom Brander
@dartdog
Oct 08 2014 20:54
Incognito page not found
Min RK
@minrk
Oct 08 2014 20:55
ok, so you aren't running a server on 8888
what's the server port?
Tom Brander
@dartdog
Oct 08 2014 20:55
The main page is on 8888
Min RK
@minrk
Oct 08 2014 20:55
and it works when you visit the main page in the incognito window?
Tom Brander
@dartdog
Oct 08 2014 20:56
It is just crashed. I'll restatrt
Min RK
@minrk
Oct 08 2014 20:56
how did it crash? What output was there?
Tom Brander
@dartdog
Oct 08 2014 20:57
no output.. just command prompt,, on restart it seems t be working maybe! ?
Min RK
@minrk
Oct 08 2014 20:58
Did you restart the server after updating?
Tom Brander
@dartdog
Oct 08 2014 20:59
of course!,, any how for whatever reason it seems to be going ok now.. I have no idea, I had done the usual retarts and checks before arriving here!
very strange, perhaps it just wanted more time to fully initialize after installation (eg pyc files and the like?)
I thought a few minutes should have done it
Min RK
@minrk
Oct 08 2014 21:53
odds are it was browser cache
Tom Brander
@dartdog
Oct 08 2014 21:59
agree.. as I think about it