These are chat archives for ipython/ipython

6th
Nov 2014
Andreas Klostermann
@akloster
Nov 06 2014 12:27
any news on saving widget state to the notebook? Or is it still necessary to workaround with javascript-output?
Caleb Hyde
@clebio
Nov 06 2014 15:39
hello. I'm trying to use InteractiveShellEmbed in an app manager, and am having issues with tab-completion of regular "import" statements. Not sure whether this is the right venue, but I don't find anything apropos via searches, and I don't find any examples in the Ipython docs (just the module docs).
Perhaps I should be using something else instead of InteractiveShellEmbed (e.g. TerminalIpythonApp)? These issues seem potentially related: inducer/pudb#103, ipython/ipython#6635.
Jonathan Frederic
@jdfreder
Nov 06 2014 16:10
@akloster it's pending on another PR
Persistence API ipython/ipython#6789
PR that it's pending on ipython/ipython#6818
Jason Grout
@jasongrout
Nov 06 2014 16:31
@jdfreder: any more progress on the promise stuff?
Jonathan Frederic
@jdfreder
Nov 06 2014 16:32
Hey @jasongrout I posted some more in the PR
The messages are sent from the back-end in the right order
and received in the front-end in the same order
so something weird is happening in the promise logic
My plan today is to
  1. Try using rvsp.js 's debugging tools to figure out what is happening
  2. If rsvp.js doesn't have the tools I need, I'll add a log statement in every Promise to see the chain of events
