These are chat archives for ipython/ipython

22nd
Jan 2015
Dale Jung
@dalejung
Jan 22 2015 00:14 UTC
I've gone to making delete just move the notebook to an archive directory. Not sure if something like that would be preferable.
Thomas Kluyver
@takluyver
Jan 22 2015 01:13 UTC
'Recycle bin'?
Zachary Jones
@bigzachattack
Jan 22 2015 03:41 UTC
Is there a way to hide the default kernel spec and just show the other kernel specs installed?
Thomas Kluyver
@takluyver
Jan 22 2015 04:25 UTC
We talked about having a configurable list of kernels to show
I forget whether that got implemented yet
Zachary Jones
@bigzachattack
Jan 22 2015 04:50 UTC
@takluyver I have not seen anything merged into master and could not find any issues about it. The best idea I have come up with so far for my use case it to make a custom Kernel (Spec?) Manger that does not return the default kernel.
Jason Grout
@jasongrout
Jan 22 2015 15:17 UTC
what is the current state of doctesting notebooks. Is there an existing way to convert a notebook to a doctest file, or even better, and sphinx rst file that could be included in standard documentation?
Jason Grout
@jasongrout
Jan 22 2015 15:59 UTC
Here's an idea for using IPython notebooks for documentation: a python package can "register" a directory of notebooks, just like registering an nbextension. Somehow, these notebooks are available to the user in the UI (perhaps under the help menu or something). When one of these notebooks is opened, a copy is made to a temporary directory and the notebook is opened there. Even better, there would also be a way to "doctest" the notebook, perhaps using something like Min's https://gist.github.com/minrk/2620735 gist.
Jason Grout
@jasongrout
Jan 22 2015 16:04 UTC
Or perhaps the package notebooks would be a fourth tab in the tree layout.
Jessica B. Hamrick
@jhamrick
Jan 22 2015 16:07 UTC
@jasongrout this is probably not exactly what you’re looking for (more targeted towards students), but worth checking out: https://github.com/catherinedevlin/ipython_doctester
Jason Grout
@jasongrout
Jan 22 2015 16:13 UTC
thanks. I saw that too. And you're right; I'm looking for testing whole packages.
(and not just checking code that is purely written in the notebook)
Jessica B. Hamrick
@jhamrick
Jan 22 2015 16:13 UTC
Yeah, that’s what it sounded like
Min RK
@minrk
Jan 22 2015 16:49 UTC
@jasongrout @ellisonbg has had pretty much that idea for our own examples. Not sure how to implement it, but it's a good idea.
Jason Grout
@jasongrout
Jan 22 2015 16:52 UTC
brainstorming here: we have this nice framework for registering extensions/kernels. It seems natural to extend it to example notebooks as well.
and just like /nbextensions provides a single namespace for all registered nbextensions, we could have a /examples namespace for all registered examples
Then we modify the tree page template to have a fourth tab for example notebooks, which basically looks like the current file browser, but amalgamates the registered examples
clicking on an example notebook creates a copy in a temporary directory (do we already have something that can do that easily?).
I just talked to Sylvain, and he's also wanted this for a while too...
Min RK
@minrk
Jan 22 2015 17:13 UTC
it's definitely something we should investigate for the next release
Jason Grout
@jasongrout
Jan 22 2015 17:13 UTC
Thanks. I'm investigating it right now.
reading through the nbextensions.py code...
Min RK
@minrk
Jan 22 2015 17:14 UTC
But definitely not for 3.0.
Jason Grout
@jasongrout
Jan 22 2015 17:16 UTC
ahem: "current release" == 2.x. "next release" == 3.0 :)
Min RK
@minrk
Jan 22 2015 17:17 UTC
By current, I mean the feature frozen release we are curently working on.
Jason Grout
@jasongrout
Jan 22 2015 17:17 UTC
sure.
doesn't stop me from putting in a PR... :)
Min RK
@minrk
Jan 22 2015 17:18 UTC
not at all, but don't expect too much feedback before we get 3.0 out the door.
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 17:18 UTC
+1 for that feature in the "next" release ;)
Min RK
@minrk
Jan 22 2015 17:19 UTC
There are several PRs already waiting for the dust to settle, and this one would be a welcome addition to the pile.
Jason Grout
@jasongrout
Jan 22 2015 17:19 UTC
I welcome very much 3.0 getting out the door soon.
Min RK
@minrk
Jan 22 2015 17:20 UTC
Me, too!
So close...
Brian E. Granger
@ellisonbg
Jan 22 2015 17:21 UTC
Jason, we have been thinking about something like this for documentation for a while - but it has to work with packages in all languages
Meeting today at 9:30?
Jason Grout
@jasongrout
Jan 22 2015 17:23 UTC
it's just registering a directory of example notebooks. Are you saying we should be smarter, say by insisting on a directory structure that includes language information, and then only displaying the examples in the language selected in the notebook interface, or something?
Thomas Kluyver
@takluyver
Jan 22 2015 17:24 UTC
as we've found with kernelspecs, there's no 'just' about the notion of registering something.
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 17:25 UTC
"scope"/"feature-freeze" question for @minrk : I was busy on other things lately, but I was wondering if I could squeeze-in a few very minor things:
  • a Valid widget (3 lines of code) inherits from _Bool. Just a green/red check box, typically for showing if an input is valid. I use it a lot. Naturally falls by the checkbox etc...
  • a font-awesome icon traitlet attribute for buttons.
  • a change in some trait error message.
  • the reverse lookup in widget_selection could take an optional equality predicate to handle the case where the values are numpy arrays (overloaded ==)
