<html><body>
<p>4 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/61d50b7967e3/">https://bitbucket.org/yt_analysis/yt/commits/61d50b7967e3/</a> Changeset:   61d50b7967e3 Branch:      yt User:        atmyers Date:        2016-04-01 19:48:45+00:00 Summary:     Make the Camera have a weak ref to the Scene, to allow it to be garbage collected. Affected #:  1 file</p>
<p>diff -r d18f33211199f71e2fac4d927307b015d513a328 -r 61d50b7967e38c6912e2b5ea678e591db573f248 yt/visualization/volume_rendering/camera.py --- a/yt/visualization/volume_rendering/camera.py +++ b/yt/visualization/volume_rendering/camera.py @@ -24,6 +24,7 @@</p>
<pre>    Lens
import numpy as np
from numbers import Number as numeric_type</pre>
<p>+import weakref</p>
<pre>def _sanitize_camera_property_units(value, scene):
    if iterable(value):</pre>
<p>@@ -126,7 +127,7 @@</p>
<pre>raise RuntimeError(
    'The first argument passed to the Camera initializer is a '
    '%s object, expected a %s object' % (type(scene), Scene))</pre>
<ul><li><p>self.scene = scene</p></li></ul>
<p>+        self.scene = weakref.proxy(scene)</p>
<pre>self.lens = None
self.north_vector = None
self.normal_vector = None</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/bd6bd8de783f/">https://bitbucket.org/yt_analysis/yt/commits/bd6bd8de783f/</a> Changeset:   bd6bd8de783f Branch:      yt User:        atmyers Date:        2016-04-01 19:49:42+00:00 Summary:     Give ImageSampler a <em>_dealloc</em>_ method. Affected #:  1 file</p>
<p>diff -r 61d50b7967e38c6912e2b5ea678e591db573f248 -r bd6bd8de783fd19ce26b1ccb9ed6ae2ff4b4687e yt/utilities/lib/grid_traversal.pyx --- a/yt/utilities/lib/grid_traversal.pyx +++ b/yt/utilities/lib/grid_traversal.pyx @@ -492,6 +492,15 @@</p>
<pre>    cdef void setup(self, PartitionedGrid pg):
        return
