Gabriele Lanaro | 31 Oct 00:31 2014
Picon

Custom communication with IPython notebook widgets

Hi! I'm trying to develop a complex widget (a molecular viewer) that is able to display multiple representations of the same chemical system.

I am aware of the traitlets system and how it works but I was wondering if it's possible to develop an API of this kind:

mv = MolecularViewer() # that's a DOMWidget
mv.call_method("addSurface", params)
# That would trigger a method in the corresponding javascript code
#
#  MolecularViewer = IPython.DOMWidget.extend{
#  ...
#  addSurface = function(params) {
#      ....
#         } 
#  }

I've seen there is a "send" method of the IPython.Widget class https://github.com/ipython/ipython/blob/master/IPython/html/widgets/widget.py#L254 that looks like it may be related to sending those custom messages to the JS side, but I fail to understand how this works.

Thank you very much,

Gabriele
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Jeffrey Spencer | 30 Oct 12:51 2014
Picon

Ipython Menu doesn't disappear with shortcut Ctrl+Shift+M in Ubuntu 14.10

I am trying to get the ipython menu to disappear using Ctrl+Shift+m. I used to have no issues with this in previous versions so I could use emacs bindings alt+f to move forward a word. Is it possible to remove the menu like before or I feel it maybe due to the new way ubuntu does menus that it can not be done.

If that is the case is there anyway to remove the keybinding alt+f for activating the menu or just removing the menu before startup so it just doesn't show all the time because I rarely use it.
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Fernando Perez | 28 Oct 01:49 2014
Picon

IPython/Jupyter governance model

Hi all,

for the past couple of weeks, the core devs have been working on trying to formalize what up until now have been our informally maintained governance practices.  The idea is simply that clarifying and making explicit many of these informal practices will make our community healthier as it grows, and easier for newcomers and external agents to engage with, participate in, and become productive members of.

We tried to do the minimal amount of private editing just to make sure that the core devs were comfortable with the language, but the current document should be considered a draft fully open to feedback and discussion from the broader community. It currently lives at:


We'd like to hear any feedback any of you might have.

I'd also like to thank the members of the core team who provided thoughtful, considered and meaningful feedback as we worked on this initial draft together.

All the best,

Fernando, on behalf of the core dev team.

--
Fernando Perez ( <at> fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Gabriele Lanaro | 24 Oct 01:49 2014
Picon

IPython notebook custom widgets fastest way to send a numpy array to javascript

Hi!

I'm trying to use IPython traitlets system to send a NumPy array towards the JS side in an IPython notebook widget (it's a molecular viewer). The array I'm trying to send can be pretty big (like of shape (100000, 3)) as it's an array of 3d coordinates.

What I'm doing right now is:

setup a traitlet like:

class MolecularViewer:
    coordinates = Dict(sync=True)

Then I send the array as a base64 string and type info:

molecular_viewer.coordinates = {'type': dtype,
                                                     'shape', shape,
                                                     'data' : "b64stringrepresentation"}

and I decode back in JS to obtain a TypedArray. Unfortunately the decoding has become a bottleneck (it has to run at interactive speeds possibly).

Do you know a better way to pass large NumPy arrays to javascript (getting a TypedArray on the other side)?

Thank you,

Gabriele
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
klo uo | 23 Oct 21:32 2014
Picon

Start script while starting qtconsole

Hi,

In terminal I can run:

    ipython -i <path-to-my-script>

and everything is as expected - script is executed, namespace populated, waiting my input.

For qtconsole same command errors. I can't find any other way to launch script on qtconsole start except with PYTHONSTARTUP variable. Ok, I've set it, but still not as expected:

After manipulating `sys.path` script ends with lines like this:

...
from anybox.recipe.proj.runtime.session import Session
session = Session(...)

After starting qtconsole I have `Session` object, but not `session` that instantiates it.

Does anyone know why, or is there some more sane way to load a script on qtconsole start without setting environment variables?

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
gary.church1 | 19 Oct 04:15 2014
Picon
Picon

tk: (9)


http://garridomarketing.com.br/6a7d8j9hg0w1t2u3o4b5x.php

Myranda Dettmer
Mark Andrews | 16 Oct 21:59 2014
Picon

start ipython notebook with a particular (not default) firefox profile

