Wolfgang Kerzendorf | 23 May 2013 15:50
Picon

Using Qt and ipython

Hi there,

I'm interested in using Qt windows together with an ipython session and a couple of matplotlib windows.
I've done it before initializing a QApplication, but it was a very involved process. Is there a 'right way'
to do this? Does anyone have an open source project that does this? Is it maybe better to build a QT
application with an embedded ipython session? 

Cheers
    Wolfgang
MinRK | 22 May 2013 18:28
Picon
Gravatar

Re: using Google Charts in IPython

google.load blanks the page unless you give it a callback.


On Wed, May 22, 2013 at 8:49 AM, victor.zverovich <at> gmail.com <victor.zverovich <at> gmail.com> wrote:
Hi All,

I am trying to use Google Charts in an IPython notebook with the help of IPython.core.display.Javascript:

  from IPython.core.display import Javascript
  Javascript("google.load('visualization', '1.0', {'packages':['corechart']});",
             lib="https://www.google.com/jsapi")

However, loading the visualization API and the corechart package as above makes the notebook go blank after a while.

Any ideas what is going wrong here or is there any other way to use Google Charts with IPython?

Thanks,
Victor

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user


_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
victor.zverovich@gmail.com | 22 May 2013 17:49
Picon
Gravatar

using Google Charts in IPython

Hi All,

I am trying to use Google Charts in an IPython notebook with the help of IPython.core.display.Javascript:

  from IPython.core.display import Javascript
  Javascript("google.load('visualization', '1.0', {'packages':['corechart']});",
             lib="https://www.google.com/jsapi")

However, loading the visualization API and the corechart package as above makes the notebook go blank after a while.

Any ideas what is going wrong here or is there any other way to use Google Charts with IPython?

Thanks,
Victor
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Pierre Raybaut | 22 May 2013 09:39
Picon
Gravatar

Fwd: ipython notebook under WinPython 2.7.4.1: no pylab

Hi there,

As you may read on the forwarded email below, regarding next WinPython [1] release, I was wondering whether to keep the "--pylab=inline" option or not for the "IPython Qt console" and "IPython notebook" launchers [2]. Christoph warned me about the official IPython recommendation which is to not use the "--pylab=inline" command line option and then to turn on the desired pylab mode manually inside the console or the notebook thanks to the "%pylab inline" magic command.

a. Can you confirm that this is the official position on this matter?
b. From the distribution maintainer point of view, I can't complain because that's simpler: it avoids eventually having to create multiple shortcuts (one with pylab inline mode enabled, the other without any option). However, the risk is that beginners won't know about this command and will either think that it's not working or they will use IPython without even knowing about this wonderful feature.

Anyway, if removing the "--pylab=inline" command line option is really the recommended way, why not, as far as every distribution is following this rule and if this is well documented.

[1] WinPython is a portable scientific Python distribution for Windows: https://www.google.com/search?q=winpython
[2] The so-called "launchers" are executables located at the root directory of WinPython which are used as shortcuts to run applications bundled in WinPython (using executables instead of real shortcuts is a way of making shortcuts pointing on relative paths on Windows).

Cheers,
-Pierre

---------- Forwarded message ----------
From: Christoph Gohlke <cjgohlke <at> gmail.com>
Date: 2013/5/22
Subject: Re: ipython notebook under WinPython 2.7.4.1: no pylab
To: winpython <at> googlegroups.com



On 5/21/2013 2:00 PM, Pierre Raybaut wrote:
Ok, so what's you're suggesting is to create only launchers *without*
command line options to "IPython Qt console" and "IPython notebook". The
user will have to turn on the pylab inline mode manually by entering
`%pylab inline` inside the console or the notebook.


That seems to be the stance of the IPython developers. Just wanted to make you aware of it.


The risk is that beginners won't know about this command and will either
think that it's not working or they will use IPython without even
knowing about this wonderful feature. Do you really think I should make
basic launchers, without the pylab mode turned on by default? If this is
really the recommended way, why not, as far as every distribution is
following this rule and if this is well documented.

Maybe you could bring this up on the IPython mailing list?

Christoph



-Pierre