Jason Grout
@jasongrout
Jan 22 2015 17:25 UTC
right; the hope is that we "just" copy from the implementations of kernelspecs and/or nbextensions. But I appreciate that it may not be an afternoon hack.
@SylvainCorlay - almost all of those things could also be merged into widgets after the big repo split. (what is the trait error message thing, though?)
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 17:26 UTC
btw, what I meant would be interesting for 3.0 was the accessibility of IPython example notebooks (and registered nb extensions notebooks), not automatic generation of notebook-based docs.
Jessica B. Hamrick
@jhamrick
Jan 22 2015 17:27 UTC
Is there a meeting today?
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 17:29 UTC
Just that the wording is a bit weird in some cases:
"The 'orientation' trait of an Axis instance must be any of ['horizontal', 'vertical'], but a value of 'vertically' <type 'str'> was specified."
But a value of 'vertically' -> but the value 'vertically'
Thomas Kluyver
@takluyver
Jan 22 2015 17:30 UTC
I think we're having a meeting today, yes
@minrk how far off are you?
Brian E. Granger
@ellisonbg
Jan 22 2015 17:30 UTC
I think it is not sustainable for us to invent a new package/installation system for each type of extension point related to the project
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 17:31 UTC
Making core ipython's example notebooks somehow accessible would be interesting.
Brian E. Granger
@ellisonbg
Jan 22 2015 17:32 UTC
I am available for a meeting
Thomas Kluyver
@takluyver
Jan 22 2015 17:32 UTC
Min has just arrived, so I guess we'll start soon
Min RK
@minrk
Jan 22 2015 17:39 UTC
I didn't think we were just doing another regular meeting like Tuesday.
Kyle Kelley
@rgbkrk
Jan 22 2015 17:39 UTC
If you want I can wear a silly hat
Min RK
@minrk
Jan 22 2015 17:39 UTC
@rgbkrk perfect
Jessica B. Hamrick
@jhamrick
Jan 22 2015 17:39 UTC
Can you send a link?
jasongrout @jasongrout looks forward to the non-regular meeting
Jason Grout
@jasongrout
Jan 22 2015 17:41 UTC
and the youtube link?
Jason Grout
@jasongrout
Jan 22 2015 17:44 UTC
Thanks!
Matthias Bussonnier
@Carreau
Jan 22 2015 17:46 UTC
Capture d’écran 2015-01-22 à 18.46.12.png
for @minrk where is show paint rectangles
Thomas Kluyver
@takluyver
Jan 22 2015 18:02 UTC
@ellisonbg are you coming back? There's a few points in the agenda that we'd like to discuss with you.
Jason Grout
@jasongrout
Jan 22 2015 18:05 UTC
personally, I like that link and dlink have the same API and the same functionality, so they are drop-in replacements
Min RK
@minrk
Jan 22 2015 18:13 UTC
@jasongrout I thought the confusion was that they were not drop-in replacements
but looked like they should be
Jason Grout
@jasongrout
Jan 22 2015 18:14 UTC
I think in the context of a widget, they are. They should be.
Thomas Kluyver
@takluyver
Jan 22 2015 18:14 UTC
I think the traitlets versions can replace any use of the JS versions, but not vice versa
the JS ones work in a subset of cases where the traitlets ones do
Jason Grout
@jasongrout
Jan 22 2015 18:22 UTC
right. the point is that they are imported from the widgets package, and in that context, they are drop-in replacements. Sort of like overriding methods in a child class.
Min RK
@minrk
Jan 22 2015 18:25 UTC
From the code, it looks like traitlets.link links traitlets, and widgets.link links widgets (not widget traitlets) right?
That doesn't sound like a drop-in replacement, to me.
Since it's linking a totally different kind of object
one links HasTraits, the other links Traits
Jason Grout
@jasongrout
Jan 22 2015 18:28 UTC
functionally, for synced attributes of widgets, it is a drop-in replacement. In the widget context, both link synced widget traitlets (e.g., IntSlider().min could be linked to another IntSlider().max)
Min RK
@minrk
Jan 22 2015 18:29 UTC
though the signature is not compatible
Jason Grout
@jasongrout
Jan 22 2015 18:29 UTC
widgets.link links widget traitlets
Min RK
@minrk
Jan 22 2015 18:29 UTC
ok
so its signature is link((w1, 'trait'), (w2, 'other_trait'))?
Jason Grout
@jasongrout
Jan 22 2015 18:30 UTC
right. (it should be---I haven't looked at the code in a bit)
Min RK
@minrk
Jan 22 2015 18:30 UTC
(there's no indication of how it should be called from code or docstrings)
Jason Grout
@jasongrout
Jan 22 2015 18:31 UTC
ah, that's a problem that should definitely be remedied
it is "documented" in an example notebook, though
Min RK
@minrk
Jan 22 2015 18:31 UTC
Maybe the fix is to add a docstring and argument validation Python-side.
Jason Grout
@jasongrout
Jan 22 2015 18:31 UTC
+1 to argument validation on the python side checking the validation on the js side
and of course, +1 to adding docs
Min RK
@minrk
Jan 22 2015 18:32 UTC
Right now, it just checks that it's a tuple, but it should probably go as far as verify that it's all (Widget, name of trait(sync=True))
Thanks for clarifying that, I think that ought to do.
Jason Grout
@jasongrout
Jan 22 2015 18:32 UTC
oh, you mean type validation. Sure, fair enough.
does the traitlets verify the types of its arguments?
the traitlets.link?
Min RK
@minrk
Jan 22 2015 18:33 UTC
It may not, but it should as well.
Jason Grout
@jasongrout
Jan 22 2015 18:33 UTC
+1.
+1 in general to having typed arguments :)
sometimes I'm jealous of Julia
Min RK
@minrk
Jan 22 2015 18:37 UTC
ah, also the signature doesn't match. traitlets.link accepts *args, widgets.link accepts (args)
Jason Grout
@jasongrout
Jan 22 2015 18:39 UTC
from widget_link.py:
def link(*args):
    return Link(widgets=args)
so I think it's the same signature, no?
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 18:42 UTC
they should have the same signature
regarding the name conflicts: Namespaces are one honking great idea !
is there really a need to rename?
Kyle Kelley
@rgbkrk
Jan 22 2015 18:53 UTC
Docker builds are off to the races
Once all that gets finished I'll deploy a new setup for the try site
It's going straight from master though, we didn't really discuss what stable tag we're ending up on
Just the 3.x branch?
Kyle Kelley
@rgbkrk
Jan 22 2015 18:59 UTC
Alright, I'm heading out the door and hitting the road.
Jason Grout
@jasongrout
Jan 22 2015 19:17 UTC
@takluyver: do you happen to know why install_nbextension doesn't use shutil.copytree, but instead walks the directory and manually copies files over?
ah, never mind; It checks for the modification time before copying.
Sylvain Corlay
@SylvainCorlay
Jan 22 2015 19:30 UTC
@minrk missed your previous messages re: the fact that widgets.link and traitlets.link are two different things because the former can only link widget attributes. You are totally right. Good reason to give it different names.
Jason Grout
@jasongrout
Jan 22 2015 19:41 UTC
I still think it's fine to have the same names (namespaces are great to distinguish them!). But I don't feel super strongly about it...
Jason Grout
@jasongrout
Jan 22 2015 19:54 UTC
Did you know that install_nbextension actually copies the files over every single time on python 2.7.9 on a modern linux?
I think it's related to this bug: http://bugs.python.org/issue12904
Basically, if we use shutil.copy2 (which should copy the modification time from the source to the destination), it doesn't actually quite copy the right time over.
So basically, the following code doesn't work:
Thomas Kluyver
@takluyver
Jan 22 2015 19:58 UTC
Another reason to use Python 3 ;-)
Jason Grout
@jasongrout
Jan 22 2015 19:58 UTC
s is a filename
In [43]: oldtimes=(os.stat(s).st_atime, os.stat(s).st_mtime)

