[yt-svn] commit/yt-doc: 9 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Sep 6 14:52:38 PDT 2013


9 new commits in yt-doc:

https://bitbucket.org/yt_analysis/yt-doc/commits/6507d711127d/
Changeset:   6507d711127d
User:        chummels
Date:        2013-08-20 23:15:08
Summary:     Adding colormaps page under "visualizing" for displaying all the available colormaps.
Affected #:  1 file

diff -r 696afea653e44d82174fd460966e167d0f18dc19 -r 6507d711127d96d9c66e44d441951e54d6d0a183 source/visualizing/index.rst
--- a/source/visualizing/index.rst
+++ b/source/visualizing/index.rst
@@ -9,3 +9,4 @@
    manual_plotting
    volume_rendering
    streamlines
+   colormaps


https://bitbucket.org/yt_analysis/yt-doc/commits/d627d2b9e882/
Changeset:   d627d2b9e882
User:        chummels
Date:        2013-08-20 23:17:48
Summary:     Oops.  Forgot to add these files associated with the new colormaps page.
Affected #:  3 files

diff -r 6507d711127d96d9c66e44d441951e54d6d0a183 -r d627d2b9e882c17709f61d540e1f74fb41730595 source/visualizing/_images/all_colormaps.png
Binary file source/visualizing/_images/all_colormaps.png has changed

diff -r 6507d711127d96d9c66e44d441951e54d6d0a183 -r d627d2b9e882c17709f61d540e1f74fb41730595 source/visualizing/_images/native_yt_colormaps.png
Binary file source/visualizing/_images/native_yt_colormaps.png has changed

diff -r 6507d711127d96d9c66e44d441951e54d6d0a183 -r d627d2b9e882c17709f61d540e1f74fb41730595 source/visualizing/colormaps.rst
--- /dev/null
+++ b/source/visualizing/colormaps.rst
@@ -0,0 +1,45 @@
+.. _colormaps:
+
+Colormaps
+=========
+
+There are several colormaps available for yt.  yt includes all of the 
+matplotlib colormaps as well for nearly all functions.  Individual visualization
+functions usually allow you to specify a colormap with the ``cmap`` flag.
+There are a small number of functions (mostly contained in the image_writer 
+module; e.g. write_bitmap, write_image, write_projection, etc.), which do 
+not load the matplotlib infrastructure and can only access the colormaps 
+native to yt.  
+
+Here is a chart of all of the colormaps available.  In addition to each 
+colormap displayed here, you can access its "reverse" by simply appending a 
+``"_r"`` to the end of the colormap name.
+
+All Colormaps (including matplotlib)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. image:: _images/all_colormaps.png
+   :width: 512
+
+Native yt Colormaps
+~~~~~~~~~~~~~~~~~~~
+
+.. image:: _images/native_yt_colormaps.png
+   :width: 512
+
+Displaying Colormaps Locally
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To display the most up to date colormaps locally, you can run:
+
+.. code-block:: python
+
+    from yt.mods import *
+    show_colormaps()
+
+or to output just the colormaps native to yt to an image file, try:
+
+.. code-block:: python
+
+    from yt.mods import *
+    show_colormaps(subset = "yt_native", filename = "yt_native.png")


https://bitbucket.org/yt_analysis/yt-doc/commits/30269a261d35/
Changeset:   30269a261d35
User:        chummels
Date:        2013-08-24 22:50:30
Summary:     Reorganizing colormaps directory so as to allow for dynamically generated colormap images.
Affected #:  2 files

