[yt-svn] commit/yt: 5 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Jul 11 18:28:03 PDT 2016
5 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/a40b0ddb96e2/
Changeset: a40b0ddb96e2
Branch: yt
User: MatthewTurk
Date: 2016-07-11 19:41:27+00:00
Summary: Switch from jet to dusk
Affected #: 4 files
diff -r 96474e2371d16811f1cc105b5e0c7fdb6a9f5dc3 -r a40b0ddb96e275b8217040982444d4d72651cc55 doc/source/cookbook/colormaps.py
--- a/doc/source/cookbook/colormaps.py
+++ b/doc/source/cookbook/colormaps.py
@@ -7,11 +7,11 @@
p = yt.ProjectionPlot(ds, "z", "density", width=(100, 'kpc'))
p.save()
-# Change the colormap to 'jet' and save again. We must specify
+# Change the colormap to 'dusk' and save again. We must specify
# a different filename here or it will save it over the top of
# our first projection.
-p.set_cmap(field="density", cmap='jet')
-p.save('proj_with_jet_cmap.png')
+p.set_cmap(field="density", cmap='dusk')
+p.save('proj_with_dusk_cmap.png')
# Change the colormap to 'hot' and save again.
p.set_cmap(field="density", cmap='hot')
diff -r 96474e2371d16811f1cc105b5e0c7fdb6a9f5dc3 -r a40b0ddb96e275b8217040982444d4d72651cc55 doc/source/visualizing/_images/all_colormaps.png
Binary file doc/source/visualizing/_images/all_colormaps.png has changed
diff -r 96474e2371d16811f1cc105b5e0c7fdb6a9f5dc3 -r a40b0ddb96e275b8217040982444d4d72651cc55 doc/source/visualizing/_images/native_yt_colormaps.png
Binary file doc/source/visualizing/_images/native_yt_colormaps.png has changed
diff -r 96474e2371d16811f1cc105b5e0c7fdb6a9f5dc3 -r a40b0ddb96e275b8217040982444d4d72651cc55 yt/visualization/color_maps.py
--- a/yt/visualization/color_maps.py
+++ b/yt/visualization/color_maps.py
@@ -207,16 +207,17 @@
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
+ import matplotlib.pyplot as plt
+ import matplotlib.cm as cm
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"))]
+ maps = [ m for m in cm.cmap_d if (not m.startswith("idl")) & (not m.endswith("_r"))]
elif subset == "yt_native":
maps = [ m for m in _cm.color_map_luts if (not m.startswith("idl")) & (not m.endswith("_r"))]
else:
try:
- maps = [ m for m in pl.cm.datad if m in subset]
+ maps = [ m for m in cm.cmap_d if m in subset]
if len(maps) == 0:
raise AttributeError
except AttributeError:
@@ -226,18 +227,18 @@
maps = list(set(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)
+ plt.figure(figsize=(2.*len(maps)/10.,6))
+ plt.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')
+ plt.subplot(1,l,i+1)
+ plt.axis("off")
+ plt.imshow(a, aspect='auto',cmap=plt.get_cmap(m),origin="lower")
+ plt.title(m,rotation=90, fontsize=10, verticalalignment='bottom')
if filename is not None:
- pl.savefig(filename, dpi=100, facecolor='gray')
+ plt.savefig(filename, dpi=100, facecolor='gray')
else:
- pl.show()
+ plt.show()
def make_colormap(ctuple_list, name=None, interpolate=True):
"""
https://bitbucket.org/yt_analysis/yt/commits/3f36920dc105/
Changeset: 3f36920dc105
Branch: yt
User: MatthewTurk
Date: 2016-07-11 19:53:09+00:00
Summary: Update docs for colormaps
Affected #: 2 files
diff -r a40b0ddb96e275b8217040982444d4d72651cc55 -r 3f36920dc105ae40905bc50585101ae2eb95e898 doc/source/reference/configuration.rst
--- a/doc/source/reference/configuration.rst
+++ b/doc/source/reference/configuration.rst
@@ -91,6 +91,8 @@
used internally.
* ``coloredlogs`` (default: ``'False'``): Should logs be colored?
+* ``default_colormap`` (default: ``'arbre'``): What colormap should be used by
+ default for yt-produced images?
* ``loadfieldplugins`` (default: ``'True'``): Do we want to load the plugin file?
* ``pluginfilename`` (default ``'my_plugins.py'``) The name of our plugin file.
* ``logfile`` (default: ``'False'``): Should we output to a log file in the
diff -r a40b0ddb96e275b8217040982444d4d72651cc55 -r 3f36920dc105ae40905bc50585101ae2eb95e898 doc/source/visualizing/colormaps/index.rst
--- a/doc/source/visualizing/colormaps/index.rst
+++ b/doc/source/visualizing/colormaps/index.rst
@@ -8,6 +8,21 @@
visualization functions usually allow you to specify a colormap with the
``cmap`` flag.
+In yt 3.3, we changed the default yt colormap from ``algae`` to ``arbre``.
+This colormap was designed and voted on by the yt community and is designed to
+be easier for different color sensitivities as well as when printed in black
+and white. In 3.3, additional colormaps ``dusk``, ``hypnotoad`` and
+``octarine`` were also added, following the same guidelines. For a deeper
+dive into colormaps, see Stéfan van der Walt's SciPy 2015 talk about the new
+matplotlib colormap ``viridis`` at https://www.youtube.com/watch?v=xAoljeRJ3lU
+.
+
+To specify a different default colormap (including ``viridis``), in your yt
+configuration file (see :ref:`configuration-file`) you can set the value
+``default_colormap`` to the name of the colormap you would like. In contrast
+to previous versions of yt, starting in 3.3 yt no longer overrides any
+matplotlib defaults and instead only applies the colormap to yt-produced plots.
+
.. _install-palettable:
Palettable and ColorBrewer2
https://bitbucket.org/yt_analysis/yt/commits/8d626cf6521a/
Changeset: 8d626cf6521a
Branch: yt
User: MatthewTurk
Date: 2016-07-11 20:21:54+00:00
Summary: Replacing all relevant uses of algae in the codebase
Affected #: 8 files
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -427,23 +427,23 @@
--------
>>> keywords = {}
>>> keywords['dpi'] = (50, 100, 200)
- >>> keywords['cmap'] = ('algae', 'jet')
+ >>> keywords['cmap'] = ('arbre', 'hypnotoad')
>>> list_of_kwargs = expand_keywords(keywords)
>>> print list_of_kwargs
- array([{'cmap': 'algae', 'dpi': 50},
- {'cmap': 'jet', 'dpi': 100},
- {'cmap': 'algae', 'dpi': 200}], dtype=object)
+ array([{'cmap': 'arbre', 'dpi': 50},
+ {'cmap': 'hypnotoad', 'dpi': 100},
+ {'cmap': 'arbre', 'dpi': 200}], dtype=object)
>>> list_of_kwargs = expand_keywords(keywords, full=True)
>>> print list_of_kwargs
- array([{'cmap': 'algae', 'dpi': 50},
- {'cmap': 'algae', 'dpi': 100},
- {'cmap': 'algae', 'dpi': 200},
- {'cmap': 'jet', 'dpi': 50},
- {'cmap': 'jet', 'dpi': 100},
- {'cmap': 'jet', 'dpi': 200}], dtype=object)
+ array([{'cmap': 'arbre', 'dpi': 50},
+ {'cmap': 'arbre', 'dpi': 100},
+ {'cmap': 'arbre', 'dpi': 200},
+ {'cmap': 'hypnotoad', 'dpi': 50},
+ {'cmap': 'hypnotoad', 'dpi': 100},
+ {'cmap': 'hypnotoad', 'dpi': 200}], dtype=object)
>>> for kwargs in list_of_kwargs:
... write_projection(*args, **kwargs)
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/eps_writer.py
--- a/yt/visualization/eps_writer.py
+++ b/yt/visualization/eps_writer.py
@@ -1044,8 +1044,8 @@
>>> images = ["density.jpg", "hi_density.jpg", "entropy.jpg",
>>> "special.jpg"]
>>> cbs=[]
- >>> cbs.append(return_cmap("algae", "Density [cm$^{-3}$]", (0,10), False))
- >>> cbs.append(return_cmap("jet", "HI Density", (0,5), False))
+ >>> cbs.append(return_cmap("arbre", "Density [cm$^{-3}$]", (0,10), False))
+ >>> cbs.append(return_cmap("hypnotoad", "HI Density", (0,5), False))
>>> cbs.append(return_cmap("hot", r"Entropy [K cm$^2$]", (1e-2,1e6), True))
>>> cbs.append(return_cmap("Spectral", "Stuff$_x$!", (1,300), True))
>>>
@@ -1364,7 +1364,7 @@
Examples
--------
- >>> cb = return_cmap("algae", "Density [cm$^{-3}$]", (0,10), False)
+ >>> cb = return_cmap("arbre", "Density [cm$^{-3}$]", (0,10), False)
"""
if cmap is None:
cmap = ytcfg.get("yt", "default_colormap")
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/image_writer.py
--- a/yt/visualization/image_writer.py
+++ b/yt/visualization/image_writer.py
@@ -287,7 +287,7 @@
def strip_colormap_data(fn = "color_map_data.py",
cmaps = ("jet", "algae", "hot", "gist_stern", "RdBu",
- "kamae")):
+ "kamae", "hypnotoad", "arbre", "octarine", "dusk")):
import pprint
from . import color_maps as rcm
f = open(fn, "w")
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/tests/test_offaxisprojection.py
--- a/yt/visualization/tests/test_offaxisprojection.py
+++ b/yt/visualization/tests/test_offaxisprojection.py
@@ -65,7 +65,7 @@
wp_kwargs['take_log'] = (True, False)
wp_kwargs['figsize'] = ((8,6), [1,1])
wp_kwargs['dpi'] = (100, 50)
- wp_kwargs['cmap_name'] = ('algae', 'jet')
+ wp_kwargs['cmap_name'] = ('arbre', 'hypnotoad')
wp_kwargs_list = expand_keywords(wp_kwargs)
# test all off_axis_projection kwargs and write_projection kwargs
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/volume_rendering/input_events.py
--- a/yt/visualization/volume_rendering/input_events.py
+++ b/yt/visualization/volume_rendering/input_events.py
@@ -239,7 +239,7 @@
@register_event("cmap_cycle")
def cmap_cycle(event_coll, event):
"""Change colormap"""
- cmap = ['algae', 'kamae', 'viridis', 'inferno', 'magma']
+ cmap = ['arbre', 'algae', 'kamae', 'viridis', 'inferno', 'magma']
cmap = cm.get_cmap(random.choice(cmap))
event_coll.camera.cmap = np.array(cmap(np.linspace(0, 1, 256)),
dtype=np.float32)
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/volume_rendering/interactive_vr.py
--- a/yt/visualization/volume_rendering/interactive_vr.py
+++ b/yt/visualization/volume_rendering/interactive_vr.py
@@ -20,6 +20,8 @@
import numpy as np
import ctypes
+from yt.config import \
+ ytcfg
from yt.utilities.math_utils import \
get_translate_matrix, \
get_scale_matrix, \
@@ -115,7 +117,7 @@
self.aspect_ratio = aspect_ratio
# set cmap
- cmap = cm.get_cmap("algae") # TODO: get default_cmap
+ cmap = cm.get_cmap(ytcfg.get("yt", "default_colormap"))
self.cmap = np.array(cmap(np.linspace(0, 1, 256)), dtype=np.float32)
self.cmap_min = 1e55
self.cmap_max = -1e55
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -385,7 +385,7 @@
def cmap():
'''
This is the name of the colormap that will be used when rendering
- this MeshSource object. Should be a string, like 'algae', or 'hot'.
+ this MeshSource object. Should be a string, like 'arbre', or 'dusk'.
'''
diff -r 3f36920dc105ae40905bc50585101ae2eb95e898 -r 8d626cf6521a22c666d1de6b529876c1b878be25 yt/visualization/volume_rendering/transfer_functions.py
--- a/yt/visualization/volume_rendering/transfer_functions.py
+++ b/yt/visualization/volume_rendering/transfer_functions.py
@@ -664,7 +664,7 @@
--------
>>> tf = ColorTransferFunction( (-10.0, -5.0) )
- >>> tf.sample_colormap(-7.0, 0.01, colormap='algae')
+ >>> tf.sample_colormap(-7.0, 0.01, colormap='arbre')
"""
v = np.float64(v)
if col_bounds is None:
@@ -710,8 +710,8 @@
>>> def linramp(vals, minval, maxval):
... return (vals - vals.min())/(vals.(max) - vals.min())
>>> tf = ColorTransferFunction( (-10.0, -5.0) )
- >>> tf.map_to_colormap(-8.0, -6.0, scale=10.0, colormap='algae')
- >>> tf.map_to_colormap(-6.0, -5.0, scale=10.0, colormap='algae',
+ >>> tf.map_to_colormap(-8.0, -6.0, scale=10.0, colormap='arbre')
+ >>> tf.map_to_colormap(-6.0, -5.0, scale=10.0, colormap='arbre',
... scale_func = linramp)
"""
mi = np.float64(mi)
https://bitbucket.org/yt_analysis/yt/commits/e49189248f0c/
Changeset: e49189248f0c
Branch: yt
User: MatthewTurk
Date: 2016-07-11 22:19:50+00:00
Summary: Updating for comments
Affected #: 1 file
diff -r 8d626cf6521a22c666d1de6b529876c1b878be25 -r e49189248f0cad57e3a0b07bd3eb6d75f360b326 doc/source/visualizing/colormaps/index.rst
--- a/doc/source/visualizing/colormaps/index.rst
+++ b/doc/source/visualizing/colormaps/index.rst
@@ -10,12 +10,12 @@
In yt 3.3, we changed the default yt colormap from ``algae`` to ``arbre``.
This colormap was designed and voted on by the yt community and is designed to
-be easier for different color sensitivities as well as when printed in black
-and white. In 3.3, additional colormaps ``dusk``, ``hypnotoad`` and
-``octarine`` were also added, following the same guidelines. For a deeper
-dive into colormaps, see Stéfan van der Walt's SciPy 2015 talk about the new
-matplotlib colormap ``viridis`` at https://www.youtube.com/watch?v=xAoljeRJ3lU
-.
+be easier for people with different color sensitivities as well as when printed
+in black and white. In 3.3, additional colormaps ``dusk``, ``hypnotoad`` and
+``octarine`` were also added, following the same guidelines. For a deeper dive
+into colormaps, see the SciPy 2015 talk by Stéfan van der Walt and Nathaniel
+Smith about the new matplotlib colormap ``viridis`` at
+https://www.youtube.com/watch?v=xAoljeRJ3lU .
To specify a different default colormap (including ``viridis``), in your yt
configuration file (see :ref:`configuration-file`) you can set the value
https://bitbucket.org/yt_analysis/yt/commits/34215a75cce4/
Changeset: 34215a75cce4
Branch: yt
User: MatthewTurk
Date: 2016-07-11 22:36:32+00:00
Summary: I forgot we called it kelp instead of hypnotoad.
Affected #: 5 files
diff -r e49189248f0cad57e3a0b07bd3eb6d75f360b326 -r 34215a75cce49013f1910ac18733a926a668241e doc/source/visualizing/colormaps/index.rst
--- a/doc/source/visualizing/colormaps/index.rst
+++ b/doc/source/visualizing/colormaps/index.rst
@@ -11,7 +11,7 @@
In yt 3.3, we changed the default yt colormap from ``algae`` to ``arbre``.
This colormap was designed and voted on by the yt community and is designed to
be easier for people with different color sensitivities as well as when printed
-in black and white. In 3.3, additional colormaps ``dusk``, ``hypnotoad`` and
+in black and white. In 3.3, additional colormaps ``dusk``, ``kelp`` and
``octarine`` were also added, following the same guidelines. For a deeper dive
into colormaps, see the SciPy 2015 talk by Stéfan van der Walt and Nathaniel
Smith about the new matplotlib colormap ``viridis`` at
diff -r e49189248f0cad57e3a0b07bd3eb6d75f360b326 -r 34215a75cce49013f1910ac18733a926a668241e yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -427,12 +427,12 @@
--------
>>> keywords = {}
>>> keywords['dpi'] = (50, 100, 200)
- >>> keywords['cmap'] = ('arbre', 'hypnotoad')
+ >>> keywords['cmap'] = ('arbre', 'kelp')
>>> list_of_kwargs = expand_keywords(keywords)
>>> print list_of_kwargs
array([{'cmap': 'arbre', 'dpi': 50},
- {'cmap': 'hypnotoad', 'dpi': 100},
+ {'cmap': 'kelp', 'dpi': 100},
{'cmap': 'arbre', 'dpi': 200}], dtype=object)
>>> list_of_kwargs = expand_keywords(keywords, full=True)
@@ -441,9 +441,9 @@
array([{'cmap': 'arbre', 'dpi': 50},
{'cmap': 'arbre', 'dpi': 100},
{'cmap': 'arbre', 'dpi': 200},
- {'cmap': 'hypnotoad', 'dpi': 50},
- {'cmap': 'hypnotoad', 'dpi': 100},
- {'cmap': 'hypnotoad', 'dpi': 200}], dtype=object)
+ {'cmap': 'kelp', 'dpi': 50},
+ {'cmap': 'kelp', 'dpi': 100},
+ {'cmap': 'kelp', 'dpi': 200}], dtype=object)
>>> for kwargs in list_of_kwargs:
... write_projection(*args, **kwargs)
diff -r e49189248f0cad57e3a0b07bd3eb6d75f360b326 -r 34215a75cce49013f1910ac18733a926a668241e yt/visualization/eps_writer.py
--- a/yt/visualization/eps_writer.py
+++ b/yt/visualization/eps_writer.py
@@ -1045,7 +1045,7 @@
>>> "special.jpg"]
>>> cbs=[]
>>> cbs.append(return_cmap("arbre", "Density [cm$^{-3}$]", (0,10), False))
- >>> cbs.append(return_cmap("hypnotoad", "HI Density", (0,5), False))
+ >>> cbs.append(return_cmap("kelp", "HI Density", (0,5), False))
>>> cbs.append(return_cmap("hot", r"Entropy [K cm$^2$]", (1e-2,1e6), True))
>>> cbs.append(return_cmap("Spectral", "Stuff$_x$!", (1,300), True))
>>>
diff -r e49189248f0cad57e3a0b07bd3eb6d75f360b326 -r 34215a75cce49013f1910ac18733a926a668241e yt/visualization/image_writer.py
--- a/yt/visualization/image_writer.py
+++ b/yt/visualization/image_writer.py
@@ -287,7 +287,7 @@
def strip_colormap_data(fn = "color_map_data.py",
cmaps = ("jet", "algae", "hot", "gist_stern", "RdBu",
- "kamae", "hypnotoad", "arbre", "octarine", "dusk")):
+ "kamae", "kelp", "arbre", "octarine", "dusk")):
import pprint
from . import color_maps as rcm
f = open(fn, "w")
diff -r e49189248f0cad57e3a0b07bd3eb6d75f360b326 -r 34215a75cce49013f1910ac18733a926a668241e yt/visualization/tests/test_offaxisprojection.py
--- a/yt/visualization/tests/test_offaxisprojection.py
+++ b/yt/visualization/tests/test_offaxisprojection.py
@@ -65,7 +65,7 @@
wp_kwargs['take_log'] = (True, False)
wp_kwargs['figsize'] = ((8,6), [1,1])
wp_kwargs['dpi'] = (100, 50)
- wp_kwargs['cmap_name'] = ('arbre', 'hypnotoad')
+ wp_kwargs['cmap_name'] = ('arbre', 'kelp')
wp_kwargs_list = expand_keywords(wp_kwargs)
# test all off_axis_projection kwargs and write_projection kwargs
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