These are chat archives for ipython/ipython

3rd
Feb 2015
Min RK
@minrk
Feb 03 2015 00:28
@SylvainCorlay I think instantiating two instances of C above with the default value, and doing c1.d['a'] = 2, assert_not_equal(c2.d, c1.d) should do it.
Min RK
@minrk
Feb 03 2015 00:37
@SylvainCorlay I merged your PR, thanks for your patience!
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 01:34
sorry, did not see your earlier message. Sorry about that.
I can open another PR with your suggestion
Min RK
@minrk
Feb 03 2015 03:09
Not a problem, no need. Your test is fine.
litaotao
@litaotao
Feb 03 2015 06:41
Hi, buddies, is there anyone have experience in building a big data analytic and computing online platform, using Ipython notebook and spark?
Petra Chong
@rekcahpassyla
Feb 03 2015 13:25
Greetings- is there a way to see what tasks an ipcontroller has been sent by one client, from another client?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 15:23
anyone noticed that the ToggleButtons widget is not displaying in master?
nevermind, it seems that the API has changed
Jonathan Frederic
@jdfreder
Feb 03 2015 17:03
@/all the bus is running late today and therefore I'll be a little late. See you guys at 9:35 or 40.
Matthias Bussonnier
@Carreau
Feb 03 2015 17:04
@jdfreder will miss the meeting :-)
CU tomorrow
Jonathan Frederic
@jdfreder
Feb 03 2015 17:04
Sorry to hear that @carreau :( Are you in an airport now? :)
Matthias Bussonnier
@Carreau
Feb 03 2015 17:05
No, airport tomorrow.
I'm not supposed to know but there mill be friends that comme by to drink a last beer for this year with me, but it's a surprise
Jonathan Frederic
@jdfreder
Feb 03 2015 17:07
Haha what time do you get in? Noon?
Matthias Bussonnier
@Carreau
Feb 03 2015 17:07
around 1pm airport.
@ellisonbg 123 I suppose for the key on the back :-)
Jonathan Frederic
@jdfreder
Feb 03 2015 17:14
@carreau lol , your friends in France are? That sounds fun! :D
Min RK
@minrk
Feb 03 2015 17:25
I'm running a bit behind, too. We can aim for 9:40.
Thomas Kluyver
@takluyver
Feb 03 2015 17:29
OK
we have Fernando today!
Min RK
@minrk
Feb 03 2015 17:30
yay!
Jonathan Frederic
@jdfreder
Feb 03 2015 17:30
Brian said he was connecting too
Thomas Kluyver
@takluyver
Feb 03 2015 17:37
the agenda is looking short, if there's anything people want to add
Fernando Perez
@fperez
Feb 03 2015 17:38
min just got here, will be ready in a sec
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:11
@minrk what do you mean?
we use numpy arrays as value types for the selection widgets (except that we have a slightly modified version allowing us to set the comparison predicate)
your recent change in selection widget triggered me to push this upstream
Min RK
@minrk
Feb 03 2015 19:13
Mine?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:15
hum, either you jon or bollwyvl
according to git blame.
Min RK
@minrk
Feb 03 2015 19:15
ah, that one. I wasn't involved in that. Okay
What's the precedence for self.pred as an API?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:16
just that values was renamed to options
Min RK
@minrk
Feb 03 2015 19:16
renaming the key required the addition of a new method?
(it would be nice to avoid committing large whitespace changes)
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:17
no, but renaming the key made my inherited class not work anymore
Min RK
@minrk
Feb 03 2015 19:17
ah, because you were already using the new name?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:17
I was using the old one, but overloading _value_changed
ok, my question is what do you mean by Isn't there a much larger issue related to the trait change events and numpy arrays?
Min RK
@minrk
Feb 03 2015 19:20
I just recall there being a problem with numpy arrays and trait changed events not behaving properly
it may not be relevant
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:21
oh, not that I know. We have numpy array trait types and on_trait_change works well.
Min RK
@minrk
Feb 03 2015 19:21
ok, must have been fixed, then.
used to be, you couldn't have any traits that were numpy arrays.
Why pred instead of cmp or equals?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:21
we do some validation on dtypes (check for subdtypes, or sometimes dimension)
ok, I am a c++ guy, functions /functors returning booleans were generally called predicates, just a habit.
if you prefer equals, I can change it
Min RK
@minrk
Feb 03 2015 19:24
ok
let's go with equals, then
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 19:25
ok, I rebase and remove some noise on trailing characters
Min RK
@minrk
Feb 03 2015 19:25
thanks, then I'll merge.
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 20:05
@jdfreder I am sorting out basic widgets that we have. We have inherited from Button / ToggleButton to add font-awsome icons - and we use it a lot. Would you guys take it upstream or is it too specific (font-awesome).
Jonathan Frederic
@jdfreder
Feb 03 2015 20:06
?
You mean icon only buttons?
Or icon and text?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 20:06
no, icon + text
or icon only
or text only
Jonathan Frederic
@jdfreder
Feb 03 2015 20:07
Cool
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 20:07
but the icon name comes from font-awsome
Jonathan Frederic
@jdfreder
Feb 03 2015 20:07
May I look at it to see how much code it is?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 20:08
A simple python one, but I would make it cleaner for upstream:
class FaButton(Button):
    faclass = Unicode(sync=True)

    def __init__(self, faclass, *args, **kwargs):
        self.faclass = faclass
        add_class(self, 'fa')
        add_class(self, self.faclass)
        self.on_trait_change(self._update_dom_classes, name='faclass')
        super(FaButton, self).__init__(*args, **kwargs)

    def _update_dom_classes(self, name, old, new):
        remove_class(self, old)
        add_class(self, new)
