These are chat archives for ipython/ipython

21st
Jan 2015
Doug Blank
@dsblank
Jan 21 2015 02:54
@minrk Attempting to install some nbextensions in the new system folder, and IPython.load_extensions([...]) in an extended notebook.html template. First, does that sound reasonable? And second, what would the Javascript look like in the notebook.html (eg, how to wait until IPython is ready)?
Doug Blank
@dsblank
Jan 21 2015 03:21
Ok, I think I have something for a template:
    require(['base/js/namespace', 'base/js/events'], function (IPython, events) {
        events.on("app_initialized.NotebookApp", function () {
            IPython.load_extensions("calico-publish");
        });
    });
Min RK
@minrk
Jan 21 2015 03:44
something like that should work.
Doug Blank
@dsblank
Jan 21 2015 03:48
Thanks for looking at that... it appears to do the right thing. Allows us to customize all of the default users' nbextensions for them. We have two courses starting up here (Bryn Mawr College) this week: Computational Methods in Physics (in Python 3), and Introduction to CS (in Processing).
Jessica B. Hamrick
@jhamrick
Jan 21 2015 03:53
Hmm, when I load new pages of the dashboard remotely, it is kind of a poor experience
Blank screen for 5-6 seconds, with no loading icon in the tab to indicate that anything is happening
Has anyone else had this experience too?
I imagine that it’s blocking on loading some resource first
But it would be nice if it could show something (e.g. the jupyter logo) and still have the spinny icon in the tab to indicate that the page is still loading
Ah, I bet the answer is that the browser actually does finish loading the page, but then it makes some ajax requests for stuff before it displays content, hence the browser thinks it is done loading even though it’s not
Doug Blank
@dsblank
Jan 21 2015 03:57
@jhamrick It does seem to have gotten sluggish just recently; watching the Javascript console seems to confirm your suspicions
Min RK
@minrk
Jan 21 2015 04:06
We really should be concatenating our js. I took a stab at it recently, and it was working, but we decided to hold it for after 3.0, so we could get it right.
Jessica B. Hamrick
@jhamrick
Jan 21 2015 04:06
That makes sense
Do you think that’s the issue?
Just javascript?
Min RK
@minrk
Jan 21 2015 04:07
Looking at the timeline, I think it's the serialized requests for all our javascript.
one nice thing about require is that it lets us express dependencies as they actually are, as a graph.
But a disadvantage of that (without minification) is that it makes one request for main.js, has to wait for the file to download, resolve the next set of dependencies, and repeat until the dependency graph is full.
Earlier, we had a list of .js files in the template, and all files were fetched concurrently, rather than in rounds.
(I'm looking at the Network tab in the Chrome dev tools)
Jessica B. Hamrick
@jhamrick
Jan 21 2015 04:09
Ah, I see
Yeah, it’s definitely the javascript
Hmm
Min RK
@minrk
Jan 21 2015 04:10
Which should be cached, so the second load is faster, right?
Jessica B. Hamrick
@jhamrick
Jan 21 2015 04:10
Yeah, the second one is much faster
(I tend to have the developer tools open a lot, which disables caching, so I notice it all the time)
I’ll open an issue for this particular behavior, to keep track of it — is there an issue for the javascript minification I should link it to?
Min RK
@minrk
Jan 21 2015 04:17
I'm not sure if there's an Issue, but the PR is #6580. If you want to open a new issue and link to the PR, that would be a good idea.
Jessica B. Hamrick
@jhamrick
Jan 21 2015 04:18
Cool, thanks
Dale Jung
@dalejung
Jan 21 2015 07:16
What PR is "server-side extensions"?
Jessica B. Hamrick
@jhamrick
Jan 21 2015 21:27
Is there an easy way to disable the “delete” button on the dashboard?
(I don’t want my students to be able to accidentally delete their notebooks, because that will be a pain to deal with)
Jessica B. Hamrick
@jhamrick
Jan 21 2015 21:34
I suppose I could set chmod -w on the directory
Then they can’t create files, but maybe that’s ok
Matthias Bussonnier
@Carreau
Jan 21 2015 21:55
@jhamrick custom.js and monkeypatch ?
Ping me i you like on an issue and I can have a look.
Jessica B. Hamrick
@jhamrick
Jan 21 2015 21:56
Yeah, I could do that, I was just hoping there was some config option or something I didn’t know about
Scott Sanderson
@ssanderson
Jan 21 2015 22:55
@jhamrick I'm thinking about the same problem at the meta-level for jupyterhub
wondering if there's a clean way to prevent users from killing their notebook servers
Jessica B. Hamrick
@jhamrick
Jan 21 2015 22:56
Yeah, it seems like it would be nice to have an easy way to configure these types of options
Unfortunately I think it’s probably hard to come up with a clean way to do that for GUI things like this
Hrm.
(That is, without special casing everything)
Scott Sanderson
@ssanderson
Jan 21 2015 22:58
I wrote about this problem a little bit in the discussion here: https://github.com/ipython/ipython/issues/6856#issuecomment-63412063
the high-level idea is that you could think about jinja template blocks the same way that you think about the methods of IPython's configurable classes; as defining an API that can be overridden by subclass/subtemplate implementations,
but that would require a big commitment to page/document structure that I don't think the project is ready to make yet
b/c there's a tradeoff between providing a stable API for extension and having the ability to make changes
Jessica B. Hamrick
@jhamrick
Jan 21 2015 23:05
Hmm, yeah, I like that idea a lot, but probably is premature until the overall UI is settled