[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jul 24 04:50:43 PDT 2014
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/4eb34b0501b5/
Changeset: 4eb34b0501b5
Branch: yt-3.0
User: ngoldbaum
Date: 2014-07-24 00:35:45
Summary: Dimensionless units should be multiplied through be cm in projections. Closes #863.
Affected #: 1 file
diff -r 816e624eefe07e7b3fd08cdb4185ab76c78fccec -r 4eb34b0501b55016b70039ee33cdbda43a5bf4f5 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")
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