diff -r d627d2b9e882c17709f61d540e1f74fb41730595 -r 30269a261d356b4f2fd7cfeb9013b3e802065088 source/visualizing/colormaps.rst
--- a/source/visualizing/colormaps.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-.. _colormaps:
-
-Colormaps
-=========
-
-There are several colormaps available for yt.  yt includes all of the 
-matplotlib colormaps as well for nearly all functions.  Individual visualization
-functions usually allow you to specify a colormap with the ``cmap`` flag.
-There are a small number of functions (mostly contained in the image_writer 
-module; e.g. write_bitmap, write_image, write_projection, etc.), which do 
-not load the matplotlib infrastructure and can only access the colormaps 
-native to yt.  
-
-Here is a chart of all of the colormaps available.  In addition to each 
-colormap displayed here, you can access its "reverse" by simply appending a 
-``"_r"`` to the end of the colormap name.
-
-All Colormaps (including matplotlib)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. image:: _images/all_colormaps.png
-   :width: 512
-
-Native yt Colormaps
-~~~~~~~~~~~~~~~~~~~
-
-.. image:: _images/native_yt_colormaps.png
-   :width: 512
-
-Displaying Colormaps Locally
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To display the most up to date colormaps locally, you can run:
-
-.. code-block:: python
-
-    from yt.mods import *
-    show_colormaps()
-
-or to output just the colormaps native to yt to an image file, try:
-
-.. code-block:: python
-
-    from yt.mods import *
-    show_colormaps(subset = "yt_native", filename = "yt_native.png")

diff -r d627d2b9e882c17709f61d540e1f74fb41730595 -r 30269a261d356b4f2fd7cfeb9013b3e802065088 source/visualizing/colormaps/index.rst
--- /dev/null
+++ b/source/visualizing/colormaps/index.rst
@@ -0,0 +1,45 @@
+.. _colormaps:
+
+Colormaps
+=========
+
+There are several colormaps available for yt.  yt includes all of the 
+matplotlib colormaps as well for nearly all functions.  Individual visualization
+functions usually allow you to specify a colormap with the ``cmap`` flag.
+There are a small number of functions (mostly contained in the image_writer 
+module; e.g. write_bitmap, write_image, write_projection, etc.), which do 
+not load the matplotlib infrastructure and can only access the colormaps 
+native to yt.  
+
+Here is a chart of all of the colormaps available.  In addition to each 
+colormap displayed here, you can access its "reverse" by simply appending a 
+``"_r"`` to the end of the colormap name.
+
+All Colormaps (including matplotlib)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. image:: ../_images/all_colormaps.png
+   :width: 512
+
+Native yt Colormaps
+~~~~~~~~~~~~~~~~~~~
+
+.. image:: ../_images/native_yt_colormaps.png
+   :width: 512
+
+Displaying Colormaps Locally
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To display the most up to date colormaps locally, you can run:
+
+.. code-block:: python
+
+    from yt.mods import *
+    show_colormaps()
+
+or to output just the colormaps native to yt to an image file, try:
+
+.. code-block:: python
+
+    from yt.mods import *
+    show_colormaps(subset = "yt_native", filename = "yt_native.png")


https://bitbucket.org/yt_analysis/yt-doc/commits/72e1244aeb20/
Changeset:   72e1244aeb20
User:        chummels
Date:        2013-09-06 00:05:51
Summary:     Modifying source so as to allow projections of a dataset to be dynamically generated to show off each different colormap applied to the same projection.
Affected #:  3 files

diff -r 30269a261d356b4f2fd7cfeb9013b3e802065088 -r 72e1244aeb2039169c79ac98f3900a61e508e782 source/visualizing/colormaps/cmap_images.py
--- /dev/null
+++ b/source/visualizing/colormaps/cmap_images.py
@@ -0,0 +1,14 @@
+from yt.mods import *
+import matplotlib.cm as cm
+
+# Load the dataset.
+pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# Create projections using each colormap available.
+
+for cmap in cm.datad:
+    if cmap.startswith("idl"):
+        continue
+    p = ProjectionPlot(pf, "z", "Density", weight_field = "Density", width=0.4)
+    p.set_cmap(field="Density", cmap=cmap)
+    p.save('Projection_%s.png' % cmap)

