[yt-svn] commit/yt: MatthewTurk: Merged in ngoldbaum/yt/yt-3.0 (pull request #1065)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jul 24 04:50:45 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/58f37beaba3c/
Changeset:   58f37beaba3c
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-07-24 13:50:34
Summary:     Merged in ngoldbaum/yt/yt-3.0 (pull request #1065)

Dimensionless units should be multiplied through by cm in projections.  Closes #863.
Affected #:  1 file

diff -r 0a9b5f49e71502235e12f934476e918804dc8ded -r 58f37beaba3c763150dc4b1a83debafc5e8f63c8 yt/data_objects/construction_data_containers.py
--- a/yt/data_objects/construction_data_containers.py
+++ b/yt/data_objects/construction_data_containers.py
@@ -336,12 +336,9 @@
                                   registry=self.ds.unit_registry)
             if self.weight_field is None and not self._sum_only:
                 u_obj = Unit(units, registry=self.ds.unit_registry)
-                if u_obj.is_code_unit and input_units != units \
-                    or self.ds.no_cgs_equiv_length:
-                    if units is '':
-                        final_unit = "code_length"
-                    else:
-                        final_unit = "(%s) * code_length" % units
+                if (u_obj.is_code_unit and not u_obj.is_dimensionless) and \
+                  input_units != units or self.ds.no_cgs_equiv_length:
+                    final_unit = "(%s) * code_length" % units
                     self[field].convert_to_units(final_unit)
         for i in data.keys(): self[i] = data.pop(i)
         mylog.info("Projection completed")

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