2013/5/21 Christoph Gohlke <cjgohlke <at> gmail.com <mailto:cjgohlke <at> gmail.com>>


    The IPython developers discourage `--pylab inline`. Use `%pylab
    inline` instead. See
    <https://github.com/ipython/__ipython/pull/2635#__issuecomment-12408944

    <https://github.com/ipython/ipython/pull/2635#issuecomment-12408944>>

    Christoph


    On 5/21/2013 2:07 AM, Pierre Raybaut wrote:

        You're right, I'm adding this option in the IPython notebook
        launcher
        for the next release:
        https://code.google.com/p/__winpython/source/detail?r=__83f3930c7b2707b30ed0fa56cfc22a__2b4fa173e6

        <https://code.google.com/p/winpython/source/detail?r=83f3930c7b2707b30ed0fa56cfc22a2b4fa173e6>

        In the meantime, a more satisfying short-term solution would be to
        create your own shortcut and pass the option to the launcher
        directly.
        See the second point ("Bugfix: all launchers [...]") in section
        "Internals" here:
        https://code.google.com/p/__winpython/wiki/ChangeLog_27#__History_of_changes_for_2.7.4.1

        <https://code.google.com/p/winpython/wiki/ChangeLog_27#History_of_changes_for_2.7.4.1>

        HTH,
        -Pierre


        2013/5/21 Thomas Haslwanter <thomas.haslwanter <at> gmail.com
        <mailto:thomas.haslwanter <at> gmail.com>
        <mailto:thomas.haslwanter <at> __gmail.com

        <mailto:thomas.haslwanter <at> gmail.com>>>

             When I launch the "ipython notebook" using the "Ipython
             notebook.exe" in WinPython 2.7.4.1, the ipython notebook
        launches
             *without pylab*. This is a problem, as the "--pylab=inline"
        option
             has - in my understanding - to be specified at startup.

             Is there any way to setpylab=inline after the notebook has been
             launched?

             The short-term solution is to launch "ipython notebook
             --pylab=inline" from the "WinPython Command Prompt.exe"
             In the longer term, please incorporate the "--pylab=inline"
        into the
             "Ipython notebook.exe" launcher.

             --
             You received this message because you are subscribed to the
        Google
             Groups "WinPython" group.
             To unsubscribe from this group and stop receiving emails
        from it,
             send an email to winpython+unsubscribe <at> __googlegroups.com
        <mailto:winpython%2Bunsubscribe <at> googlegroups.com>
             <mailto:winpython%__2Bunsubscribe <at> googlegroups.com
        <mailto:winpython%252Bunsubscribe <at> googlegroups.com>__>.
             For more options, visit
        https://groups.google.com/__groups/opt_out
        <https://groups.google.com/groups/opt_out>.




        --
        You received this message because you are subscribed to the Google
        Groups "WinPython" group.
        To unsubscribe from this group and stop receiving emails from
        it, send
        an email to winpython+unsubscribe <at> __googlegroups.com

        <mailto:winpython%2Bunsubscribe <at> googlegroups.com>.
        For more options, visit
        https://groups.google.com/__groups/opt_out
        <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "WinPython" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to winpython+unsubscribe <at> __googlegroups.com
    <mailto:winpython%2Bunsubscribe <at> googlegroups.com>.
    For more options, visit https://groups.google.com/__groups/opt_out
    <https://groups.google.com/groups/opt_out>.




--
You received this message because you are subscribed to the Google
Groups "WinPython" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to winpython+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "WinPython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to winpython+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Michael McNeil Forbes | 21 May 2013 23:20
Picon

Persistent cluster (launching from laptop)

Hi Everyone,

I have a config for launching a remote cluster via SSH from my laptop, but when I move my laptop from one IP
address to another, I can no-longer access the cluster.

Any suggestions about how I can start a computation at home, then resume at work after my commute?

I am not exactly sure where to start looking here.

One solution is of course to launch the cluster from the remote machine, but it is so convenient to do it from
my laptop:-)

Thanks for any pointers,
Michael.
Florian M. Wagner | 21 May 2013 11:05
Picon

Filename of current IPython notebook

Dear all,

This might be a stupid question, but I could not find anything on this:

Is there a way to get the filename of the current notebook?

Thanks, Florian
George Nurser | 19 May 2013 11:51
Picon

Remote access to ipython notebook server with ssh multi hop

Hi,
My work computers are accessed externally by ssh'ing onto a gateway computer and then from that onto the particular machine I am using.

So to enable direct ssh'ing into say bigserver, in my .ssh/config I have:

Host bigserver
  ProxyCommand ssh -q gateway.com nc bigserver 22

Is there any way that I can externally access an ipython notebook running on bigserver?

The instructions  (for normal single-hop ssh to a server server.com) on 
suggest the key step is to issue on the local machine the command

ssh -N -f -L localhost:6000:localhost:7000 username <at> server.com

so that the ipython server can be found on http://localhost:6000.

Has anybody any ideas on how I could change the above ssh command and/or the .ssh/config to work with multihop ssh? Not surprisingly, there is no success with the straightforward command above, i.e

ssh -N -f -L localhost:6000:localhost:7000 username <at> bigserver

Many thanks, George Nurser.




_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Christopher Brooks | 19 May 2013 05:14
Picon
Picon
Gravatar

ipython magic function repositories?

Hi,

Are there repositories of magic functions somewhere?  Seems like such a
nice framework I'd love to leverage other peoples work much more than I
do...

