[yt-svn] commit/yt: 6 new changesets

Bitbucket commits-noreply at bitbucket.org
Thu Jul 26 19:30:26 PDT 2012


6 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/3f46f91900ab/
changeset:   3f46f91900ab
branch:      yt
user:        MatthewTurk
date:        2012-07-27 02:52:36
summary:     Turning back on 0MQ installation by default and upgrading to IPython 0.13.
affected #:  1 file

diff -r cc0d6f5c8f83c2cbd62af00685252c8ae0a2b180 -r 3f46f91900ab164a5eae37db3fbb9688e97ef543 doc/install_script.sh
--- a/doc/install_script.sh
+++ b/doc/install_script.sh
@@ -42,7 +42,7 @@
 INST_SQLITE3=1  # Install a local version of SQLite3?
 INST_PYX=0      # Install PyX?  Sometimes PyX can be problematic without a
                 # working TeX installation.
-INST_0MQ=0      # Install 0mq (for IPython) and affiliated bindings?
+INST_0MQ=1      # Install 0mq (for IPython) and affiliated bindings?
 
 # If you've got YT some other place, set this to point to it.
 YT_DIR=""
@@ -400,13 +400,13 @@
 echo 'b519218f93946400326e9b656669269ecb3e5232b944e18fbc3eadc4fe2b56244d68aae56d6f69042b4c87c58c881ee2aaa279561ea0f0f48d5842155f4de9de  freetype-2.4.4.tar.gz' > freetype-2.4.4.tar.gz.sha512
 echo '1531789e0a77d4829796d18552a4de7aecae7e8b63763a7951a8091921995800740fe03e72a7dbd496a5590828131c5f046ddead695e5cba79343b8c205148d1  h5py-2.0.1.tar.gz' > h5py-2.0.1.tar.gz.sha512
 echo '9644896e4a84665ad22f87eb885cbd4a0c60a5c30085d5dd5dba5f3c148dbee626f0cb01e59a7995a84245448a3f1e9ba98687d3f10250e2ee763074ed8ddc0e  hdf5-1.8.7.tar.gz' > hdf5-1.8.7.tar.gz.sha512
-echo 'ffc5c9e0c8c8ea66479abd467e442419bd1c867e6dbd180be6a032869467955dc570cfdf1388452871303a440738f302d3227ab7728878c4a114cfc45d29d23c  ipython-0.12.tar.gz' > ipython-0.12.tar.gz.sha512
 echo 'dbefad00fa34f4f21dca0f1e92e95bd55f1f4478fa0095dcf015b4d06f0c823ff11755cd777e507efaf1c9098b74af18f613ec9000e5c3a5cc1c7554fb5aefb8  libpng-1.5.12.tar.gz' > libpng-1.5.12.tar.gz.sha512
 echo 'f5ab95c29ef6958096970265a6079f0eb8c43a500924346c4a6c6eb89d9110eeeb6c34a53715e71240e82ded2b76a7b8d5a9b05a07baa000b2926718264ad8ff  matplotlib-1.1.0.tar.gz' > matplotlib-1.1.0.tar.gz.sha512
 echo 'ec7416729f99f5eef6700507e740552e771d6dd8863f757311538d7d67a0eecd3426381bd42a7ddbf0771bdde8bba5cb943f60031ae3567d6a3dcac738facda8  mercurial-2.2.2.tar.gz' > mercurial-2.2.2.tar.gz.sha512
 echo 'de3dd37f753614055dcfed910e9886e03688b8078492df3da94b1ec37be796030be93291cba09e8212fffd3e0a63b086902c3c25a996cf1439e15c5b16e014d9  numpy-1.6.1.tar.gz' > numpy-1.6.1.tar.gz.sha512
 echo '5ad681f99e75849a5ca6f439c7a19bb51abc73d121b50f4f8e4c0da42891950f30407f761a53f0fe51b370b1dbd4c4f5a480557cb2444c8c7c7d5412b328a474  sqlite-autoconf-3070500.tar.gz' > sqlite-autoconf-3070500.tar.gz.sha512
 echo 'edae735960279d92acf58e1f4095c6392a7c2059b8f1d2c46648fc608a0fb06b392db2d073f4973f5762c034ea66596e769b95b3d26ad963a086b9b2d09825f2  zlib-1.2.3.tar.bz2' > zlib-1.2.3.tar.bz2.sha512
