These are chat archives for ipython/ipython

24th
Mar 2015
Matthias Bussonnier
@Carreau
Mar 24 2015 00:44
@takluyver / @jdfreder can one of you submit the tuto proposal? My computer is in a state where moving windows is painfull., and have difficulties reacting to clicks.
I want to avoid submitting from my phone also...
Thomas Kluyver
@takluyver
Mar 24 2015 00:45
sure, are we all done? When's the deadline?
deadline April 1
Matthias Bussonnier
@Carreau
Mar 24 2015 00:45
oh, they moved again?
Matthias Bussonnier
@Carreau
Mar 24 2015 00:47
Ok.
Fernando Perez
@fperez
Mar 24 2015 01:07
matthias, just buy one :) we can point you to the bearbuy process, it's actually pretty easy for Apple hardware.
Matthias Bussonnier
@Carreau
Mar 24 2015 01:09
I'll do that soon.
there is just some things that he does not like.
Kyle Kelley
@rgbkrk
Mar 24 2015 15:58
@minrk what do you think of requests-futures?
Min RK
@minrk
Mar 24 2015 16:18
I remember giving it a try when investigating async docker-py, but I don't remember how it went.
Kyle Kelley
@rgbkrk
Mar 24 2015 16:19
I looked over it a little, it uses a threadpool with 2 workers
You can configure the workers
I'm tending toward using tornado's async http client
For a client binding
Min RK
@minrk
Mar 24 2015 16:21
For use in our apps, that makes sense. From an API standpoint, it doesn't make much difference.
Kyle Kelley
@rgbkrk
Mar 24 2015 16:24
Eh, it's for cloudpipe
Min RK
@minrk
Mar 24 2015 16:29
There's also tornado-requests
thorwhalen
@thorwhalen
Mar 24 2015 16:37
Is it me, or does the new Shift+Tab help make no sense: You get Type, String form, and file location. You have to hit Tab twice and scroll to get any useful information on the function... Why? Why?
I rave about ipython daily: But every time there's an "upgrade" I hesitate to demo it, because I can explain less and less of the UI choices...
Jonathan Frederic
@jdfreder
Mar 24 2015 16:40
@takluyver @Carreau I made another pass over the proposal and I think it's ready to go, should I submit it now so we can be done with it? I created a repo that's referenced in the requirements section - https://github.com/jupyter/scipy-2015-advanced-topics .
Min RK
@minrk
Mar 24 2015 16:45
@thorwhalen you get all the same info on first tab, it's just in a slightly weird order. The order will be improved in 3.1.
@ellisonbg meeting?
There you are.
Jonathan Frederic
@jdfreder
Mar 24 2015 17:05
@rgbkrk ?
Kyle Kelley
@rgbkrk
Mar 24 2015 17:05
Google Chrome and Hangouts slowed my machine to a crawl
I'll be back in a sec
Damian Avila
@damianavila
Mar 24 2015 17:12
Connectivity issues here... :rage:
Jonathan Frederic
@jdfreder
Mar 24 2015 17:40
You can cancel a scroll event :
http://jsfiddle.net/N4da4/8/
Although it's really a kludge
and requires a timeout.
Matthias Bussonnier
@Carreau
Mar 24 2015 17:46
cookies peoples ?
Jonathan Frederic
@jdfreder
Mar 24 2015 17:50
cookies? browser cookies? or chocolate chip cookies?
Matthias Bussonnier
@Carreau
Mar 24 2015 17:50
Chocolat chip
Jonathan Frederic
@jdfreder
Mar 24 2015 17:50
I'm hungry.
Matthias Bussonnier
@Carreau
Mar 24 2015 17:50
here you go !
Jonathan Frederic
@jdfreder
Mar 24 2015 17:51
I see it!
Brian E. Granger
@ellisonbg
Mar 24 2015 19:04
I think we are better off making cell divs not focusable and then doing manual scroll animation ourselves if we want to go that way
Jason Grout
@jasongrout
Mar 24 2015 19:40
@ellisonbg - I just watched your talk. Great job! You mentioned @rgbkrk is working on "cloud pipe" or something like that. Do you have a link?
(P.S. I love how someone asked a question that led right into showing phosphorjs :)
Effectively a fork of multyvac/picloud
since those never got open sourced
Job runner
@jasongrout ^
Jason Grout
@jasongrout
Mar 24 2015 20:12
Interesting; thanks!
Matthias Bussonnier
@Carreau
Mar 24 2015 20:55
Which talk ?
Jason Grout
@jasongrout
Mar 24 2015 21:06
Brian's pydata talk last week. It's not up publicly yet, but should be up soon (hopefully by next week)
Matthias Bussonnier
@Carreau
Mar 24 2015 21:07
Oh, ok
Jason Grout
@jasongrout
Mar 24 2015 21:15
@jdfreder, do you have a few minutes? I'm trying to track down a weird failure in the js tests. It looks like the failure is legit, but I can't reproduce it by hand.
I think it might be a promises race issue in the test, though.
Jason Grout
@jasongrout
Mar 24 2015 22:04
@jdfreder - I think I tracked down the bug, and it appears to indeed be a difference between how Chrome and phantomjs handle promises
But it involves a design decision I'd like to run by you. Are you around?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:22
@minrk I am looking into other potential changes to traitlets
  • allowing to set multiple elements at once and only validate once everything is set. Maybe also add a context manager. This would only hold the early validation hook.
  • changes in the Tuple trait type (specifically not allowing None by default, it is the last case) and also stop allowing Unicode() in Tuple(traits=(Unicode()))
