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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Jul 12 21:30:04 PDT 2016


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/0fb050f172b6/
Changeset:   0fb050f172b6
Branch:      yt
User:        ngoldbaum
Date:        2016-07-09 15:14:53+00:00
Summary:     Fix compilation on windows by adding stand-alone erf implementation for windows
Affected #:  3 files

diff -r b264176ae1527a32714dbd782c7f5a3e79dc993a -r 0fb050f172b6585d970ed9939d5636ed9eea9268 setup.py
--- a/setup.py
+++ b/setup.py
@@ -76,7 +76,8 @@
 
 cython_extensions = [
     Extension("yt.analysis_modules.photon_simulator.utils",
-              ["yt/analysis_modules/photon_simulator/utils.pyx"]),
+              ["yt/analysis_modules/photon_simulator/utils.pyx"],
+              include_dirs=["yt/utilities/lib"]),
     Extension("yt.analysis_modules.ppv_cube.ppv_utils",
               ["yt/analysis_modules/ppv_cube/ppv_utils.pyx"],
               libraries=std_libs),

diff -r b264176ae1527a32714dbd782c7f5a3e79dc993a -r 0fb050f172b6585d970ed9939d5636ed9eea9268 yt/analysis_modules/photon_simulator/utils.pyx
--- a/yt/analysis_modules/photon_simulator/utils.pyx
+++ b/yt/analysis_modules/photon_simulator/utils.pyx
@@ -1,7 +1,9 @@
 import numpy as np
 cimport numpy as np
 cimport cython
-from libc.math cimport erf
+
+cdef extern from "platform_dep.h":
+    double erf(double x)
     
 @cython.cdivision(True)
 @cython.boundscheck(False)

diff -r b264176ae1527a32714dbd782c7f5a3e79dc993a -r 0fb050f172b6585d970ed9939d5636ed9eea9268 yt/utilities/lib/platform_dep.h
--- a/yt/utilities/lib/platform_dep.h
+++ b/yt/utilities/lib/platform_dep.h
@@ -26,9 +26,39 @@
 static __inline double log2(double x) {
     return log(x) * M_LOG2E;
 }
+
+/* adapted from http://www.johndcook.com/blog/cpp_erf/
+   code is under public domain license */
+
+double erf(double x)
+{
+    /* constants */
+    double a1 =  0.254829592;
+    double a2 = -0.284496736;
+    double a3 =  1.421413741;
+    double a4 = -1.453152027;
+    double a5 =  1.061405429;
+    double p  =  0.3275911;
+    double t;
+    double y;
+
+    /* Save the sign of x */
+    int sign = 1;
+    if (x < 0)
+        sign = -1;
+    x = fabs(x);
+
+    /* A&S formula 7.1.26 */
+    t = 1.0/(1.0 + p*x);
+    y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
+
+    return sign*y;
+}
+
 #else
 #include <stdint.h>
 #include "alloca.h"
+#include <math.h>
 #endif
 
 


https://bitbucket.org/yt_analysis/yt/commits/2476236c05b2/
Changeset:   2476236c05b2
Branch:      yt
User:        ngoldbaum
Date:        2016-07-09 15:14:59+00:00
Summary:     Ensure px and py are int64 in calls to zlines
Affected #:  1 file

diff -r 0fb050f172b6585d970ed9939d5636ed9eea9268 -r 2476236c05b2ea9ed6841d6de609a8c3b6c60e99 yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -853,6 +853,9 @@
         camera.lens.setup_box_properties(camera)
         px, py, dz = camera.lens.project_to_plane(camera, vertices)
 
+        px = px.astype('int64')
+        py = py.astype('int64')
+
         if len(px.shape) == 1:
             zlines(empty, z, px, py, dz, self.colors, self.color_stride)
         else:
@@ -1150,6 +1153,9 @@
 
         # Draw the vectors
 
+        px = px.astype('int64')
+        py = py.astype('int64')
+
         if len(px.shape) == 1:
             zlines(empty, z, px, py, dz, self.colors, self.color_stride)
         else:


https://bitbucket.org/yt_analysis/yt/commits/8ee738effdce/
Changeset:   8ee738effdce
Branch:      yt
User:        jzuhone
Date:        2016-07-12 18:33:52+00:00
Summary:     This fixes a windows test failure
Affected #:  1 file

diff -r 2476236c05b2ea9ed6841d6de609a8c3b6c60e99 -r 8ee738effdce2df8ab5d69a8d4d5dc19b54c0285 yt/analysis_modules/level_sets/contour_finder.py
--- a/yt/analysis_modules/level_sets/contour_finder.py
+++ b/yt/analysis_modules/level_sets/contour_finder.py
@@ -51,7 +51,7 @@
             [contour_ids.view("float64")], mask,
             LE, RE, dims.astype("int64"))
         contours[nid] = (g.Level, node.node_ind, pg, sl)
