These are chat archives for ipython/ipython

24th
Mar 2015
Matthias Bussonnier
@Carreau
Mar 24 2015 00:44 UTC
@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 UTC
sure, are we all done? When's the deadline?
deadline April 1
Matthias Bussonnier
@Carreau
Mar 24 2015 00:45 UTC
oh, they moved again?
Matthias Bussonnier
@Carreau
Mar 24 2015 00:47 UTC
Ok.
Fernando Perez
@fperez
Mar 24 2015 01:07 UTC
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 UTC
I'll do that soon.
there is just some things that he does not like.
Kyle Kelley
@rgbkrk
Mar 24 2015 15:58 UTC
@minrk what do you think of requests-futures?
Min RK
@minrk
Mar 24 2015 16:18 UTC
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 UTC
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 UTC
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 UTC
Eh, it's for cloudpipe
Min RK
@minrk
Mar 24 2015 16:29 UTC
There's also tornado-requests
thorwhalen
@thorwhalen
Mar 24 2015 16:37 UTC
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 UTC
@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 UTC
@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 UTC
@rgbkrk ?
Kyle Kelley
@rgbkrk
Mar 24 2015 17:05 UTC
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 UTC
Connectivity issues here... :rage:
Jonathan Frederic
@jdfreder
Mar 24 2015 17:40 UTC
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 UTC
cookies peoples ?
Jonathan Frederic
@jdfreder
Mar 24 2015 17:50 UTC
cookies? browser cookies? or chocolate chip cookies?
Matthias Bussonnier
@Carreau
Mar 24 2015 17:50 UTC
Chocolat chip
Jonathan Frederic
@jdfreder
Mar 24 2015 17:50 UTC
I'm hungry.
Matthias Bussonnier
@Carreau
Mar 24 2015 17:50 UTC
here you go !
Jonathan Frederic
@jdfreder
Mar 24 2015 17:51 UTC
I see it!
Brian E. Granger
@ellisonbg
Mar 24 2015 19:04 UTC
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 UTC
@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 UTC
Interesting; thanks!
Matthias Bussonnier
@Carreau
Mar 24 2015 20:55 UTC
Which talk ?
Jason Grout
@jasongrout
Mar 24 2015 21:06 UTC
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 UTC
Oh, ok
Jason Grout
@jasongrout
Mar 24 2015 21:15 UTC
@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 UTC
@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 UTC
@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 UTC
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 UTC
That sounds very similar to what was just added.
Jason Grout
@jasongrout
Mar 24 2015 22:26 UTC
just added?
Min RK
@minrk
Mar 24 2015 22:26 UTC
Though it's holding validation as well, rather than holding notification
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:26 UTC
Yes, but you only differ the trait notifications
Min RK
@minrk
Mar 24 2015 22:26 UTC
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 UTC
ok, so hold_traits ?
Jason Grout
@jasongrout
Mar 24 2015 22:27 UTC
s/differ/defer
Min RK
@minrk
Mar 24 2015 22:27 UTC
something like that
Jason Grout
@jasongrout
Mar 24 2015 22:27 UTC
hold_sync is a widget thing, not a trait thing, IIRC
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:27 UTC
I think that it is a bit more tricky to implement
Min RK
@minrk
Mar 24 2015 22:27 UTC
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 UTC
what did it break besides the mixins?
Min RK
@minrk
Mar 24 2015 22:28 UTC
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 UTC
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 UTC
@jasongrout here is the PR for what min did: ipython/ipython#8114
Jason Grout
@jasongrout
Mar 24 2015 22:30 UTC
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 UTC
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 UTC
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 UTC
can validation hook modify the value?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:33 UTC
yes
Min RK
@minrk
Mar 24 2015 22:33 UTC
all the other validations can
ok
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:33 UTC
yes, but the other validations are not supposed to use other trait attributes
Min RK
@minrk
Mar 24 2015 22:33 UTC
ah, sure
Makes sense
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:34 UTC
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 UTC
sure
Jason Grout
@jasongrout
Mar 24 2015 22:35 UTC
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 UTC
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 UTC
but we'd like to change all 3 atomically, without tripping their validators
Min RK
@minrk
Mar 24 2015 22:36 UTC
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 UTC
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 UTC
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 UTC
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 UTC
No, not all. Just most
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:41 UTC
ok
Min RK
@minrk
Mar 24 2015 22:41 UTC
There's a reason we've never used it and probably never will
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:41 UTC
never used the Tuple?
Min RK
@minrk
Mar 24 2015 22:42 UTC
no, custom validation
Tuple disallowing None makes sense, same with all the other containers
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:42 UTC
because it is new!
Min RK
@minrk
Mar 24 2015 22:43 UTC
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 UTC
actually it will solve the slider race condition
I still need to open the pr
Min RK
@minrk
Mar 24 2015 22:44 UTC
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 UTC
so the line has been drawn in the sand?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:44 UTC
yes, I know, I can open it later.
Min RK
@minrk
Mar 24 2015 22:44 UTC
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 UTC
ah, okay. Where should we watch?
Min RK
@minrk
Mar 24 2015 22:45 UTC
But some PRs may need to be reissued
master
Jason Grout
@jasongrout
Mar 24 2015 22:45 UTC
okay.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:45 UTC
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 UTC
wow, https://github.com/jupyter has a lot of repos
Min RK
@minrk
Mar 24 2015 22:45 UTC
We'll keep reviewing and merging as appropriate.
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:46 UTC
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 UTC
in the default arg?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:47 UTC
as a valid value
Tuple(traits=[Int()])
Min RK
@minrk
Mar 24 2015 22:47 UTC
you can do C.tuple_trait = 1?
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:48 UTC
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 UTC
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 UTC
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 UTC
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 UTC
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 UTC
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 UTC
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 UTC
The example you gave looks like a bug to me
Sylvain Corlay
@SylvainCorlay
Mar 24 2015 22:57 UTC
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 UTC
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 UTC
(it is likely to have side effects)
Min RK
@minrk
Mar 24 2015 23:01 UTC
everything seems to :)
Jonathan Frederic
@jdfreder
Mar 24 2015 23:02 UTC
@jasongrout I'm here
my internet was down
Jason Grout
@jasongrout
Mar 24 2015 23:06 UTC
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 UTC
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 UTC
@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 UTC
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 UTC
@jasongrout nice!