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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Aug 20 13:25:41 PDT 2013


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/456f4ec6d279/
Changeset:   456f4ec6d279
Branch:      yt
User:        chummels
Date:        2013-08-20 20:55:01
Summary:     Adding in show_colormaps function which enables the user to see what colormaps are available in yt.
Affected #:  1 file

diff -r c0ffdcc604f77380300b46474eb421cb8e0b555f -r 456f4ec6d2796fa6151511fac6808d88d2e87c11 yt/visualization/color_maps.py
--- a/yt/visualization/color_maps.py
+++ b/yt/visualization/color_maps.py
@@ -145,3 +145,57 @@
     b = cmap._lut[:-3, 2]
     a = np.ones(b.shape)
     return [r, g, b, a]
+
+def show_colormaps(subset = "all", filename=None):
+    """
+    Displays the colormaps available to yt.  Note, most functions can use
+    both the matplotlib and the native yt colormaps; however, there are 
+    some special functions existing within image_writer.py (e.g. write_image()
+    write_fits(), write_bitmap(), etc.), which cannot access the matplotlib
+    colormaps.
+
+    In addition to the colormaps listed, one can access the reverse of each 
+    colormap by appending a "_r" to any map.
+    
+    Parameters
+    ----------
+
+    subset : string, opt
+
+        valid values : "all", "yt_native"
+        default : "all"
+
+        As mentioned above, a few functions can only access yt_native 
+        colormaps.  To display only the yt_native colormaps, set this
+        to "yt_native".  
+
+    filename : string, opt
+
+        default: None
+
+        If filename is set, then it will save the colormaps to an output
+        file.  If it is not set, it will "show" the result interactively.
+    """
+    import pylab as pl
+
+    pl.rc('text', usetex=False)
+    a=np.outer(np.arange(0,1,0.01), np.ones(10))
+    if (subset == "all"):
+        maps = [ m for m in pl.cm.datad if (not m.startswith("idl")) & (not m.endswith("_r"))]
+    if (subset == "yt_native"):
+        maps = [ m for m in _cm.color_map_luts if (not m.startswith("idl")) & (not m.endswith("_r"))]
+    maps = np.unique(maps)
+    maps.sort()
+    # scale the image size by the number of cmaps
+    pl.figure(figsize=(2.*len(maps)/10.,6))
+    pl.subplots_adjust(top=0.7,bottom=0.05,left=0.01,right=0.99)
+    l = len(maps)+1
+    for i,m in enumerate(maps):
+        pl.subplot(1,l,i+1)
+        pl.axis("off")
+        pl.imshow(a, aspect='auto',cmap=pl.get_cmap(m),origin="lower")      
+        pl.title(m,rotation=90, fontsize=10, verticalalignment='bottom')
+    if filename is not None:
+        pl.savefig(filename, dpi=100, facecolor='gray') 
+    else:  
+        pl.show()


https://bitbucket.org/yt_analysis/yt/commits/e3b5758d1ef6/
Changeset:   e3b5758d1ef6
Branch:      yt
User:        chummels
Date:        2013-08-20 20:57:35
Summary:     Adding show_colormaps to visualization and mods api's.
Affected #:  2 files

diff -r 456f4ec6d2796fa6151511fac6808d88d2e87c11 -r e3b5758d1ef6519b97274dcbe42c062568ecb31d yt/mods.py
--- a/yt/mods.py
+++ b/yt/mods.py
@@ -131,7 +131,8 @@
     get_multi_plot, FixedResolutionBuffer, ObliqueFixedResolutionBuffer, \
     callback_registry, write_bitmap, write_image, annotate_image, \
     apply_colormap, scale_image, write_projection, write_fits, \
-    SlicePlot, OffAxisSlicePlot, ProjectionPlot, OffAxisProjectionPlot
+    SlicePlot, OffAxisSlicePlot, ProjectionPlot, OffAxisProjectionPlot, \
+    show_colormaps
 
 from yt.visualization.volume_rendering.api import \
     ColorTransferFunction, PlanckTransferFunction, ProjectionTransferFunction, \