Chris
--

-- 
Christopher Brooks, PhD
ARIES Laboratory, University of Saskatchewan

Web: http://www.cs.usask.ca/~cab938
Phone: 1.306.966.1442
Mail: Advanced Research in Intelligent Educational Systems Laboratory
     Department of Computer Science
     University of Saskatchewan
     176 Thorvaldson Building
     110 Science Place
     Saskatoon, SK
     S7N 5C9
John Reid | 18 May 2013 19:33
Picon

ValueError: '<IDS|MSG>' is not in list when running several clients

Hi,

I got the following error when running several clients on my cluster.
Each client submitted many jobs and one of them failed with the
traceback below. In my code at the top of the stacktrace 'ar' is an
asynchronous result object. Can anyone provide any pointers as to what
might be going wrong here? It looks to me like some error inside the
ipython parallel implementation.

I wonder if this is related to the blocking problem I reported in an
earlier thread. The code that generated the error is very similar.

python -c "import zmq, IPython as I; print I.__version__, zmq.__version__"

gives:

1.0.dev 13.0.2

Any help appreciated. Thanks,
John.

2013-05-18 17:57:22,744:ERROR: ValueError: '<IDS|MSG>' is not in list
2013-05-18 17:57:22,776:ERROR: Traceback:
  File
"/home/john/Analysis/PWM-scanning-benchmarks/python/scripts/run_method.py",
line 187, in execute_jobs
    duration, size = ar.get()
  File "/home/john/src/ipython/IPython/parallel/client/asyncresult.py",
line 120, in get
    self.wait(timeout)
  File "/home/john/src/ipython/IPython/parallel/client/asyncresult.py",
line 151, in wait
    self._ready = self._client.wait(self.msg_ids, timeout)
  File "/home/john/src/ipython/IPython/parallel/client/client.py", line
1059, in wait
    self.spin()
  File "/home/john/src/ipython/IPython/parallel/client/client.py", line
1007, in spin
    self._flush_iopub(self._iopub_socket)
  File "/home/john/src/ipython/IPython/parallel/client/client.py", line
848, in _flush_iopub
    idents,msg = self.session.recv(sock, mode=zmq.NOBLOCK)
  File "/home/john/src/ipython/IPython/kernel/zmq/session.py", line 658,
in recv
    idents, msg_list = self.feed_identities(msg_list, copy)
  File "/home/john/src/ipython/IPython/kernel/zmq/session.py", line 689,
in feed_identities
    idx = msg_list.index(DELIM)
Florian M. Wagner | 17 May 2013 21:35
Picon

Problems with IPython.parallel on HPC: KeyError: 'msg_id'

Dear IPython users,

for quite a while now, I have been running a parallel computation like this on a local workstation (using 16 engines and IPython 0.13.2), where J and C are large sparse arrays:

from IPython.parallel import Client

# initialize parallel environment
c = Client()
v = c.load_balanced_view()

c[:]['C'] = C
c[:]['J'] = J
c[:].execute('import scipy.linalg as lin')

# This was necessary for J to be found on the engines, I never understood why
c[:]['J']

result = v.map_sync(heavy_function_which_reads_both_J_and_C, list_of_vectors)

This worked fine. Today, I tried to run the exact same code on a HPC (using 128 engines and IPython 0.12). Engines started successfully, but while running the script, I got the following error message:

Traceback (most recent call last):
  File "main.py", line 122, in <module>
    c[:]['J']
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/view.py", line 736, in __getitem__
    return self.get(key)
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/view.py", line 657, in get
    return self.pull(key_s, block=True)
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/view.py", line 676, in pull
    return self._really_apply(util._pull, (names,), block=block, targets=targets)
  File "<string>", line 2, in _really_apply
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/view.py", line 59, in sync_results
    ret = f(self, *args, **kwargs)
  File "<string>", line 2, in _really_apply
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/view.py", line 48, in save_ids
    ret = f(self, *args, **kwargs)
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/view.py", line 535, in _really_apply
    return ar.get()
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/asyncresult.py", line 97, in get
    if not self.ready():
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/asyncresult.py", line 111, in ready
    self.wait(0)
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/asyncresult.py", line 121, in wait
    self._ready = self._client.wait(self.msg_ids, timeout)
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/client.py", line 843, in wait
    self.spin()
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/client.py", line 802, in spin
    self._flush_iopub(self._iopub_socket)
  File "/cluster/apps/python/2.7.2/x86_64/lib64/python2.7/site-packages/IPython/parallel/client/client.py", line 728, in _flush_iopub
    msg_id = parent['msg_id']
KeyError: 'msg_id'

Any hints are highly appreciated!

Have a nice weekend,
Florian




_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Jose Gomez-Dans | 17 May 2013 14:59
Picon
Gravatar

