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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Oct 17 14:18:31 PDT 2016


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/363ea8f7fbe5/
Changeset:   363ea8f7fbe5
Branch:      yt
User:        ngoldbaum
Date:        2016-09-16 02:25:21+00:00
Summary:     Avoid a zero division error in the volume renderer by using C division
Affected #:  2 files

diff -r 9117a13f556156c853cb5983fb8752a068657c75 -r 363ea8f7fbe56e7c786a329cf2fe018279b47be9 yt/utilities/lib/lenses.pxd
--- a/yt/utilities/lib/lenses.pxd
+++ b/yt/utilities/lib/lenses.pxd
@@ -45,8 +45,8 @@
     np.float64_t *y_vec
 
 
-ctypedef void calculate_extent_function(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil
+ctypedef int calculate_extent_function(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1
 
 ctypedef void generate_vector_info_function(ImageContainer *im,
             np.int64_t vi, np.int64_t vj,

diff -r 9117a13f556156c853cb5983fb8752a068657c75 -r 363ea8f7fbe56e7c786a329cf2fe018279b47be9 yt/utilities/lib/lenses.pyx
--- a/yt/utilities/lib/lenses.pyx
+++ b/yt/utilities/lib/lenses.pyx
@@ -20,8 +20,9 @@
 
 @cython.boundscheck(False)
 @cython.wraparound(False)
-cdef void calculate_extent_plane_parallel(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil:
+ at cython.cdivision(True)
+cdef int calculate_extent_plane_parallel(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
     # We do this for all eight corners
     cdef np.float64_t temp
     cdef np.float64_t *edges[2]
@@ -53,11 +54,13 @@
     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)
     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)
     rv[3] = rv[2] + lrint((extrema[3] - extrema[2])/image.pdy)
+    return 0
 
 @cython.boundscheck(False)
 @cython.wraparound(False)
-cdef void calculate_extent_perspective(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil:
+ at cython.cdivision(True)
+cdef int calculate_extent_perspective(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
 
     cdef np.float64_t cam_pos[3]
     cdef np.float64_t cam_width[3]
@@ -156,19 +159,21 @@
     rv[1] = min(max_px, image.nv[0])
     rv[2] = max(min_py, 0)
     rv[3] = min(max_py, image.nv[1])
-
+    return 0
 
 # We do this for a bunch of lenses.  Fallback is to grab them from the vector
 # info supplied.
 
 @cython.boundscheck(False)
 @cython.wraparound(False)
-cdef void calculate_extent_null(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil:
+ at cython.cdivision(True)
+cdef int calculate_extent_null(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
     rv[0] = 0
     rv[1] = image.nv[0]
     rv[2] = 0
     rv[3] = image.nv[1]
+    return 0
 
 @cython.boundscheck(False)
 @cython.wraparound(False)


https://bitbucket.org/yt_analysis/yt/commits/ea9b52291772/
Changeset:   ea9b52291772
Branch:      yt
User:        ngoldbaum
Date:        2016-10-17 21:18:03+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2379)

Avoid a zero division error in the volume renderer by using C division
Affected #:  2 files

diff -r 3c5bbf6a2e8555dc82f728961a8163ac16547f56 -r ea9b5229177223a3a437915cf17b130cf2b4584a yt/utilities/lib/lenses.pxd
--- a/yt/utilities/lib/lenses.pxd
+++ b/yt/utilities/lib/lenses.pxd
@@ -45,8 +45,8 @@
     np.float64_t *y_vec
 
 
-ctypedef void calculate_extent_function(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil
+ctypedef int calculate_extent_function(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1
 
 ctypedef void generate_vector_info_function(ImageContainer *im,
             np.int64_t vi, np.int64_t vj,

diff -r 3c5bbf6a2e8555dc82f728961a8163ac16547f56 -r ea9b5229177223a3a437915cf17b130cf2b4584a yt/utilities/lib/lenses.pyx
--- a/yt/utilities/lib/lenses.pyx
+++ b/yt/utilities/lib/lenses.pyx
@@ -20,8 +20,9 @@
 
 @cython.boundscheck(False)
 @cython.wraparound(False)
-cdef void calculate_extent_plane_parallel(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil:
+ at cython.cdivision(True)
+cdef int calculate_extent_plane_parallel(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
     # We do this for all eight corners
     cdef np.float64_t temp
     cdef np.float64_t *edges[2]
@@ -53,11 +54,13 @@
     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)
     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)
     rv[3] = rv[2] + lrint((extrema[3] - extrema[2])/image.pdy)
+    return 0
 
 @cython.boundscheck(False)
 @cython.wraparound(False)
-cdef void calculate_extent_perspective(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil:
+ at cython.cdivision(True)
+cdef int calculate_extent_perspective(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
 
     cdef np.float64_t cam_pos[3]
     cdef np.float64_t cam_width[3]
@@ -156,19 +159,21 @@
     rv[1] = min(max_px, image.nv[0])
     rv[2] = max(min_py, 0)
     rv[3] = min(max_py, image.nv[1])
-
+    return 0
 
 # We do this for a bunch of lenses.  Fallback is to grab them from the vector
 # info supplied.
 
 @cython.boundscheck(False)
 @cython.wraparound(False)
-cdef void calculate_extent_null(ImageContainer *image,
-            VolumeContainer *vc, np.int64_t rv[4]) nogil:
+ at cython.cdivision(True)
+cdef int calculate_extent_null(ImageContainer *image,
+            VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
     rv[0] = 0
     rv[1] = image.nv[0]
     rv[2] = 0
     rv[3] = image.nv[1]
+    return 0
 
 @cython.boundscheck(False)
 @cython.wraparound(False)

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