[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Sep 20 12:47:31 PDT 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/362b33f58e79/
Changeset:   362b33f58e79
Branch:      yt
User:        chummels
Date:        2014-09-16 21:55:59+00:00
Summary:     Fixes a bug and allows <data_object>.volume() to work in yt 3.
Affected #:  1 file

diff -r 6f0db65e21bcabd8283cadb52e30b6c1ed9a4afc -r 362b33f58e794c34fcd1e0cb39fc5284fc58342c yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -1189,16 +1189,15 @@
         return self._particle_handler
 
 
-    def volume(self, unit = "unitary"):
+    def volume(self):
         """
-        Return the volume of the data container in units *unit*.
+        Return the volume of the data container.
         This is found by adding up the volume of the cells with centers
         in the container, rather than using the geometric shape of
         the container, so this may vary very slightly
         from what might be expected from the geometric volume.
         """
-        return self.quantities["TotalQuantity"]("CellVolume")[0] * \
-            (self.ds[unit] / self.ds['cm']) ** 3.0
+        return self.quantities.total_quantity(("index", "cell_volume"))
 
 # Many of these items are set up specifically to ensure that
 # we are not breaking old pickle files.  This means we must only call the


https://bitbucket.org/yt_analysis/yt/commits/d51b1eef25de/
Changeset:   d51b1eef25de
Branch:      yt
User:        MatthewTurk
Date:        2014-09-20 19:47:24+00:00
Summary:     Merged in chummels/yt (pull request #1212)

[BUGFIX] Fixes a bug and allows <data_object>.volume() to work in yt 3.
Affected #:  1 file

diff -r 136ffa2fd6c73f75288e0617b407d247783ac425 -r d51b1eef25de78251872054e764e2428ff220c13 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -1191,16 +1191,15 @@
         return self._particle_handler
 
 
-    def volume(self, unit = "unitary"):
+    def volume(self):
         """
-        Return the volume of the data container in units *unit*.
+        Return the volume of the data container.
         This is found by adding up the volume of the cells with centers
         in the container, rather than using the geometric shape of
         the container, so this may vary very slightly
         from what might be expected from the geometric volume.
         """
-        return self.quantities["TotalQuantity"]("CellVolume")[0] * \
-            (self.ds[unit] / self.ds['cm']) ** 3.0
+        return self.quantities.total_quantity(("index", "cell_volume"))
 
 # Many of these items are set up specifically to ensure that
 # we are not breaking old pickle files.  This means we must only call the

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