+echo '42021737c93cea513116e6051cff9b803e3f25d6019c74370b42f4c91d1af73e94ac2b7ace85b7565fa3d45b79231079bd48a242531beeafa33c36d7139ce838  ipython-0.13.tar.gz' > ipython-0.13.tar.gz.sha512
 echo 'fb3cf421b2dc48c31956b3e3ee4ab6ebc743deec3bf626c2238a1996c8c51be87260bd6aa662793a1f0c34dcda9b3146763777bb162dfad6fec4ca7acc403b2e  zeromq-2.2.0.tar.gz' > zeromq-2.2.0.tar.gz.sha512
 echo 'd761b492352841cdc125d9f0c99ee6d6c435812472ea234728b7f0fb4ad1048e1eec9b399df2081fbc926566f333f7780fedd0ce23255a6633fe5c60ed15a6af  pyzmq-2.1.11.tar.gz' > pyzmq-2.1.11.tar.gz.sha512
 echo '57fa5e57dfb98154a42d2d477f29401c2260ae7ad3a8128a4098b42ee3b35c54367b1a3254bc76b9b3b14b4aab7c3e1135858f68abc5636daedf2f01f9b8a3cf  tornado-2.2.tar.gz' > tornado-2.2.tar.gz.sha512
@@ -426,7 +426,7 @@
 get_ytproject numpy-1.6.1.tar.gz
 get_ytproject matplotlib-1.1.0.tar.gz
 get_ytproject mercurial-2.2.2.tar.gz
-get_ytproject ipython-0.12.tar.gz
+get_ytproject ipython-0.13.tar.gz
 get_ytproject h5py-2.0.1.tar.gz
 get_ytproject Cython-0.16.tar.gz
 get_ytproject reason-js-20120623.zip
@@ -664,7 +664,7 @@
     do_setup_py tornado-2.2
 fi
 
-do_setup_py ipython-0.12
+do_setup_py ipython-0.13
 do_setup_py h5py-2.0.1
 do_setup_py Cython-0.16
 [ $INST_PYX -eq 1 ] && do_setup_py PyX-0.11.1



https://bitbucket.org/yt_analysis/yt/changeset/a0869a68ab86/
changeset:   a0869a68ab86
branch:      yt
user:        MatthewTurk
date:        2012-07-27 03:24:44
summary:     Adding _repr_png_ to the individual plot window components.  You can display
these in the IPython notebook.  For instance:

slc = SlicePlot(pf, "x", "Density")
slc.plots["Density"]

would cause the Density plot to show up in the next cell output.
affected #:  1 file

diff -r 3f46f91900ab164a5eae37db3fbb9688e97ef543 -r a0869a68ab862ca66903b39fb0f8183c00443971 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1038,6 +1038,13 @@
         canvas.print_figure(fn)
         return fn
 
+    def _repr_png_(self):
+        canvas = FigureCanvasAgg(self.figure)
+        f = cStringIO.StringIO()
+        canvas.print_figure(f)
+        f.seek(0)
+        return f.read()
+
 class WindowPlotMPL(PlotMPL):
     def __init__(self, data, extent, field_transform, cmap, size, zlim):
         self.zmin, self.zmax = zlim



https://bitbucket.org/yt_analysis/yt/changeset/9b0642a73bfd/
changeset:   9b0642a73bfd
branch:      yt
user:        MatthewTurk
date:        2012-07-27 03:46:26
summary:     Adding a show() command and updating 0MQ stuff to work with IPython 0.13.
affected #:  2 files