In [44]: os.utime(s, (oldtimes))

In [45]: newtimes=(os.stat(s).st_atime, os.stat(s).st_mtime)

In [46]: oldtimes==newtimes  
Out[46]: False
In [47]: oldtimes[0]-newtimes[0]
Out[47]: 9.5367431640625e-07

In [48]: oldtimes[1]-newtimes[1]
Out[48]: 9.5367431640625e-07
basically, getting the times gets them in nanosecond precision, but setting them only sets them in microsecond precision.
Min RK
@minrk
Jan 22 2015 20:16 UTC
I would be okay with example installation requiring Python 3 :)
Jason Grout
@jasongrout
Jan 22 2015 20:23 UTC
this is about installing nbextensions...
are there any other core devs that are still on python2?
yep, it works great in python 3.4, but not in anaconda python 2.7.9
Jason Grout
@jasongrout
Jan 22 2015 21:30 UTC
when running iptest html in python 2.7.9, I get a lot of errors like this:
ERROR: test_update_file (IPython.html.tests.test_nbextensions.TestInstallNBExtension)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "...test_nbextensions.py", line 56, in setUp
    touch(fullpath)
  File "...test_nbextensions.py", line 29, in touch
    open(file, 'a').close()
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0192' in position 25: ordinal not in range(128)
this seems to be one of those unicode problems. Is this test (and many other like it that call the touch() function in that test file) supposed to pass on python2?
Olga Botvinnik
@olgabot
Jan 22 2015 23:41 UTC
hello, we are having errors with ipython notebooks opening, we can refresh and save them, but cannot run any commands
they appear as busy
I've cleared my browser cache "from the begining of time" and now I get an error that underscore-min.map and bootstrap-min.map aren't found:
Default extension for cell metadata editing loaded.
rawcell.js?v=b2fd7b68ffaa1a0743822566e51d51bb:87 Raw Cell Format toolbar preset loaded.
slideshow.js?v=e0de0a8feb75f511d163c5950b465e86:48 Slideshow extension for metadata editing loaded.
main.js?v=29279aa747f4ab954902e8ee192bdc1a:29 patching CM for undefined indent
:7700/static/components/underscore/underscore-min.map:1 GET http://localhost:7700/static/components/underscore/underscore-min.map 404 (Not Found)
main.js:334 Live slideshow extension correctly loaded
utils.js?v=2833d86aa2a81d8cbb18115b9f4c0423:31 Loaded extension: IPython-notebook-extensions/slidemode/main
:7700/static/components/backbone/backbone-min.map:1 GET http://localhost:7700/static/components/backbone/backbone-min.map 404 (Not Found)
kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:124 Kernel started:  bca9ae1f-483a-4e95-90a8-f0acb6e0c45c
kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:151 Starting WebSockets: ws://localhost:7700/api/kernels/bca9ae1f-483a-4e95-90a8-f0acb6e0c45c
oops I should be in help
see you there :)