diff -r 456f4ec6d2796fa6151511fac6808d88d2e87c11 -r e3b5758d1ef6519b97274dcbe42c062568ecb31d yt/visualization/api.py
--- a/yt/visualization/api.py
+++ b/yt/visualization/api.py
@@ -29,7 +29,8 @@
 """
 
 from color_maps import \
-    add_cmap
+    add_cmap, \
+    show_colormaps
 
 from plot_collection import \
     PlotCollection, \


https://bitbucket.org/yt_analysis/yt/commits/0b358633485b/
Changeset:   0b358633485b
Branch:      yt
User:        chummels
Date:        2013-08-20 20:57:52
Summary:     Merging.
Affected #:  2 files

diff -r e3b5758d1ef6519b97274dcbe42c062568ecb31d -r 0b358633485b5c32c3960b9168afa707490e9f3f doc/install_script.sh
--- a/doc/install_script.sh
+++ b/doc/install_script.sh
@@ -832,8 +832,8 @@
 	    echo "Building BLAS"
 	    cd BLAS
 	    gfortran -O2 -fPIC -fno-second-underscore -c *.f
-	    ar r libfblas.a *.o &>> ${LOG_FILE}
-	    ranlib libfblas.a 1>> ${LOG_FILE}
+	    ( ar r libfblas.a *.o 2>&1 ) 1>> ${LOG_FILE}
+	    ( ranlib libfblas.a 2>&1 ) 1>> ${LOG_FILE}
 	    rm -rf *.o
 	    touch done
 	    cd ..
@@ -844,7 +844,7 @@
 	    echo "Building LAPACK"
 	    cd $LAPACK/
 	    cp INSTALL/make.inc.gfortran make.inc
-	    make lapacklib OPTS="-fPIC -O2" NOOPT="-fPIC -O0" CFLAGS=-fPIC LDFLAGS=-fPIC 1>> ${LOG_FILE} || do_exit
+	    ( make lapacklib OPTS="-fPIC -O2" NOOPT="-fPIC -O0" CFLAGS=-fPIC LDFLAGS=-fPIC 2>&1 ) 1>> ${LOG_FILE} || do_exit
 	    touch done
 	    cd ..
 	fi
@@ -943,10 +943,10 @@
 touch done
 cd $MY_PWD
 
-if !(${DEST_DIR}/bin/python2.7 -c "import readline" >> ${LOG_FILE})
+if !( ( ${DEST_DIR}/bin/python2.7 -c "import readline" 2>&1 )>> ${LOG_FILE})
 then
     echo "Installing pure-python readline"
-    ${DEST_DIR}/bin/pip install readline 1>> ${LOG_FILE}
+    ( ${DEST_DIR}/bin/pip install readline 2>&1 ) 1>> ${LOG_FILE}
 fi
 
 if [ $INST_ENZO -eq 1 ]

diff -r e3b5758d1ef6519b97274dcbe42c062568ecb31d -r 0b358633485b5c32c3960b9168afa707490e9f3f yt/frontends/athena/io.py
--- a/yt/frontends/athena/io.py
+++ b/yt/frontends/athena/io.py
@@ -68,9 +68,9 @@
                 data = data[2::3].reshape(grid_dims,order='F').copy()
         f.close()
         if grid.pf.field_ordering == 1:
-            return data.T
+            return data.T.astype("float64")
         else:
-            return data
+            return data.astype("float64")
 
     def _read_data_slice(self, grid, field, axis, coord):
         sl = [slice(None), slice(None), slice(None)]


https://bitbucket.org/yt_analysis/yt/commits/c33de5552b02/
Changeset:   c33de5552b02
Branch:      yt
User:        chummels
Date:        2013-08-20 21:33:16
Summary:     Merging.
Affected #:  0 files



https://bitbucket.org/yt_analysis/yt/commits/1b696a4c09d8/
Changeset:   1b696a4c09d8
Branch:      yt
User:        chummels
Date:        2013-08-20 21:55:49
Summary:     Implementing the two PR suggestions by Matt.
Affected #:  1 file

diff -r c33de5552b02e41723ad80b01424843f6553ea88 -r 1b696a4c09d8fab667a676fc9e0c36542e60219a yt/visualization/color_maps.py
--- a/yt/visualization/color_maps.py
+++ b/yt/visualization/color_maps.py
@@ -178,13 +178,12 @@
     """
     import pylab as pl
 
-    pl.rc('text', usetex=False)
     a=np.outer(np.arange(0,1,0.01), np.ones(10))
     if (subset == "all"):
         maps = [ m for m in pl.cm.datad if (not m.startswith("idl")) & (not m.endswith("_r"))]
     if (subset == "yt_native"):
         maps = [ m for m in _cm.color_map_luts if (not m.startswith("idl")) & (not m.endswith("_r"))]
-    maps = np.unique(maps)
+    maps = list(set(maps))
     maps.sort()
     # scale the image size by the number of cmaps
     pl.figure(figsize=(2.*len(maps)/10.,6))

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