[yt-svn] commit/yt: jzuhone: Merged in ngoldbaum/yt (pull request #2269)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Jul 12 21:30:01 PDT 2016
1 new commit in yt:
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