(Note: this is an exact copy of a unanswered question I asked on stackoverflow about 1 month ago).

When I launch ipython notebook, I want it to launch firefox but using a particular firefox profile, which is not my default firefox profile.

In my ipython profile, I have

c.NotebookApp.browser = u'/usr/bin/firefox'

and that makes sure that ipython notebook chooses firefox. However, it chooses the default firefox profile, or else the most recently used firefox profile.

From my linux terminal, I can launch my preferred ipython specific firefox profile (named ipython) like this

firefox -P --no-remote ipython

However, doing

c.NotebookApp.browser = u'/usr/bin/firefox -P --no-remote ipython'

does not work at all (ipython doesn't open firefox at all, and skips to the another browswer'), nor does starting ipython notebook like so

ipython notebook --browser 'firefox -P --no-remote ipython'

which leads to and OSError exception.

Does anyone know of a way to launch firefox with the preferred profile?

thanks

Mark Andrews

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Brian Blais | 11 Oct 01:18 2014
Picon

proper animation in notebook?

Hello,

I have just found out how to do animations within an ipython notebook,
by looking at:
http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/Animations%20Using%20clear_output.ipynb

However, when I do it myself I get the animation, but I get a memory
leak - the memory of the python process just keeps growing.  Here's my
code:

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

import sys
import time
from IPython.display import display, clear_output

x=linspace(0,6,100)
for t in linspace(0,20,100):
    clear_output(wait=True)
    f=figure(figsize=(10,10))
    plot(sin(x)*sin(t),'-o')
    gca().set_ylim([-1,1])
    display(f)
    close()

somehow I think it isn't actually deleting the figures from one call
to another, so it is building up in the background, although I am not
sure.  Is there a proper way to do this kind of animation in the
notebook without the memory continually increasing?

thanks!

Brian Blais

-----------------

             bblais <at> gmail.com
             http://web.bryant.edu/~bblais
Julien Schueller | 8 Oct 09:36 2014

lookfor magic extension module

Hi list,

I just uploaded to pypi the lookfor extension module to search through docstrings:
https://github.com/jschueller/lookfor

--

-- 
J
Ivan Ogassawara | 26 Sep 15:21 2014
Picon

Executing some function on IPython is slower than a normal python function

Dear all,

I'm testing some functionalities of ipython and I'm think I'm doing something wrong.

I'm testing 3 different ways to execute some math operation.

  • 1st using  <at> parallel.parallel(view=dview, block=True) and function map
  • 2nd using single core function (python normal function)
  • 3rd using clients load balance function
the code is here:

https://stackoverflow.com/questions/26039254/executing-some-function-on-ipython-is-slower-than-a-normal-python-function

My result is:

True True 0.040741 secs (multicore) 0.004004 secs (singlecore) 1.286592 secs (multicore_load_balance)

Why are my multicore routines slower than my single core routine? What is wrong with this approach? What can I do to fix it?

Some environment information: python3.4.1, ipython 2.2.0, numpy 1.9.0, ipcluster starting 8 Engines with LocalEngineSetLauncher


My best regards,

Ivan Ogassawara



_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
nirinA raseliarison | 25 Sep 01:35 2014
Picon

issues with Notebook and qtconsole after updating IPython

Hi there,
After updating IPython, currently running git commit '3849e0a', I  
encounter similar problem as described here:

http://mail.scipy.org/pipermail/ipython-user/2014-August/013799.html

but the proposed solution, opening different browser, solved only  
partially my problems.
     ipython notebook
seems to work with chromium, opera and firefox but
it doesn't start at all with seamonkey, i get the following error:

<seamonkey error>
ipython notebook
[I 01:23:59.599 NotebookApp] Using existing profile dir:  
'/home/nirina/.ipython/profile_default'
[I 01:23:59.618 NotebookApp] Using MathJax from CDN:  
https://cdn.mathjax.org/mathjax/latest/MathJax.js
[I 01:23:59.657 NotebookApp] Serving notebooks from local directory:  
/home/nirina
[I 01:23:59.657 NotebookApp] 0 active kernels
[I 01:23:59.657 NotebookApp] The IPython Notebook is running at:  
http://localhost:8888/
[I 01:23:59.657 NotebookApp] Use Control-C to stop this server and shut  
down all kernels (twice to skip confirmation).

