[IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process

Matthias Bussonnier bussonniermatthias at gmail.com
Wed May 28 12:16:58 EDT 2014

Le 28 mai 2014 à 16:56, Benjamin Ninassi a écrit :

> Again thanks a lot, I made it work with this snipet of code in custom.js (for the record if someone search through this thread):
> $([IPython.events]).on('notebook_loaded.Notebook', function(){
>  var cells = IPython.notebook.get_cells();
>  for(var i in cells){
>    var cell = cells[i];
>    if (!(cell instanceof IPython.CodeCell)) {
>      cell.code_mirror.setOption('readOnly','nocursor');
>    }
>  }
> })

Be careful, with that if your student insert some markdown cell and reload it will prevent him/her from editing.
If you wrap it in a extension, you can probably make a pull request there :


> I'll be happy to provide you with feedback !
> We're preparing a Mooc on robotic with some python exercices that will be available on the governmental french Mooc plateform https://www.france-universite-numerique-mooc.fr/
> (which is based on EDX) at the end of the year, and we were looking for a solution to allow student to quickly be able to do the exercices without having to install python and all the stuff (numpy, matplotlib and so on) on their computer.

Oh, great, will it be integrated into France-OS [1] ?

> Skulpt and other javascript librairy still can't be used with numpy, so I turned on server-side execution with ipython.
> And I'm pretty sure now that ipython will do the trick. :)

Also please use Python 3 :-) 

You might want to have a look at ipydra [2] for deployment.

> We may also add some automatic evaluation to, I'll keep you inform on our progress !

You should speak with :
- Jessica Hamrick who did something similar [3]

Miscs : 

General thing in english  stuff

You might want to contact 
-  Greg Wilson from software carpentry/Mozilla with whom you will share some interest in using notebook to teach
-  Mit Teach Julia using IPython notebook, they have custom stuff, you might want to ping the Julia List. I think that 
    Aaron Culich at Berkeley EECS also probably made some mass deployment of IPython notebook.
- People from SageMath might be of help too as they have online IPython notebook. 

- I prefer not to include link to companies, but ContinuumIO might also be of help as they already deploy wakari.
  Though, they will probably offer you to go with wakari enterprise[6].

(No explicit contact info private mail me if you can't find) 

More French specific stuff

You might want to contact 
- Emanuelle Gouillart and Gael Varoquaux who worked on python pour les classes préparatoires [4].
    (python for undergraduate student french program)	They are near Paris though. 
- Pierre Haessig was involved too in above project IIRC, and should be near you (at Bruz near Rennes), but is finishing his PhD, so might be busy[5].
- Enthought do not have python in the cloud IIRC, but do have French people in their team (Jonathan Rocher at least) which is great if you need support. 
	they are also more hardware oriented than continuum from the demo I have seen, which tend to be better for robotics IIUC.

- You might want to join the other thread on internationalization as I know by experience that french
student tend to not speak english very well until pretty late (Stargate-SG1 you did a better job than my english teacher)

Shameless plug at the end, especially because this seem to be a big project,
and also there seem to be some buzz[8] around notre cher Ministre de l'Économie, 
du Redressement productif et du Numérique[7]. We would highly appreciate
any contribution on IPython and Open  Source community, even more if you
could make your hierarchy understand that and officially put some extra people
 (obviously you are already part of them) or fund to help.

If there is any need for someone from the IPython to come to convince peoples, 
even despite [5], I am in France (for the time being), and Fernando Pérez, speak a 
a perfect French, so I suppose if it is to convince a government agency to fund a project, 
he might find some free time. There are also a handful of French speaking people 
from the SciPy stack I can think of that are around, and I guess could be of help.


> -- 
> Benjamin Ninassi 
> INRIA - SEISM & Mooclab
> Tél. (+33) 02 99 84 73 43 
> benjamin.ninassi at inria.fr 

[1]  http://korben.info/franceos.html  <- french, stupid bad joke 
[2] https://github.com/UnataInc/ipydra 
[3] https://twitter.com/jhamrick/statuses/463930083447566336
[4] https://github.com/python-prepa/python-prepa (fr)
[5] i am too and i spend to much time on IPython ML.
[6]  http://enterprise.wakari.io/
[7] https://fr.wikipedia.org/wiki/Arnaud_Montebourg  (fr)
[8] http://www.numerama.com/magazine/29490-orange-travaille-deja-a-l-os-34made-in-france34-voulu-par-montebourg.html (fr)
> ----- Mail original -----
>> De: "Matthias BUSSONNIER" <bussonniermatthias at gmail.com>
>> À: "IPython developers list" <ipython-dev at scipy.org>
>> Envoyé: Mercredi 28 Mai 2014 15:49:27
>> Objet: Re: [IPython-dev] 2 questions about notebooks : disabling cells for	edition and best hiding menu bar process
>> Le 28 mai 2014 à 15:22, Benjamin Ninassi a écrit :
>>> Thanks a lot for your quick answears !
>>> It should be possible by directly setting the read-only mode to some cell
>>> in CodeMiror itself, but it will require a bit of javscript:
>>> http://codemirror.net/doc/manual.html#option_readOnly
>>> I'll drill into that, thanks ! My major issue will be to identify the cells
>>> that i want to disable through the DOM as they have no ID ... is-it
>>> possible to give them one with metadata ?
>> You cannot (yet) get a dom identity through the metadata, but you can a list
>> of sell by
>> IPython.notebook.get_cells()
>> then loop on all cell and on each cell do approximatively a
>> var ro = (cell.metadata.my_namespace || {}).readonly
>> if(ro === true):
>> 	cell.editor.set_options('readOnly','nocursor')
>> Which should do the desired effect.
>> You might want to capture a few other event like execution request on theses
>> cell by monkey patching
>> the CellClass.prototype.execute
>> CellClass.prototype.old_execute = CellClass.prototype.execute
>> CellClass.prototype.execute = function(){
>> 	if not read only :
>> 		this.old_execute(arguments)
>> }
>>> I suppose css with the same target and display:none in custom.css should
>>> works.
>>> I was supposing that to, but there is a  style="display: block;" generated
>>> in the html for the header div that overwrite the custom.css
>>> #header{   display:none; } …
>> Hum, we should probably fix that then.
>>> No, there is no list. You can grep through the source for IPython.events
>>> out should give yo an idea of existing event,
>>> The rest depend if when using IPython for a MOOC you will be providing the
>>> sever,in which case you can customize it a lot
>>> or if you plan on users to install IPython in which case you probably want
>>> to avoid too aggressive customization.
>>> We will be providing a server, so we can customize it a lot. I'm convince
>>> ipython and notebooks are great tools for online education, providing some
>>> minor adjustments !
>> Then you can probably apply a patch on the template to remove whatever
>> element for the time being.
>> We'll be happy to get your feedback from using the notebook for teaching.
>> --
>> M
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/b3cbe03a/attachment.html>

More information about the IPython-dev mailing list