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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue May 16 08:58:41 PDT 2017


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/d15cad7dba2a/
Changeset:   d15cad7dba2a
User:        xarthisius
Date:        2017-05-15 21:05:14+00:00
Summary:     Use an integer division for computing a number of cells in each direction
Affected #:  1 file

diff -r 4781b57a6aecacf0200584103bfc0c96961efd38 -r d15cad7dba2a3b50d47f7fc969cba09d8b5f8252 doc/source/cookbook/power_spectrum_example.py
--- a/doc/source/cookbook/power_spectrum_example.py
+++ b/doc/source/cookbook/power_spectrum_example.py
@@ -40,7 +40,7 @@
 
     nindex_rho = 1./3.
 
-    Kk = np.zeros( (nx/2+1, ny/2+1, nz/2+1))
+    Kk = np.zeros( (nx//2+1, ny//2+1, nz//2+1))
 
     for vel in [("gas", "velocity_x"), ("gas", "velocity_y"),
                 ("gas", "velocity_z")]:
@@ -106,7 +106,7 @@
     # the first half of the axes -- that's what we keep.  Our
     # normalization has an '8' to account for this clipping to one
     # octant.
-    ru = np.fft.fftn(rho**nindex_rho * u)[0:nx/2+1,0:ny/2+1,0:nz/2+1]
+    ru = np.fft.fftn(rho**nindex_rho * u)[0:nx//2+1,0:ny//2+1,0:nz//2+1]
     ru = 8.0*ru/(nx*ny*nz)
 
     return np.abs(ru)**2


https://bitbucket.org/yt_analysis/yt/commits/376e80b3d767/
Changeset:   376e80b3d767
User:        xarthisius
Date:        2017-05-15 21:28:57+00:00
Summary:     Number of pixels should be an int, not a dimensionless quantity
Affected #:  1 file

diff -r d15cad7dba2a3b50d47f7fc969cba09d8b5f8252 -r 376e80b3d767c48e04a01fe6be1c9d98a9eefccf yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
@@ -298,7 +298,7 @@
                              "or a tuple of type (float, str).")
         
         # Calculate number of pixels on a side.
-        pixels = (field_of_view / image_resolution).in_units("")
+        pixels = int((field_of_view / image_resolution).in_units(""))
 
         # Clear projection stack.
         projection_stack = []


https://bitbucket.org/yt_analysis/yt/commits/248f4d928133/
Changeset:   248f4d928133
User:        ngoldbaum
Date:        2017-05-16 15:58:29+00:00
Summary:     Merge pull request #1391 from Xarthisius/master

Docs fixes
Affected #:  2 files

diff -r 4781b57a6aecacf0200584103bfc0c96961efd38 -r 248f4d9281332c1a0379a5899af41c14aca0bc55 doc/source/cookbook/power_spectrum_example.py
--- a/doc/source/cookbook/power_spectrum_example.py
+++ b/doc/source/cookbook/power_spectrum_example.py
@@ -40,7 +40,7 @@
 
     nindex_rho = 1./3.
 
-    Kk = np.zeros( (nx/2+1, ny/2+1, nz/2+1))
+    Kk = np.zeros( (nx//2+1, ny//2+1, nz//2+1))
 
     for vel in [("gas", "velocity_x"), ("gas", "velocity_y"),
                 ("gas", "velocity_z")]:
@@ -106,7 +106,7 @@
     # the first half of the axes -- that's what we keep.  Our
     # normalization has an '8' to account for this clipping to one
     # octant.
-    ru = np.fft.fftn(rho**nindex_rho * u)[0:nx/2+1,0:ny/2+1,0:nz/2+1]
+    ru = np.fft.fftn(rho**nindex_rho * u)[0:nx//2+1,0:ny//2+1,0:nz//2+1]
     ru = 8.0*ru/(nx*ny*nz)
 
     return np.abs(ru)**2

diff -r 4781b57a6aecacf0200584103bfc0c96961efd38 -r 248f4d9281332c1a0379a5899af41c14aca0bc55 yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
@@ -298,7 +298,7 @@
                              "or a tuple of type (float, str).")
         
         # Calculate number of pixels on a side.
-        pixels = (field_of_view / image_resolution).in_units("")
+        pixels = int((field_of_view / image_resolution).in_units(""))
 
         # Clear projection stack.
         projection_stack = []

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