diff -r a0869a68ab862ca66903b39fb0f8183c00443971 -r 9b0642a73bfdec58fbc00ec313592bd77f0bf212 yt/visualization/plot_collection.py
--- a/yt/visualization/plot_collection.py
+++ b/yt/visualization/plot_collection.py
@@ -1725,16 +1725,13 @@
 
         >>> pc.save()
         """
-        from matplotlib.backends.backend_svg import \
-            FigureCanvasSVG
-        from IPython.zmq.pylab.backend_payload import \
-            add_plot_payload
+        from ._mpl_imports import FigureCanvasAgg
         from IPython.zmq.pylab.backend_inline import \
-            send_svg_canvas
+            send_figure
         if basename is None: basename = str(self.pf)
         for plot in self.plots:
-            canvas = FigureCanvasSVG(plot._figure)
-            send_svg_canvas(canvas)
+            canvas = FigureCanvasAgg(plot._figure)
+            send_figure(plot._figure)
 
 def get_multi_plot(nx, ny, colorbar = 'vertical', bw = 4, dpi=300,
                    cbar_padding = 0.4):


diff -r a0869a68ab862ca66903b39fb0f8183c00443971 -r 9b0642a73bfdec58fbc00ec313592bd77f0bf212 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -42,6 +42,7 @@
     callback_registry
 from .tick_locators import LogLocator, LinearLocator
 from yt.utilities.delaunay.triangulate import Triangulation as triang
+from yt.config import ytcfg
 
 from yt.funcs import *
 from yt.utilities.lib import write_png_to_string
@@ -53,6 +54,12 @@
 from yt.utilities.math_utils import \
     ortho_find
 
+try:
+    from IPython.zmq.pylab.backend_inline import \
+                send_figure
+except ImportError:
+    pass
+
 def invalidate_data(f):
     @wraps(f)
     def newfunc(*args, **kwargs):
@@ -684,6 +691,41 @@
             names.append(v.save(n))
         return names
 
+    def _send_zmq(self):
+        for k, v in sorted(self.plots.iteritems()):
+            canvas = FigureCanvasAgg(v.figure)
+            send_figure(v.figure)
+
+    def show(self):
+        r"""This will send any existing plots to the IPython notebook.
+        function name.
+
+        If yt is being run from within an IPython notebook, and it is able to
+        determine this, this function will send any existing plots to the
+        notebook for display.
+
+        A common way of signalling this is to create an IPython profile that
+        has in its 00 startup script this code:
+
+        .. code-block:: python
+
+           from yt.config import ytcfg
+           ytcfg["yt","ipython_notebook"] = "True"
+
+        If not running in the notebook, this will raise NotImplementedError.
+
+        Examples
+        --------
+
+        >>> slc = SlicePlot(pf, "x", ["Density", "VelocityMagnitude"])
+        >>> slc.show()
+
+        """
+        if ytcfg.getboolean("yt", "ipython_notebook"):
+            self._send_zmq()
+        else:
+            raise NotImplementedError
+
 class SlicePlot(PWViewerMPL):
     def __init__(self, pf, axis, fields, center='c', width=(1,'unitary'), origin='center-window'):
         r"""Creates a slice plot from a parameter file



https://bitbucket.org/yt_analysis/yt/changeset/bdd62373a6d0/
changeset:   bdd62373a6d0
branch:      yt
user:        MatthewTurk
date:        2012-07-27 04:11:08
summary:     Adding a more descriptive error message to show() if note declared inside a
session.
affected #:  2 files

diff -r 9b0642a73bfdec58fbc00ec313592bd77f0bf212 -r bdd62373a6d01637c44af029c20ca4aac684240b yt/utilities/exceptions.py
--- a/yt/utilities/exceptions.py
+++ b/yt/utilities/exceptions.py
@@ -101,3 +101,8 @@
         return "Simulation %s has no stopping condition.  StopTime or StopCycle should be set." % \
             self.pf
 
+class YTNotDeclaredInsideNotebook(YTException):
+    def __str__(self):
+        return "You have not declared yourself to be inside the IPython" + \
+               "Notebook.  Do so with this command:\n\n" + \
+               "ytcfg['yt','ipython_notebook'] = 'True'"