diff -r 30269a261d356b4f2fd7cfeb9013b3e802065088 -r 72e1244aeb2039169c79ac98f3900a61e508e782 source/visualizing/colormaps/index.rst
--- a/source/visualizing/colormaps/index.rst
+++ b/source/visualizing/colormaps/index.rst
@@ -43,3 +43,14 @@
 
     from yt.mods import *
     show_colormaps(subset = "yt_native", filename = "yt_native.png")
+
+Examples of Each Colormap
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To give the reader a better feel for how a colormap appears once it is applied
+to a dataset, below we provide a library of identical projections of an 
+isolated galaxy where only the colormap has changed.  They use the following 
+simple recipe on the sample dataset "IsolatedGalaxy" available at 
+`http://yt-project.org/data <http://yt-project.org/data>`_.
+
+.. yt_cmaps:: cmap_images.py

diff -r 30269a261d356b4f2fd7cfeb9013b3e802065088 -r 72e1244aeb2039169c79ac98f3900a61e508e782 source/visualizing/index.rst
--- a/source/visualizing/index.rst
+++ b/source/visualizing/index.rst
@@ -9,4 +9,4 @@
    manual_plotting
    volume_rendering
    streamlines
-   colormaps
+   colormaps/index


https://bitbucket.org/yt_analysis/yt-doc/commits/bb92f07197fc/
Changeset:   bb92f07197fc
User:        chummels
Date:        2013-09-06 00:06:11
Summary:     Merging.
Affected #:  1 file