-    node_ids = np.array(node_ids)
+    node_ids = np.array(node_ids).astype("int64")
     if node_ids.size == 0:
         return 0, {}
     trunk = data_source.tiles.tree.trunk


https://bitbucket.org/yt_analysis/yt/commits/5e50ddf62454/
Changeset:   5e50ddf62454
Branch:      yt
User:        jzuhone
Date:        2016-07-13 04:29:34+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2269)

Windows fixes. Closes #1240
Affected #:  5 files

diff -r 3c0c6f90d620f629bb71a989eb8c5c9a0b6958b7 -r 5e50ddf62454f276c63fc939ab6aa96cceefc817 setup.py
--- a/setup.py
+++ b/setup.py
@@ -76,7 +76,8 @@
 
 cython_extensions = [
     Extension("yt.analysis_modules.photon_simulator.utils",
-              ["yt/analysis_modules/photon_simulator/utils.pyx"]),
+              ["yt/analysis_modules/photon_simulator/utils.pyx"],
+              include_dirs=["yt/utilities/lib"]),
     Extension("yt.analysis_modules.ppv_cube.ppv_utils",
               ["yt/analysis_modules/ppv_cube/ppv_utils.pyx"],
               libraries=std_libs),

diff -r 3c0c6f90d620f629bb71a989eb8c5c9a0b6958b7 -r 5e50ddf62454f276c63fc939ab6aa96cceefc817 yt/analysis_modules/level_sets/contour_finder.py
--- a/yt/analysis_modules/level_sets/contour_finder.py
+++ b/yt/analysis_modules/level_sets/contour_finder.py
@@ -51,7 +51,7 @@
             [contour_ids.view("float64")], mask,
             LE, RE, dims.astype("int64"))
         contours[nid] = (g.Level, node.node_ind, pg, sl)
-    node_ids = np.array(node_ids)
+    node_ids = np.array(node_ids).astype("int64")
     if node_ids.size == 0:
         return 0, {}
     trunk = data_source.tiles.tree.trunk

diff -r 3c0c6f90d620f629bb71a989eb8c5c9a0b6958b7 -r 5e50ddf62454f276c63fc939ab6aa96cceefc817 yt/analysis_modules/photon_simulator/utils.pyx
--- a/yt/analysis_modules/photon_simulator/utils.pyx
+++ b/yt/analysis_modules/photon_simulator/utils.pyx
@@ -1,7 +1,9 @@
 import numpy as np
 cimport numpy as np
 cimport cython
-from libc.math cimport erf
+
+cdef extern from "platform_dep.h":
+    double erf(double x)
     
 @cython.cdivision(True)
 @cython.boundscheck(False)

diff -r 3c0c6f90d620f629bb71a989eb8c5c9a0b6958b7 -r 5e50ddf62454f276c63fc939ab6aa96cceefc817 yt/utilities/lib/platform_dep.h
--- a/yt/utilities/lib/platform_dep.h
+++ b/yt/utilities/lib/platform_dep.h
@@ -26,9 +26,39 @@
 static __inline double log2(double x) {
     return log(x) * M_LOG2E;
 }
+
+/* adapted from http://www.johndcook.com/blog/cpp_erf/
+   code is under public domain license */
+
+double erf(double x)
+{
+    /* constants */
+    double a1 =  0.254829592;
+    double a2 = -0.284496736;
+    double a3 =  1.421413741;
+    double a4 = -1.453152027;
+    double a5 =  1.061405429;
+    double p  =  0.3275911;
+    double t;
+    double y;
+
+    /* Save the sign of x */
+    int sign = 1;
+    if (x < 0)
+        sign = -1;
+    x = fabs(x);
+
+    /* A&S formula 7.1.26 */
+    t = 1.0/(1.0 + p*x);
+    y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
+
+    return sign*y;
+}
+
 #else
 #include <stdint.h>
 #include "alloca.h"
+#include <math.h>
 #endif
 
 

diff -r 3c0c6f90d620f629bb71a989eb8c5c9a0b6958b7 -r 5e50ddf62454f276c63fc939ab6aa96cceefc817 yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -853,6 +853,9 @@
         camera.lens.setup_box_properties(camera)
         px, py, dz = camera.lens.project_to_plane(camera, vertices)
 
+        px = px.astype('int64')
+        py = py.astype('int64')
+
         if len(px.shape) == 1:
             zlines(empty, z, px, py, dz, self.colors, self.color_stride)
         else:
@@ -1150,6 +1153,9 @@
 
         # Draw the vectors
 
+        px = px.astype('int64')
+        py = py.astype('int64')
+
         if len(px.shape) == 1:
             zlines(empty, z, px, py, dz, self.colors, self.color_stride)
         else:

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