[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jun 4 23:17:22 PDT 2014
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/4d579d77fef4/
Changeset: 4d579d77fef4
Branch: yt-3.0
User: ngoldbaum
Date: 2014-05-29 02:27:56
Summary: Switch to linear colorbar scaling if all plot values are negative.
Affected #: 1 file
diff -r 3cfb38afe34da0d502ee9ddfb303426dfe9e053e -r 4d579d77fef4878d4cd8be01eb3d766012c98036 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -761,12 +761,20 @@
image = self.frb[f]
- if image.max() == image.min() and zlim == (None, None):
- if self._field_transform[f] == log_transform:
- mylog.warning("Plot image for field %s has zero dynamic "
- "range. Min = Max = %d." % (f, image.max()))
+ if self._field_transform[f] == log_transform:
+ msg = None
+ if zlim != (None, None):
+ pass
+ elif image.max() == image.min():
+ msg = "Plot image for field %s has zero dynamic " \
+ "range. Min = Max = %d." % (f, image.max())
+ elif image.max() <= 0:
+ msg = "Plot image for field %s has no positive " \
+ "values. Max = %d." % (f, image.max())
+ if msg is not None:
+ mylog.warning(msg)
mylog.warning("Switching to linear colorbar scaling.")
- self._field_transform[f] = linear_transform
+ self._field_transform[f] = linear_transform
fp = self._font_properties
https://bitbucket.org/yt_analysis/yt/commits/85cc67a09580/
Changeset: 85cc67a09580
Branch: yt-3.0
User: ngoldbaum
Date: 2014-05-29 02:28:19
Summary: Adding a set_origin member function for the PlotWindow class.
Affected #: 1 file
diff -r 4d579d77fef4878d4cd8be01eb3d766012c98036 -r 85cc67a09580a544024fbdf1528bb846eb136018 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -448,6 +448,44 @@
self.frb[f].convert_to_units(u)
return self
+ @invalidate_plot
+ def set_origin(self, origin):
+ """Set the plot origin.
+
+ Parameters
+ ----------
+ origin : string or length 1, 2, or 3 sequence of strings
+ The location of the origin of the plot coordinate system. This is
+ represented by '-' separated string or a tuple of strings. In the
+ first index the y-location is given by 'lower', 'upper', or 'center'.
+ The second index is the x-location, given as 'left', 'right', or
+ 'center'. Finally, the whether the origin is applied in 'domain'
+ space, plot 'window' space or 'native' simulation coordinate system
+ is given. For example, both 'upper-right-domain' and ['upper',
+ 'right', 'domain'] both place the origin in the upper right hand
+ corner of domain space. If x or y are not given, a value is inffered.
+ For instance, 'left-domain' corresponds to the lower-left hand corner
+ of the simulation domain, 'center-domain' corresponds to the center
+ of the simulation domain, or 'center-window' for the center of the
+ plot window. Further examples:
+
+ ================================== ============================
+ format example
+ ================================== ============================
+ '{space}' 'domain'
+ '{xloc}-{space}' 'left-window'
+ '{yloc}-{space}' 'upper-domain'
+ '{yloc}-{xloc}-{space}' 'lower-right-window'
+ ('{space}',) ('window',)
+ ('{xloc}', '{space}') ('right', 'domain')
+ ('{yloc}', '{space}') ('lower', 'window')
+ ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window')
+ ================================== ============================
+
+ """
+ self.origin = origin
+ return self
+
@invalidate_data
def _set_window(self, bounds):
"""Set the bounds of the plot window.
https://bitbucket.org/yt_analysis/yt/commits/51fc454e1548/
Changeset: 51fc454e1548
Branch: yt-3.0
User: ngoldbaum
Date: 2014-06-05 02:48:19
Summary: Merging with mainline.
Affected #: 1 file
diff -r fe4b3e445a40ed0af3a9ce4740b88f4bb35a8a54 -r 51fc454e1548d776f335d2f30079569e9f3a81e7 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -448,6 +448,44 @@
self.frb[f].convert_to_units(u)
return self
+ @invalidate_plot
+ def set_origin(self, origin):
+ """Set the plot origin.
+
+ Parameters
+ ----------
+ origin : string or length 1, 2, or 3 sequence of strings
+ The location of the origin of the plot coordinate system. This is
+ represented by '-' separated string or a tuple of strings. In the
+ first index the y-location is given by 'lower', 'upper', or 'center'.
+ The second index is the x-location, given as 'left', 'right', or
+ 'center'. Finally, the whether the origin is applied in 'domain'
+ space, plot 'window' space or 'native' simulation coordinate system
+ is given. For example, both 'upper-right-domain' and ['upper',
+ 'right', 'domain'] both place the origin in the upper right hand
+ corner of domain space. If x or y are not given, a value is inffered.
+ For instance, 'left-domain' corresponds to the lower-left hand corner
+ of the simulation domain, 'center-domain' corresponds to the center
+ of the simulation domain, or 'center-window' for the center of the
+ plot window. Further examples:
+
+ ================================== ============================
+ format example
+ ================================== ============================
+ '{space}' 'domain'
+ '{xloc}-{space}' 'left-window'
+ '{yloc}-{space}' 'upper-domain'
+ '{yloc}-{xloc}-{space}' 'lower-right-window'
+ ('{space}',) ('window',)
+ ('{xloc}', '{space}') ('right', 'domain')
+ ('{yloc}', '{space}') ('lower', 'window')
+ ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window')
+ ================================== ============================
+
+ """
+ self.origin = origin
+ return self
+
@invalidate_data
def _set_window(self, bounds):
"""Set the bounds of the plot window.
@@ -761,12 +799,20 @@
image = self.frb[f]
- if image.max() == image.min() and zlim == (None, None):
- if self._field_transform[f] == log_transform:
- mylog.warning("Plot image for field %s has zero dynamic "
- "range. Min = Max = %d." % (f, image.max()))
+ if self._field_transform[f] == log_transform:
+ msg = None
+ if zlim != (None, None):
+ pass
+ elif image.max() == image.min():
+ msg = "Plot image for field %s has zero dynamic " \
+ "range. Min = Max = %d." % (f, image.max())
+ elif image.max() <= 0:
+ msg = "Plot image for field %s has no positive " \
+ "values. Max = %d." % (f, image.max())
+ if msg is not None:
+ mylog.warning(msg)
mylog.warning("Switching to linear colorbar scaling.")
- self._field_transform[f] = linear_transform
+ self._field_transform[f] = linear_transform
fp = self._font_properties
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