I would rather make the change on the JS side, hence modify the view
Let me know if it is upstream-friendly.
Same for ToggleButton and ToggleButtons
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 20:56
The change from values to options in the _Selection widget forced me to change quite a few things on my side.
One specific thing is that we build automated guis to inspect widget models (for debugging). An Enum was mapped to a Selection widget, with values equal to the values of the Enum. Would it make sense to have the Enum's list of values be also renamed to options?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 22:12
@ellisonbg do you have a take on this?
Thomas Kluyver
@takluyver
Feb 03 2015 22:14
Enum is in traitlets, which is a much more stable API than the widgets
if I was writing traitlets from scratch, I would prefer options to values
but we need to be more careful with changing things like that in traitlets
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 22:15
Sure. I agree.
Jonathan Frederic
@jdfreder
Feb 03 2015 22:51
Hey @SylvainCorlay , sorry I was away, @ellisonbg walked in the room. With that you're forced to use the Font-Awesome font for the text too, right?
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 23:02
hum, that is just a quick demo i did for the example
I would do it on the javascript side
so no :)
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 23:07
Btw, I am experiencing some weird widget persistence bugs, and I am using the HEAD of master.
On load of the notebook page, widgets tend to show at the wrong place.
Actually, the last widget displayed on the notebook replaces all the widgets.
I can investigate tomorrow I guess, but I don't think that it has anything to do with what we are doing on our side
this should probably be solved by 3.0
Min RK
@minrk
Feb 03 2015 23:22
@SylvainCorlay good catch. Can you open an issue and ping @jdfreder?
Jason Grout
@jasongrout
Feb 03 2015 23:35
@minrk: we solved the numpy traitlets issue a while ago and submitted a PR that was merged....
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 23:38
@minrk done
Min RK
@minrk
Feb 03 2015 23:38
@jasongrout thanks, I had forgotten about that.
Jonathan Frederic
@jdfreder
Feb 03 2015 23:39
Thanks @SylvainCorlay I'll check it out
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 23:39
is there a way we can mark the early validation hook as 3.0 ? :)
Jonathan Frederic
@jdfreder
Feb 03 2015 23:40
I think that is @minrk 's department.
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 23:41
a :beer: for a merge / just that I see all the places where it would be cleaner to use that in our code.
and it mostly removes code.
Thomas Kluyver
@takluyver
Feb 03 2015 23:49
At this point, I don't think we should be landing API changes to traitlets. If we like it, maybe it could be backported to a 3.x release, but I'm not convinced about that - the .x releases should be bugfixes, not new features.
Sylvain Corlay
@SylvainCorlay
Feb 03 2015 23:53
It is essentially removing dead code.
The feature is a 2-lines change that allows one to add their own validation function.
I don't think that there is any chance for it to have any side effect.
Thomas Kluyver
@takluyver
Feb 03 2015 23:58
I want to think about the API, though
e.g. why does it involve passing a function to a metadata argument, rather than defining a _foo_validate function, the way we already have _foo_default and _foo_changed?