Jason Grout
@jasongrout
Mar 24 2015 22:25
Sylvain's first point is basically the equivalent of hold_sync, allowing atomic changes to several traitlets in a HasTraits class
Min RK
@minrk
Mar 24 2015 22:26
That sounds very similar to what was just added.
Jason Grout
@jasongrout
Mar 24 2015 22:26
just added?
Min RK
@minrk
Mar 24 2015 22:26
Though it's holding validation as well, rather than holding notification
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:26
Yes, but you only differ the trait notifications
Min RK
@minrk
Mar 24 2015 22:26
I would modify the same method, I don't think there's a reason for the two to be separate.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:27
ok, so hold_traits ?
Jason Grout
@jasongrout
Mar 24 2015 22:27
s/differ/defer
Min RK
@minrk
Mar 24 2015 22:27
something like that
Jason Grout
@jasongrout
Mar 24 2015 22:27
hold_sync is a widget thing, not a trait thing, IIRC
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:27
I think that it is a bit more tricky to implement
Min RK
@minrk
Mar 24 2015 22:27
right - something similar, but more general was recently needed in HasTraits itself
since the delayed validation broke lots of initialization
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:28
what did it break besides the mixins?
Min RK
@minrk
Mar 24 2015 22:28
It broke several classes that inherited
by changing the state when __init__ is called.
We are going to need to be more conservative about breaking traitlets behavior once it is split, since there will be many downstream projects that depend on it.
Jason Grout
@jasongrout
Mar 24 2015 22:30
I'm curious: would you prefer a context manager, or a single method? MyObject.set(trait1=value, trait2=value2, trait3=value3)
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:30
@jasongrout here is the PR for what min did: ipython/ipython#8114
Jason Grout
@jasongrout
Mar 24 2015 22:30
I prefer a method instead of a context manager
it's more like a dict update then.
Min RK
@minrk
Mar 24 2015 22:32
Deferring validation sounds difficult without breaking any existing APIs (a requirement), since validation is where coercion happens.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:32
in any case, be it a method or a handler, it might require the _validate method to yield on vall to the validation hook
@minrk, we could only block validation hook. The other validation stages would still occur
Min RK
@minrk
Mar 24 2015 22:33
can validation hook modify the value?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:33
yes
Min RK
@minrk
Mar 24 2015 22:33
all the other validations can
ok
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:33
yes, but the other validations are not supposed to use other trait attributes
Min RK
@minrk
Mar 24 2015 22:33
ah, sure
Makes sense
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:34
so the interest of the hold_traits_validate (or however we call it) is to block cross validation.
Min RK
@minrk
Mar 24 2015 22:34
sure
Jason Grout
@jasongrout
Mar 24 2015 22:35
for example, we want to keep a slider's min, max, and value consistent with each other.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:35
when the context is set, we would need to cache the new values in a separate object and make it so that the validation hooks use the cache
Jason Grout
@jasongrout
Mar 24 2015 22:35
but we'd like to change all 3 atomically, without tripping their validators
Min RK
@minrk
Mar 24 2015 22:36
I think it makes sense to have a generic multi-update context or method that defers everything where traits might interact with each other.
until a few days ago, notification was the only mechanism for them to interact
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:36
implementation-wise, it might be a bit complicated because of that cache requirement (you want to be able to reject everything at once, or have everything being ok).
Min RK
@minrk
Mar 24 2015 22:36
and ~all of custom validation can be done via notification anyway
ah, that's bad
but should be doable
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:37
I am not sure all custom validation can be done via notification, because this might create race conditions in the context of widgets
(if the same validation occurs on the js side)
Besides, on a less fancy part. What about the Tuple trait type?
(disallowing none by default)
Min RK
@minrk
Mar 24 2015 22:41
No, not all. Just most
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:41
ok
Min RK
@minrk
Mar 24 2015 22:41
There's a reason we've never used it and probably never will
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:41
never used the Tuple?
Min RK
@minrk
Mar 24 2015 22:42
no, custom validation
Tuple disallowing None makes sense, same with all the other containers
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:42
because it is new!
Min RK
@minrk
Mar 24 2015 22:43
And doesn't solve a problem we have anywhere
If we needed it, we would have added it.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:43
actually it will solve the slider race condition
I still need to open the pr
Min RK
@minrk
Mar 24 2015 22:44
any new PRs that don't help with the split may not get in before the repo moves
Jason Grout
@jasongrout
Mar 24 2015 22:44
so the line has been drawn in the sand?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:44
yes, I know, I can open it later.
Min RK
@minrk
Mar 24 2015 22:44
No, not in the sand
The split has already started, but we are doing it a piece at a time.
Jason Grout
@jasongrout
Mar 24 2015 22:44
ah, okay. Where should we watch?
Min RK
@minrk
Mar 24 2015 22:45
But some PRs may need to be reissued
master
Jason Grout
@jasongrout
Mar 24 2015 22:45
okay.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:45
I guess that the custom validation will only be used for widgets, so once it is separated, as you said, probably never used in IPython
Jason Grout
@jasongrout
Mar 24 2015 22:45
wow, https://github.com/jupyter has a lot of repos
Min RK
@minrk
Mar 24 2015 22:45
We'll keep reviewing and merging as appropriate.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:46
So the question about the tuple is that you consider 1 and (1,) as the same
so it is a feature
Min RK
@minrk
Mar 24 2015 22:46
in the default arg?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:47
as a valid value
Tuple(traits=[Int()])
Min RK
@minrk
Mar 24 2015 22:47
you can do C.tuple_trait = 1?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:48
from IPython.utils.traitlets import *
class Foo(HasTraits):
    bar = Tuple(traits=Int(), allow_none=False)