diff -r 72e1244aeb2039169c79ac98f3900a61e508e782 -r bb92f07197fc5c1ec3fbafe8c76e3373dc51ed66 source/analyzing/creating_derived_fields.rst
--- a/source/analyzing/creating_derived_fields.rst
+++ b/source/analyzing/creating_derived_fields.rst
@@ -169,7 +169,7 @@
     def _convertDivV(data):
         return data.convert("cm")**-1.0
     add_field("DivV", function=_DivV,
-               validators=[ValidateSpatial(ghost_zone=1,
+               validators=[ValidateSpatial(ghost_zones=1,
 	                   fields=["x-velocity","y-velocity","z-velocity"])],
               units=r"\rm{s}^{-1}", take_log=False,
               convert_function=_convertDivV)


https://bitbucket.org/yt_analysis/yt-doc/commits/2e674c38a8ba/
Changeset:   2e674c38a8ba
User:        chummels
Date:        2013-09-06 21:56:45
Summary:     Updating colormap projection script to be much faster.
Affected #:  1 file

diff -r bb92f07197fc5c1ec3fbafe8c76e3373dc51ed66 -r 2e674c38a8ba2bad781fd6cd9002a874372a1d3a source/visualizing/colormaps/cmap_images.py
--- a/source/visualizing/colormaps/cmap_images.py
+++ b/source/visualizing/colormaps/cmap_images.py
@@ -5,10 +5,10 @@
 pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create projections using each colormap available.
+p = ProjectionPlot(pf, "z", "Density", weight_field = "Density", width=0.4)
 
 for cmap in cm.datad:
     if cmap.startswith("idl"):
         continue
-    p = ProjectionPlot(pf, "z", "Density", weight_field = "Density", width=0.4)
     p.set_cmap(field="Density", cmap=cmap)
     p.save('Projection_%s.png' % cmap)


https://bitbucket.org/yt_analysis/yt-doc/commits/5603d4524836/
Changeset:   5603d4524836
User:        chummels
Date:        2013-09-06 23:08:49
Summary:     Modifying the colormaps index to work better with automagic script.
Affected #:  1 file

diff -r 2e674c38a8ba2bad781fd6cd9002a874372a1d3a -r 5603d4524836aa3387c25ed68eae5962b972277b source/visualizing/colormaps/index.rst
--- a/source/visualizing/colormaps/index.rst
+++ b/source/visualizing/colormaps/index.rst
@@ -49,8 +49,8 @@
 
 To give the reader a better feel for how a colormap appears once it is applied
 to a dataset, below we provide a library of identical projections of an 
-isolated galaxy where only the colormap has changed.  They use the following 
-simple recipe on the sample dataset "IsolatedGalaxy" available at 
+isolated galaxy where only the colormap has changed.  They use the sample 
+dataset "IsolatedGalaxy" available at 
 `http://yt-project.org/data <http://yt-project.org/data>`_.
 
-.. yt_cmaps:: cmap_images.py
+.. yt_colormaps:: cmap_images.py


https://bitbucket.org/yt_analysis/yt-doc/commits/a779a9ddbb71/
Changeset:   a779a9ddbb71
User:        chummels
Date:        2013-09-06 23:09:05
Summary:     Including colormaps extension script.
Affected #:  1 file

diff -r 5603d4524836aa3387c25ed68eae5962b972277b -r a779a9ddbb71ae98ffa8d30e67fa87f260cca9c1 extensions/yt_colormaps.py
--- /dev/null
+++ b/extensions/yt_colormaps.py
@@ -0,0 +1,52 @@
+# This extension is quite simple:
+#  1. It accepts a script name
+#  2. This script is added to the document in a literalinclude
+#  3. Any _static images found will be added
+
+from sphinx.util.compat import Directive
+from docutils.parsers.rst import directives
+import os, glob, shutil
+
+# Some of this magic comes from the matplotlib plot_directive.
+
+def setup(app):
+    app.add_directive('yt_colormaps', ColormapScript)
+    setup.app = app
+    setup.config = app.config
+    setup.confdir = app.confdir
+
+class ColormapScript(Directive):
+    required_arguments = 1
+    optional_arguments = 0
+
+    def run(self):
+        rst_file = self.state_machine.document.attributes['source']
+        rst_dir = os.path.abspath(os.path.dirname(rst_file))
+        script_fn = directives.path(self.arguments[0])
+        script_bn = os.path.basename(script_fn)
+        script_name = os.path.basename(self.arguments[0]).split(".")[0]
+
+        # This magic is from matplotlib
+        dest_dir = os.path.abspath(os.path.join(setup.app.builder.outdir,
+                                                os.path.dirname(script_fn)))
+        if not os.path.exists(dest_dir):
+            os.makedirs(dest_dir) # no problem here for me, but just use built-ins
+
+        rel_dir = os.path.relpath(rst_dir, setup.confdir)
+        place = os.path.join(dest_dir, rel_dir)
+        if not os.path.isdir(place): os.makedirs(place)
+        shutil.copyfile(os.path.join(rst_dir, script_fn),
+                        os.path.join(place, script_bn))
+
+        im_path = os.path.join(rst_dir, "_static")
+        images = sorted(glob.glob(os.path.join(im_path, "*.png")))
+        lines = []
+        for im in images:
+            im_name = os.path.join("_static", os.path.basename(im))
+            lines.append(".. image:: %s" % im_name)
+            lines.append("   :width: 400")
+            lines.append("   :target: _static/%s" % os.path.basename(im))
+            lines.append("\n")
+        lines.append("\n")
+        self.state_machine.insert_input(lines, rst_file)
+        return []


https://bitbucket.org/yt_analysis/yt-doc/commits/514e940dcf91/
Changeset:   514e940dcf91
User:        chummels
Date:        2013-09-06 23:43:25
Summary:     Checking in new yt_colormaps extension so it gets run.
Affected #:  1 file

diff -r a779a9ddbb71ae98ffa8d30e67fa87f260cca9c1 -r 514e940dcf9136dcc84fa3206faf8b22889941cd source/conf.py
--- a/source/conf.py
+++ b/source/conf.py
@@ -30,7 +30,7 @@
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
               'sphinx.ext.pngmath', 'sphinx.ext.viewcode',
               'sphinx.ext.autosummary', 'numpydocmod', 'youtube',
-              'yt_cookbook']
+              'yt_cookbook', 'yt_colormaps']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']

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

--

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