[yt-svn] commit/yt: MatthewTurk: Merged in chummels/yt (pull request #1212)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Sat Sep 20 12:47:32 PDT 2014
1 new commit in yt:
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