[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Dec 3 07:26:04 PST 2013
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/d43ff9d8e20f/
Changeset: d43ff9d8e20f
Branch: stable
User: MatthewTurk
Date: 2013-12-03 16:25:36
Summary: Merging from mainline dev for bug fixes.
Affected #: 5 files
diff -r 6341229f0b1c12b05ce79735d772f0086f09d132 -r d43ff9d8e20f2d2b8f31f4189141d2521deb341b setup.py
--- a/setup.py
+++ b/setup.py
@@ -156,7 +156,7 @@
# End snippet
######
-VERSION = "2.6"
+VERSION = "2.6.1"
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
diff -r 6341229f0b1c12b05ce79735d772f0086f09d132 -r d43ff9d8e20f2d2b8f31f4189141d2521deb341b yt/__init__.py
--- a/yt/__init__.py
+++ b/yt/__init__.py
@@ -72,7 +72,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-__version__ = "2.5.5"
+__version__ = "2.6.1"
def run_nose(verbose=False, run_answer_tests=False, answer_big_data=False):
import nose, os, sys
diff -r 6341229f0b1c12b05ce79735d772f0086f09d132 -r d43ff9d8e20f2d2b8f31f4189141d2521deb341b yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -183,9 +183,52 @@
self._colormaps[field] = cmap_name
return self
+ @invalidate_plot
def set_zlim(self, field, zmin, zmax, dynamic_range=None):
- # Left blank to be overriden in subclasses
- pass
+ """set the scale of the colormap
+
+ Parameters
+ ----------
+ field : string
+ the field to set a colormap scale
+ if field == 'all', applies to all plots.
+ zmin : float
+ the new minimum of the colormap scale. If 'min', will
+ set to the minimum value in the current view.
+ zmax : float
+ the new maximum of the colormap scale. If 'max', will
+ set to the maximum value in the current view.
+
+ Other Parameters
+ ----------------
+ dynamic_range : float (default: None)
+ The dynamic range of the image.
+ If zmin == None, will set zmin = zmax / dynamic_range
+ If zmax == None, will set zmax = zmin * dynamic_range
+ When dynamic_range is specified, defaults to setting
+ zmin = zmax / dynamic_range.
+
+ """
+ if field is 'all':
+ fields = self.plots.keys()
+ else:
+ fields = [field]
+ for field in fields:
+ myzmin = zmin
+ myzmax = zmax
+ if zmin == 'min':
+ myzmin = self.plots[field].image._A.min()
+ if zmax == 'max':
+ myzmax = self.plots[field].image._A.max()
+ if dynamic_range is not None:
+ if zmax is None:
+ myzmax = myzmin * dynamic_range
+ else:
+ myzmin = myzmax / dynamic_range
+
+ self.plots[field].zmin = myzmin
+ self.plots[field].zmax = myzmax
+ return self
def setup_callbacks(self):
# Left blank to be overriden in subclasses
diff -r 6341229f0b1c12b05ce79735d772f0086f09d132 -r d43ff9d8e20f2d2b8f31f4189141d2521deb341b yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -730,53 +730,6 @@
self._plot_valid = True
- @invalidate_plot
- def set_zlim(self, field, zmin, zmax, dynamic_range=None):
- """set the scale of the colormap
-
- Parameters
- ----------
- field : string
- the field to set a colormap scale
- if field == 'all', applies to all plots.
- zmin : float
- the new minimum of the colormap scale. If 'min', will
- set to the minimum value in the current view.
- zmax : float
- the new maximum of the colormap scale. If 'max', will
- set to the maximum value in the current view.
-
- Other Parameters
- ----------------
- dynamic_range : float (default: None)
- The dynamic range of the image.
- If zmin == None, will set zmin = zmax / dynamic_range
- If zmax == None, will set zmax = zmin * dynamic_range
- When dynamic_range is specified, defaults to setting
- zmin = zmax / dynamic_range.
-
- """
- if field is 'all':
- fields = self.plots.keys()
- else:
- fields = [field]
- for field in fields:
- myzmin = zmin
- myzmax = zmax
- if zmin == 'min':
- myzmin = self.plots[field].image._A.min()
- if zmax == 'max':
- myzmax = self.plots[field].image._A.max()
- if dynamic_range is not None:
- if zmax is None:
- myzmax = myzmin * dynamic_range
- else:
- myzmin = myzmax / dynamic_range
-
- self.plots[field].zmin = myzmin
- self.plots[field].zmax = myzmax
- return self
-
def setup_callbacks(self):
for key in callback_registry:
ignored = ['PlotCallback','CoordAxesCallback','LabelCallback',
@@ -1195,6 +1148,11 @@
oblique=True, fontsize=fontsize)
self.set_axes_unit(axes_unit)
+ def _recreate_frb(self):
+ if self._frb is not None:
+ raise NotImplementedError
+ super(OffAxisProjectionPlot, self)._recreate_frb()
+
_metadata_template = """
%(pf)s<br><br>
diff -r 6341229f0b1c12b05ce79735d772f0086f09d132 -r d43ff9d8e20f2d2b8f31f4189141d2521deb341b yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -87,6 +87,21 @@
self[key] = figure.add_subplot(111)
return self[key]
+def sanitize_label(label, nprofiles):
+ label = ensure_list(label)
+
+ if len(label) == 1:
+ label = label * nprofiles
+
+ if len(label) != nprofiles:
+ raise RuntimeError("Number of labels must match number of profiles")
+
+ for l in label:
+ if l is not None and not isinstance(l, basestring):
+ raise RuntimeError("All labels must be None or a string")
+
+ return label
+
class ProfilePlot(object):
r"""
Create a 1d profile plot from a data source or from a list
@@ -195,9 +210,7 @@
else:
self.profiles = ensure_list(profiles)
- self.label = label
- if not isinstance(self.label, list):
- self.label = [self.label] * len(self.profiles)
+ self.label = sanitize_label(label, len(self.profiles))
self.plot_spec = plot_spec
if self.plot_spec is None:
@@ -306,7 +319,8 @@
axes.set_yscale(yscale)
axes.set_xlabel(xtitle)
axes.set_ylabel(ytitle)
- axes.legend(loc="best")
+ if any(self.label):
+ axes.legend(loc="best")
self._plot_valid = True
@classmethod
@@ -713,14 +727,13 @@
def _init_image(self, x_data, y_data, image_data,
x_scale, y_scale, z_scale, zlim, cmap):
"""Store output of imshow in image variable"""
-
if (z_scale == 'log'):
norm = matplotlib.colors.LogNorm(zlim[0], zlim[1])
elif (z_scale == 'linear'):
norm = matplotlib.colors.Normalize(zlim[0], zlim[1])
self.image = None
self.cb = None
- self.image = self.axes.pcolormesh(x_data, y_data, image_data,
+ self.image = self.axes.pcolormesh(x_data, y_data, image_data.T,
norm=norm,
cmap=cmap)
self.axes.set_xscale(x_scale)
https://bitbucket.org/yt_analysis/yt/commits/ec9a5117fc08/
Changeset: ec9a5117fc08
Branch: stable
User: MatthewTurk
Date: 2013-12-03 16:25:42
Summary: Added tag yt-2.6.1 for changeset d43ff9d8e20f
Affected #: 1 file
diff -r d43ff9d8e20f2d2b8f31f4189141d2521deb341b -r ec9a5117fc0817ccd1f668c22933c18b036e642a .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -5170,3 +5170,4 @@
4da03e5f00b68c3a52107ff75ce48b09360b30c2 yt-2.5.4
21c0314cee16242b6685e42a74d16f7a993c9a88 yt-2.5.5
053487f48672b8fd5c43af992e92bc2f2499f31f yt-2.6
+d43ff9d8e20f2d2b8f31f4189141d2521deb341b yt-2.6.1
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