Jason Grout
@jasongrout
Nov 06 2014 16:40
(I would probably have tried the opposite order, just because (2) is simpler...)
Is the error sporadic or consistent?
Also, I'm curious why we are using rsvp instead of the slimmer sibling https://github.com/jakearchibald/es6-promise?
If we are really going to use rsvp, then we can remove my custom dict function in utils in favor of rsvp's hash() function
Jonathan Frederic
@jdfreder
Nov 06 2014 16:41
Consistent
Jason Grout
@jasongrout
Nov 06 2014 16:42
and it would probably make more sense to use allSettled when creating a list of views, as it lets whoever can succeed, instead of immediately rejecting like all()
Jonathan Frederic
@jdfreder
Nov 06 2014 16:42
rsvp looked like a more popular option
Jason Grout
@jasongrout
Nov 06 2014 16:42
so the question may be: do we want to have another dependency, or just a small shim for exactly what will be browser-native functionaity?
(i.e., the shim can eventually go away, but the dependency probably won't)
does rsvp fall back to the native browser when it can?
Jason Grout
@jasongrout
Nov 06 2014 16:49
I think initially I'd vote for just using the polyfill
with a goal of eventually transitioning to just the browser.
but you know the libraries better than me
Jonathan Frederic
@jdfreder
Nov 06 2014 16:57
No I don't know the Promise libraries better than you
I just started looking at these libraries too!
:P
The https://github.com/jakearchibald/es6-promise project that you pointed out
is rsvp
just reduced to the same feature set as ES6 promises
Jason Grout
@jasongrout
Nov 06 2014 16:59
right -- I got it out of the rsvp readme
and it's a polyfill, so it doesn't override the native functionality if it's there
I would say, just like websockets, we should use the native browser functionality, and then polyfill as necessary
rather than having another dependency
Jonathan Frederic
@jdfreder
Nov 06 2014 17:01
ok
we can use the reduced jakearchibald library
I was also attrached to rsvp for it's debugging abilities
Jason Grout
@jasongrout
Nov 06 2014 17:02
which means we would still need my crude implementation of rsvp.hash, but oh well.
if rsvp has much better debugging, then maybe that's better.
Jonathan Frederic
@jdfreder
Nov 06 2014 17:02
but looking at it closer (https://github.com/tildeio/rsvp.js/#instrumentation) , I'm not sure it would be helpful anyways
I think logs would really be best in this context
Jason Grout
@jasongrout
Nov 06 2014 17:03
but I'd say you probably need to make a case for a new dependency, rather than just using the native browser functionality (and if necessary, a polyfill)
Jonathan Frederic
@jdfreder
Nov 06 2014 17:03
yeah
the rsvp ipython-components PR hasn't been merged
I'll just open another, polyfill one to supersede it
@/all Are we still doing meetings on the half before 10PST?
@/all or are we back to 10PST sharp?
Semi-sharp* Dull*
Min RK
@minrk
Nov 06 2014 17:15
I think 9:30, we'll see who shows up.
Jonathan Frederic
@jdfreder
Nov 06 2014 17:17
Ok
I'll be there
I'm not on campus right now
and I won't try to drive there in the middle of our meeting again
;)
Thomas Kluyver
@takluyver
Nov 06 2014 17:18
I'm here. @minrk are you coming in for the meeting? If not, shall I run it from here?
Jessica B. Hamrick
@jhamrick
Nov 06 2014 17:19
I’m here too, good morning!
Thomas Kluyver
@takluyver
Nov 06 2014 17:19
:)
good morning!
Jonathan Frederic
@jdfreder
Nov 06 2014 17:28
st
whoops
wrong window
(that's my alias for git status)
Thomas Kluyver
@takluyver
Nov 06 2014 17:29
heh
I have said glip to someone in GMail chat before - Goto Label IPython
Jonathan Frederic
@jdfreder
Nov 06 2014 17:29
Haha
That's the only downfall of a wide workspace, it's easy to loose track of which window has input focus.
it's go time
@ellisonbg 9:30 meeting?
Kyle Kelley
@rgbkrk
Nov 06 2014 17:36
On the road to Texas, likely can't join.
Min RK
@minrk
Nov 06 2014 17:36
@rgbkrk ok
Kyle Kelley
@rgbkrk
Nov 06 2014 17:36
i could jump on for a short bit if we talk coordination of the nature demo
Min RK
@minrk
Nov 06 2014 17:36
We can do that later today
Kyle Kelley
@rgbkrk
Nov 06 2014 17:37
at the moment, signal ok
ok cool
were staying at a hotel tonight so we can sync up later
Jason Grout
@jasongrout
Nov 06 2014 18:09
@jdfreder: I'm here listening to the youtube feed for the promise discussion
Jonathan Frederic
@jdfreder
Nov 06 2014 18:13
ok :)
Jason Grout
@jasongrout
Nov 06 2014 18:21
hehe...not only do we have properties, but we also have promises and yield in js :)
a backwards-compatible shim
= polyfill
like sockjs for websockets
I think we really need to delimit what browsers we are supporting currently
it will make deciding on technology and polyfills much easier
Jonathan Frederic
@jdfreder
Nov 06 2014 18:33
^ it would be nice if we had it listed in our GitHub README.md, i.e. Supported Browsers: Mozilla Firefox X, Goog.. etc
+1
Jason Grout
@jasongrout
Nov 06 2014 18:54
it has to be a good meeting to make up for no meeting at all :)
re: narrative text - I bet for every algorithm, there is a counter-algorithm that generates random text that scores high
Jason Grout
@jasongrout
Nov 06 2014 19:05
thanks, everyone!
Jonathan Frederic
@jdfreder
Nov 06 2014 19:11
Back to async. debugging, woohoo! :horse:
Min RK
@minrk
Nov 06 2014 21:03
@jdfreder thanks for the pointer, I installed latest casper (1.1b3), and tests are running fine on Travis with slimer.
Jonathan Frederic
@jdfreder
Nov 06 2014 21:03
oh good good
I'm glad that worked
Patrick Brockmann
@PBrockmann
Nov 06 2014 21:49
A question about a magic extension I have coded. Is there a way to disable python formatting or highlight syntax for python since inside the cell magic I am not anymore in a python code ?
Thomas Kluyver
@takluyver
Nov 06 2014 21:50
if the name of the cell magic is a mode codemirror recognises, it should use that instead
beyond that, I don't think we have a way to turn off the formatting.
Patrick Brockmann
@PBrockmann
Nov 06 2014 21:54
The highlight of color is not really a problem even if the colors does not match exactly to the connected language (here ferret from the PMEL used by oceanographers and model scientists), the problem comes from the tabulation that the cell formatting imposes.
@jdfreder what do you mean by a mode codemirror ?
Thomas Kluyver
@takluyver
Nov 06 2014 22:01
codemirror is the text editor component we use in the cells
its 'modes' control things like highlighting and indentation rules
so if it's in Python mode, as it is by default for IPython, it treats the code you're typing in as Python
we don't currently have a good way to override the mode for a single cell
if 'ferret' was a codemirror mode, then IPython would recognise a %%ferret cell magic and switch to that
but I doubt it is a codemirror mode
Jason Grout
@jasongrout
Nov 06 2014 22:03
@jdfreder: so did you find what was wrong with promises?
Patrick Brockmann
@PBrockmann
Nov 06 2014 22:23
Ok I have discovered codemirror use (thanks) and I could think to create one for ferret. Now where do I indicate this in my ferretmagic.py extension. If someone could point me an example from extension for octave (https://github.com/blink1073/oct2py/blob/master/oct2py/ipython/octavemagic.py) that would be nice.
Thomas Kluyver
@takluyver
Nov 06 2014 22:29
Octave doesn't do anything with codemirror, as far as I know. It just gets it because the name 'octave' is a codemirror mode for octave.
Jonathan Frederic
@jdfreder
Nov 06 2014 22:32
@jasongrout I haven't looked at it since early this morning- I've been running around like a mad man today. I'm looking at it for the next half-hour, then I'll be away for a little bit, then I'll look at it some more tonight if the logs aren't obvious.
Jason Grout
@jasongrout
Nov 06 2014 22:38
no pressure. I saw your comment that "oh good good, I'm glad that worked" and hoped you were talking about promise. then I saw Min's comment
Patrick Brockmann
@PBrockmann
Nov 06 2014 22:39
@takluyver "if 'ferret' was a codemirror mode, then IPython would recognise a %%ferret cell magic and switch to that
but I doubt it is a codemirror mode", I understand that if an codemirror for ferret would exist, then IPython would recognize my ferret code (hightlight and tabulations), the one in my %%ferret cell magic. But what is the mechanism to link the 2 ?
Thomas Kluyver
@takluyver
Nov 06 2014 22:44
just the name
%%blah will look for a 'blah' mode for codemirror
but if there's no such mode, it just leaves it as Python
since there are cell magics, like %%timeout, where the code is Python
sorry, %%timeit
Patrick Brockmann
@PBrockmann
Nov 06 2014 22:58
OK I will try to build a codemirror for ferret and test it locally. Would be nice to be able to deliver the codemirror (here a ferret.js file) when one writes an extension and when the %%install_ext is done.
Thomas Kluyver
@takluyver
Nov 06 2014 23:03
it would, but that's tricky
particularly getting it loaded in the JS
@jdfreder I'm playing with promises. Is there a neat way to resolve a promise from outside its definition?
At the moment, I just attach the resolve callback to an object outside the promise.
Jonathan Frederic
@jdfreder
Nov 06 2014 23:35
Promise.resolve()
I'm not sure if that's also an instance method
but I know it works as a static method- it creates a resolved promise for you
Thomas Kluyver
@takluyver
Nov 06 2014 23:36
yep, creating a pre-resolved promise is easy
none of the examples show it resolving an existing one
it's worth a try, though
nope, resolve is not a method on the instance