Problems with ipython parallel on LSF

Hi
I am following the instructions on ipython parallel given in jseabold's excellent guide at <http://nbviewer.ipython.org/urls/raw.github.com/jseabold/zorro/master/ipython_hpc_intro.ipynb>. I wanted to use ipython on a LSF cluster. I have followed the instructions in that page, only changing trivial stuff (directories, queue names, etc.). Running 

ipcluster start --profile=hpc --n=2 
seems to work:
013-05-17 13:49:11,562.562 [IPClusterStart] Using existing profile dir: u'/xxxx/.ipython/profile_hpc'
2013-05-17 13:49:11.567 [IPClusterStart] Starting ipcluster with [daemon=False]
2013-05-17 13:49:11.571 [IPClusterStart] Creating pid file: /xxxx/.ipython/profile_hpc/pid/ipcluster.pid
2013-05-17 13:49:11.574 [IPClusterStart] Starting Controller with LSF
2013-05-17 13:49:11.603 [IPClusterStart] Job submitted with job id: '231710'
2013-05-17 13:49:12.598 [IPClusterStart] Starting 2 Engines with LSF
2013-05-17 13:49:12.654 [IPClusterStart] Job submitted with job id: '231711'
2013-05-17 13:49:42.741 [IPClusterStart] Engines appear to have started successfully
2013-05-17 13:53:06.188 [IPClusterStart] IPython cluster: stopping
2013-05-17 13:53:06.188 [IPClusterStart] Stopping Engines...
successfully

bjobs shows ipython in the queue with status RUN, but  if I then open an ipython session (as ipython --profile="hpc"), I don't get any engines:
from IPython import parallel
rc=parallel.Client()
rc.ids  # this returns []

The logged output from ipcontroller seems to suggest that connections did indeed take place as I entered variations of rc=parallel.Client():

2013-05-17 13:49:17,562.562 [IPControllerApp] Using existing profile dir: u'/xxxx/.ipython/profile_hpc'
2013-05-17 13:49:17.576 [IPControllerApp] Hub listening on tcp://*:42013 for registration.
2013-05-17 13:49:17.577 [IPControllerApp] Hub using DB backend: 'NoDB'
2013-05-17 13:49:17.829 [IPControllerApp] hub::created hub
2013-05-17 13:49:17.829 [IPControllerApp] writing connection info to /xxxx/.ipython/profile_hpc/security/ipcontroller-client.json
2013-05-17 13:49:17.838 [IPControllerApp] writing connection info to /xxxx/.ipython/profile_hpc/security/ipcontroller-engine.json
2013-05-17 13:49:17.846 [IPControllerApp] task::using Python leastload Task scheduler
2013-05-17 13:49:17.846 [IPControllerApp] Heartmonitor started
2013-05-17 13:49:17.853 [scheduler] Scheduler started [leastload]
2013-05-17 13:49:17.884 [IPControllerApp] Creating pid file: /xxxx/.ipython/profile_hpc/pid/ipcontroller.pid
2013-05-17 13:49:17.888 [IPControllerApp] client::client '\x00*\x01\xb8\x89\xea(Nb\x9d \xd9\x17\xde\x12%\x8b' requested u'connection_request'
2013-05-17 13:49:17.888 [IPControllerApp] client::client ['\x00*\x01\xb8\x89\xea(Nb\x9d \xd9\x17\xde\x12%\x8b'] connected
2013-05-17 13:50:00.959 [IPControllerApp] client::client '\x006\xffL\xa7\xdc\x08Gl\x88o[I\x10\x05\xefd' requested u'connection_request'
2013-05-17 13:50:00.959 [IPControllerApp] client::client ['\x006\xffL\xa7\xdc\x08Gl\x88o[I\x10\x05\xefd'] connected
2013-05-17 13:51:37.280 [IPControllerApp] client::client "\x00\xbf3\xf9'B\x8bLV\xa5\x92\x06\x1f;\xccQ#" requested u'connection_request'
2013-05-17 13:51:37.280 [IPControllerApp] client::client ["\x00\xbf3\xf9'B\x8bLV\xa5\x92\x06\x1f;\xccQ#"] connected
2013-05-17 13:52:12.845 [IPControllerApp] client::client '\x00\x96Ag\xef\xf6\xc9E/\xb4 <at> d3D\xa3\x8e\xb5' requested u'connection_request'
2013-05-17 13:52:12.845 [IPControllerApp] client::client ['\x00\x96Ag\xef\xf6\xc9E/\xb4 <at> d3D\xa3\x8e\xb5'] connected



I don't really know how to proceed from here. Can anyone suggest some way forward? I am using ipython 0.14.dev on python 2.7.3, if that's of any help.

Thanks!
Jose
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user

Gmane