diff -r 9b0642a73bfdec58fbc00ec313592bd77f0bf212 -r bdd62373a6d01637c44af029c20ca4aac684240b yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -724,7 +724,7 @@
         if ytcfg.getboolean("yt", "ipython_notebook"):
             self._send_zmq()
         else:
-            raise NotImplementedError
+            raise YTNotDeclaredInsideNotebook
 
 class SlicePlot(PWViewerMPL):
     def __init__(self, pf, axis, fields, center='c', width=(1,'unitary'), origin='center-window'):



https://bitbucket.org/yt_analysis/yt/changeset/1a107248fa6f/
changeset:   1a107248fa6f
branch:      yt
user:        MatthewTurk
date:        2012-07-27 04:24:15
summary:     This is a simpler method of determining if we're inside IPython.  I believe it
should work in the presence of 0MQ and in its absence.
affected #:  2 files

diff -r bdd62373a6d01637c44af029c20ca4aac684240b -r 1a107248fa6f92ebd1b4ce14d4909427410f4027 yt/utilities/exceptions.py
--- a/yt/utilities/exceptions.py
+++ b/yt/utilities/exceptions.py
@@ -101,6 +101,10 @@
         return "Simulation %s has no stopping condition.  StopTime or StopCycle should be set." % \
             self.pf
 
+class YTNotInsideNotebook(YTException):
+    def __str__(self):
+        return "This function only works from within an IPython Notebook."
+
 class YTNotDeclaredInsideNotebook(YTException):
     def __str__(self):
         return "You have not declared yourself to be inside the IPython" + \


diff -r bdd62373a6d01637c44af029c20ca4aac684240b -r 1a107248fa6f92ebd1b4ce14d4909427410f4027 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -28,6 +28,7 @@
 import matplotlib.figure
 import cStringIO
 import types
+import __builtin__
 from functools import wraps
 
 import numpy as na
@@ -54,12 +55,6 @@
 from yt.utilities.math_utils import \
     ortho_find
 
-try:
-    from IPython.zmq.pylab.backend_inline import \
-                send_figure
-except ImportError:
-    pass
-
 def invalidate_data(f):
     @wraps(f)
     def newfunc(*args, **kwargs):
@@ -692,6 +687,8 @@
         return names
 
     def _send_zmq(self):
+        from IPython.zmq.pylab.backend_inline import \
+                    send_figure
         for k, v in sorted(self.plots.iteritems()):
             canvas = FigureCanvasAgg(v.figure)
             send_figure(v.figure)
@@ -721,10 +718,10 @@
         >>> slc.show()
 
         """
-        if ytcfg.getboolean("yt", "ipython_notebook"):
+        if "__IPYTHON__" in dir(__builtin__):
             self._send_zmq()
         else:
-            raise YTNotDeclaredInsideNotebook
+            raise YTNotInsideNotebook
 
 class SlicePlot(PWViewerMPL):
     def __init__(self, pf, axis, fields, center='c', width=(1,'unitary'), origin='center-window'):



https://bitbucket.org/yt_analysis/yt/changeset/c3448a0dbf13/
changeset:   c3448a0dbf13
branch:      yt
user:        MatthewTurk
date:        2012-07-27 04:25:03
summary:     Adjusting docstring
affected #:  1 file

diff -r 1a107248fa6f92ebd1b4ce14d4909427410f4027 -r c3448a0dbf138ebc6fb19f7be8c5910e8c38ccff yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -697,19 +697,12 @@
         r"""This will send any existing plots to the IPython notebook.
         function name.
 
-        If yt is being run from within an IPython notebook, and it is able to
+        If yt is being run from within an IPython session, and it is able to
         determine this, this function will send any existing plots to the
         notebook for display.
 
-        A common way of signalling this is to create an IPython profile that
-        has in its 00 startup script this code:
-
-        .. code-block:: python
-
-           from yt.config import ytcfg
-           ytcfg["yt","ipython_notebook"] = "True"
-
-        If not running in the notebook, this will raise NotImplementedError.
+        If yt can't determine if it's inside an IPython session, it will raise
+        YTNotInsideNotebook.
 
         Examples
         --------

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list