</pre>
<p>+    def __dealloc__(self): +        self.image.image = None +        self.image.vp_pos = None +        self.image.vp_dir = None +        self.image.zbuffer = None +        self.image.camera_data = None +        free(self.image) + +</p>
<pre>cdef void projection_sampler(
                 VolumeContainer *vc,
                 np.float64_t v_pos[3],</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/f24289d608dd/">https://bitbucket.org/yt_analysis/yt/commits/f24289d608dd/</a> Changeset:   f24289d608dd Branch:      yt User:        atmyers Date:        2016-04-02 08:32:44+00:00 Summary:     use pointers instead of memoryviews in Patch, doesn't seem to segfault after this. Affected #:  3 files</p>
<p>diff -r bd6bd8de783fd19ce26b1ccb9ed6ae2ff4b4687e -r f24289d608dd16bacf940bb1e1e69a1b165fa13d yt/utilities/lib/mesh_construction.pxd --- a/yt/utilities/lib/mesh_construction.pxd +++ b/yt/utilities/lib/mesh_construction.pxd @@ -2,6 +2,7 @@</p>
<pre>Vertex, \
Triangle, \
Vec3f</pre>
<p>+cimport numpy as np</p>
<pre>ctypedef struct MeshDataContainer:
    Vertex* vertices       # array of triangle vertices</pre>
<p>@@ -14,6 +15,5 @@</p>
<pre>ctypedef struct Patch:
    float[8][3] v
    unsigned int geomID</pre>
<ul><li><p>long [:,:] indices</p></li>
<li><p>double [:,:] vertices</p></li>
<li><p>double [:,:] field_data</p></li></ul>
<p>+    np.float64_t* vertices +    np.float64_t* field_data</p>
<p>diff -r bd6bd8de783fd19ce26b1ccb9ed6ae2ff4b4687e -r f24289d608dd16bacf940bb1e1e69a1b165fa13d yt/utilities/lib/mesh_construction.pyx --- a/yt/utilities/lib/mesh_construction.pyx +++ b/yt/utilities/lib/mesh_construction.pyx @@ -241,6 +241,8 @@</p>
<pre>    '''

    cdef Patch* patches</pre>
<p>+    cdef np.float64_t* vertices +    cdef np.float64_t* field_data</p>
<pre>cdef unsigned int mesh
# patches per element, vertices per element, and field points per
# element, respectively:</pre>
<p>@@ -265,11 +267,22 @@</p>
<pre>np.ndarray field_data):
         cdef int i, j, ind, idim
         cdef int ne = indices_in.shape[0]</pre>
<p>+        cdef int nv = vertices_in.shape[0]</p>
<pre>        cdef int npatch = 6*ne;

        cdef unsigned int mesh = rtcgu.rtcNewUserGeometry(scene.scene_i, npatch)
        cdef np.ndarray[np.float64_t, ndim=2] element_vertices</pre>
<ul><li><p>cdef Patch* patches = <Patch*> malloc(npatch * sizeof(Patch));</p></li></ul>
<p>+        cdef Patch* patches = <Patch*> malloc(npatch * sizeof(Patch)) +        self.vertices = <np.float64_t*> malloc(20 * ne * 3 * sizeof(np.float64_t)) +        self.field_data = <np.float64_t*> malloc(20 * ne * sizeof(np.float64_t)) + +        for i in range(ne): +            element_vertices = vertices_in[indices_in[i]] +            for j in range(20): +                self.field_data[i*20 + j] = field_data[i][j] +                for k in range(3): +                    self.vertices[i*20*3 + j*3 + k] = element_vertices[j][k] +</p>
<pre>         cdef Patch* patch
         for i in range(ne):  # for each element
element_vertices = vertices_in[indices_in[i]]</pre>
<p>@@ -280,9 +293,8 @@</p>
<pre>ind = hex20_faces[j][k]
for idim in range(3):  # for each spatial dimension (yikes)
    patch.v[k][idim] = element_vertices[ind][idim]</pre>
<ul><li><p>patch.indices = indices_in</p></li>
<li><p>patch.vertices = vertices_in</p></li>
<li><p>patch.field_data = field_data</p></li></ul>
<p>+                patch.vertices = self.vertices + i*20*3 +                patch.field_data = self.field_data + i*20</p>
<pre>self.patches = patches
self.mesh = mesh</pre>
<p>@@ -295,3 +307,5 @@</p>
<pre>def __dealloc__(self):
    free(self.patches)</pre>
<p>+        free(self.vertices) +        free(self.field_data)</p>
<p>diff -r bd6bd8de783fd19ce26b1ccb9ed6ae2ff4b4687e -r f24289d608dd16bacf940bb1e1e69a1b165fa13d yt/utilities/lib/mesh_samplers.pyx --- a/yt/utilities/lib/mesh_samplers.pyx +++ b/yt/utilities/lib/mesh_samplers.pyx @@ -196,9 +196,6 @@</p>
<pre>rtcr.RTCRay& ray) nogil:
     cdef int ray_id, elem_id, i
     cdef double val</pre>
<ul><li><p>cdef double[20] field_data</p></li>
<li><p>cdef int[20] element_indices</p></li>
<li><p>cdef double[60] vertices cdef double[3] position cdef float[3] pos cdef Patch* data</p></li></ul>
<p>@@ -220,16 +217,10 @@</p>
<pre>   for i in range(3):
       position[i] = <double> pos[i]
</pre>
<ul><li><p>for i in range(20):</p></li>
<li><p>field_data[i] = patch.field_data[elem_id, i]</p></li>
<li><p>vertices[i*3    ] = patch.vertices[patch.indices[elem_id, i]][0]</p></li>
<li><p>vertices[i*3 + 1] = patch.vertices[patch.indices[elem_id, i]][1]</p></li>
<li><p>vertices[i*3 + 2] = patch.vertices[patch.indices[elem_id, i]][2]</p></li></ul>
<p>–</p>
<pre># we use ray.time to pass the value of the field
cdef double mapped_coord[3]</pre>
<ul><li><p>S2Sampler.map_real_to_unit(mapped_coord, vertices, position)</p></li>
<li><p>val = S2Sampler.sample_at_unit_point(mapped_coord, field_data)</p></li></ul>
<p>+    S2Sampler.map_real_to_unit(mapped_coord, patch.vertices, position) +    val = S2Sampler.sample_at_unit_point(mapped_coord, patch.field_data)</p>
<pre>    ray.time = val

    # we use ray.instID to pass back whether the ray is near the</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/d0b73467db93/">https://bitbucket.org/yt_analysis/yt/commits/d0b73467db93/</a> Changeset:   d0b73467db93 Branch:      yt User:        atmyers Date:        2016-04-02 16:27:37+00:00 Summary:     fix bounding volume hierarchy test Affected #:  1 file</p>
<p>diff -r f24289d608dd16bacf940bb1e1e69a1b165fa13d -r d0b73467db93927ae19868ebc814eaab239c2317 yt/utilities/lib/tests/test_bounding_volume_hierarchy.py --- a/yt/utilities/lib/tests/test_bounding_volume_hierarchy.py +++ b/yt/utilities/lib/tests/test_bounding_volume_hierarchy.py @@ -36,7 +36,8 @@</p>
<pre>    bvh = BVH(vertices, indices, field_data)
</pre>
<ul><li><p>cam = Camera(Scene())</p></li></ul>
<p>+    sc = Scene() +    cam = Camera(sc)</p>
<pre>cam.set_position(np.array([8.0, 8.0, 8.0]))
cam.focus = np.array([0.0, 0.0, 0.0])
origins, direction = get_rays(cam)</pre>
<p>Repository URL: <a href="https://bitbucket.org/yt_analysis/yt/">https://bitbucket.org/yt_analysis/yt/</a></p>
<p>—</p>
<p>This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.</p>

<img src="http://link.bitbucket.org/wf/open?upn=ll4ctv0L-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27CdFadfuAbmY-2BvozYkl2pNyTXDaJ-2Be4TUb62XiMClFm4oK-2BQpzeDViDyXzGYERoHm2oIJzfpT9Q2YzgywJdr5hxLB-2BtL13UCxR8szQdHePCNU98Fpryd-2B6ks-2FYygERl00c8gsw6iQ-2FEfMTsXUgDx4GRzFX-2FBvXfG6UIUH7cDBvURZUmwal1qc4lX9YpTMO7u0g-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>