(process:1297): GLib-CRITICAL **: g_slice_set_config: assertion  
`sys_page_size == 0' failed
[W 01:24:08.486 NotebookApp] Notebook /Untitled0.ipynb is not trusted
[I 01:24:08.850 NotebookApp] Kernel started:  
25d6d157-06a6-4a7c-b1c4-8032b29663ad
[E 01:25:34.884 tornado.application] Uncaught exception GET  
/static/components/codemirror/lib/codemirror.js?v=8dec958ead2e288182a77a5b3d87fe3c  
(127.0.0.1)
     HTTPServerRequest(protocol='http', host='localhost:8888',  
method='GET',  
uri='/static/components/codemirror/lib/codemirror.js?v=8dec958ead2e288182a77a5b3d87fe3c',  
version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language':  
'en-US,en;q=0.5', 'Referer':  
'http://localhost:8888/notebooks/Untitled0.ipynb', 'Host':  
'localhost:8888', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:29.0)  
Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1', 'Accept-Encoding': 'gzip,  
deflate', 'Connection': 'keep-alive', 'Accept': '*/*'})
     Traceback (most recent call last):
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/web.py",

line 1338, in _execute
         result = yield result
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/gen.py",

line 642, in run
         value = future.result()
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/concurrent.py",

line 110, in result
         raise_exc_info(self._exc_info)
       File "<string>", line 3, in raise_exc_info
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/gen.py",

line 645, in run
         yielded = self.gen.throw(*sys.exc_info())
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/web.py",

line 2176, in get
         yield self.flush()
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/gen.py",

line 642, in run
         value = future.result()
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/concurrent.py",

line 112, in result
         raise self._exception
     tornado.iostream.StreamClosedError
[E 01:25:34.916 tornado.general] Cannot send error response after headers  
written
</seamonkey error>

Another issue is with qtconsole,

     ipython qtconsole

seems to work, but:

     ipython qtconsole --profile julia

gives:

<qtconsole error>
/usr/local/lib/python3.4/site-packages/IPython/kernel/manager.py:96:  
UserWarning: Setting kernel_cmd is deprecated, use kernel_spec to start  
different kernels.
   warnings.warn("Setting kernel_cmd is deprecated, use kernel_spec to "
Starting kernel event loops.
ERROR:tornado.application:Exception in callback  
functools.partial(<function wrap.<locals>.null_wrapper at 0x7f7b24078d08>)
Traceback (most recent call last):
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/ioloop.py",

line 565, in _run_callback
     ret = callback()
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
170, in thread_send
     self.session.send(self.stream, msg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 646, in send
     msg = adapt(msg, self.adapt_version)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 152, in object_info_request
     line, _ = code_to_line(code, cursor_pos)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 24, in code_to_line
     return line, cursor_pos
UnboundLocalError: local variable 'line' referenced before assignment
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
407, in _run_callback
     callback(*args, **kwargs)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
179, in _handle_recv
     msg = self.session.unserialize(smsg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 847, in unserialize
     return adapt(message)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 262, in inspect_reply
     new_content['name'] = content['name']
KeyError: 'name'
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
433, in _handle_events
     self._handle_recv()
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
465, in _handle_recv
     self._run_callback(callback, msg)
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
407, in _run_callback
     callback(*args, **kwargs)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
179, in _handle_recv
     msg = self.session.unserialize(smsg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 847, in unserialize
     return adapt(message)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 262, in inspect_reply
     new_content['name'] = content['name']
KeyError: 'name'
ERROR:tornado.application:Exception in callback None
Traceback (most recent call last):
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/ioloop.py",

line 837, in start
     handler_func(fd_obj, events)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
433, in _handle_events
     self._handle_recv()
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
465, in _handle_recv
     self._run_callback(callback, msg)
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
407, in _run_callback
     callback(*args, **kwargs)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
179, in _handle_recv
     msg = self.session.unserialize(smsg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 847, in unserialize
     return adapt(message)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 262, in inspect_reply
     new_content['name'] = content['name']
KeyError: 'name'
</qtconsole error>

i will appreciate any hint,
thanks in advance.
--

-- 
nirinA

Gmane