[yt-svn] commit/yt: MatthewTurk: Fixing units for projections in the plot window

Bitbucket commits-noreply at bitbucket.org
Tue Jul 10 04:21:37 PDT 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/8e55cb05ac89/
changeset:   8e55cb05ac89
branch:      yt
user:        MatthewTurk
date:        2012-07-10 13:21:24
summary:     Fixing units for projections in the plot window
affected #:  1 file

diff -r 5cbdc449cf53f66a1f01b1238b8dec0990577b21 -r 8e55cb05ac89ba9fd84af777c95c597683995137 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -602,7 +602,8 @@
     def get_field_units(self, field, strip_mathml = True):
         ds = self._frb.data_source
         pf = self.pf
-        if ds._type_name == "slice" or "cutting":
+        if ds._type_name in ("slice", "cutting") or \
+           (ds._type_name == "proj" and ds.weight_field is not None):
             units = pf.field_info[field].get_units()
         elif ds._type_name == "proj":
             units = pf.field_info[field].get_projected_units()

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