[yt-svn] commit/yt-doc: MatthewTurk: Thanks to nscudder for pointing out an extra sum() here!

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Jun 25 19:49:31 PDT 2013


1 new commit in yt-doc:

https://bitbucket.org/yt_analysis/yt-doc/commits/a8809ea3f352/
Changeset:   a8809ea3f352
User:        MatthewTurk
Date:        2013-06-26 04:45:54
Summary:     Thanks to nscudder for pointing out an extra sum() here!
Affected #:  1 file

diff -r d4865fc6147bafab6d7f1c40328a23887868b1fc -r a8809ea3f352fac38c45d135d3e71c7f14bd783f source/orientation/first_steps.rst
--- a/source/orientation/first_steps.rst
+++ b/source/orientation/first_steps.rst
@@ -191,11 +191,11 @@
 sphere do not have to be in memory.  For instance, to calculate the center of
 mass, one could imagine doing something like this::
 
-   >>> M_i = my_sphere["CellMassMsun"].sum()
+   >>> M_i = my_sphere["CellMassMsun"]
    >>> M = M_i.sum()
-   >>> com_x = (my_sphere["x"] * M_i)/M
-   >>> com_y = (my_sphere["y"] * M_i)/M
-   >>> com_z = (my_sphere["z"] * M_i)/M
+   >>> com_x = (my_sphere["x"] * M_i).sum()/M
+   >>> com_y = (my_sphere["y"] * M_i).sum()/M
+   >>> com_z = (my_sphere["z"] * M_i).sum()/M
 
 But for this to work, all of the arrays listed would have to be held in memory,
 even though the algorithm operates on each element individually.  Clearly, the

Repository URL: https://bitbucket.org/yt_analysis/yt-doc/

--

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