foo = Foo(bar=None)
Min RK
@minrk
Mar 24 2015 22:50
I thought the difference between Tuple(Int) and Tuple((Int,)) was that the first allowed any tuple of ints, while the second only allowed a length-1 tuple
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:51
I need to look again in the code, but things like
from IPython.utils.traitlets import *
class Foo(HasTraits):
    bar = Tuple(traits=(Int(allow_none=False)))
foo = Foo(bar=(None,))
don't trigger trait errors
so I wanted to start changing Tuple.
Min RK
@minrk
Mar 24 2015 22:51
oh, Tuple(allow_none=True) should only affect whether the trait itself is allowed to be None. It should not apply to its contents.
Is that what you are getting at?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:52
I agree with your statement, I just don't get what the current state of the code is trying to do
Min RK
@minrk
Mar 24 2015 22:53
I guess I still don't understand the question, then.
I agree that what you pasted should raise an error. I don't know why it doesn't.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:57
Sorry I am probably not very clear. I expect the Tuple(traits=[Int(), Unicode()]) to only take things like (1, 'baz') or any tuple of traits is not specified. But the constructor of Tuple seems to implement some more complicated logic, and I was trying to understand if it is a bug or a feature.
(like being backward compatible with enthought traits)
Min RK
@minrk
Mar 24 2015 22:57
The example you gave looks like a bug to me
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:57
ok
pfiou, sorry, I admit I was not very clear
:)
do you want to get the allow_none=False by default for Type and Instance before the split?
Min RK
@minrk
Mar 24 2015 22:58
Not a problem, traits behavior is often unclear itself, so it's hard to discuss it clearly.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:59
(it is likely to have side effects)
Min RK
@minrk
Mar 24 2015 23:01
everything seems to :)
Jonathan Frederic
@jdfreder
Mar 24 2015 23:02
@jasongrout I'm here
my internet was down
Jason Grout
@jasongrout
Mar 24 2015 23:06
I found the problem. It was a subtle Promise :rabbit:
See the last few commits on ipython/ipython#7757
basically, since sending a sync message from js now invokes a promise before send (to load custom serializers)
incrementing the pending_msgs right after the send was delayed
which lets you send lots of messages, much more than the throttle, if the browser schedules the sends before the serializers resolve.
the frustrating thing was that I couldn't replicate in Chrome, but it showed up in phantomjs.
so +1 for tests :)
Kyle Polich
@kylepolich
Mar 24 2015 23:22
I've done something wrong, and could use some direction figuring out how to save my work the way I intend to.
When I hit save, I'm getting a dialog that reads...
"Notebook changed \n Notebook has changed since we open it. Overwrite the changed file?" [cancel] [overwrite]"
The changes in my current notebook are the good ones. I do not wish to keep whatever the external changes were.
However, I find the language a bit ambiguous
Will "Overwrite" overwrite my version or the other version?
How can I perform the equivalent of a "Save As" to be safe?
Min RK
@minrk
Mar 24 2015 23:30
@kylepolich we'll try to clarify the language. "Overwrite" means finish performing the save operation you have started. It's a confirmation dialog.
So if you are looking at the correct version of the notebook, confirming with the dialog should be connect.
Did you have the notebook open in multiple browser tabs?
Kyle Polich
@kylepolich
Mar 24 2015 23:33
Yes, I accidentally opened the notebook twice (my error). I was looking at the correct version, so thanks to your help, I hit Overwrite and got what I needed
I was just trigger shy because i wasn't sure, so thanks
Jonathan Frederic
@jdfreder
Mar 24 2015 23:40
@jasongrout nice!