<html><body>
<p>3 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/aeabb6b91093/">https://bitbucket.org/yt_analysis/yt/commits/aeabb6b91093/</a> Changeset:   aeabb6b91093 Branch:      yt User:        MatthewTurk Date:        2016-05-05 22:09:54+00:00 Summary:     Switch out to a stateful index handler Affected #:  1 file</p>
<p>diff -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f -r aeabb6b91093da1aef6e893ece39a4a49514b844 yt/data_objects/octree_subset.py --- a/yt/data_objects/octree_subset.py +++ b/yt/data_objects/octree_subset.py @@ -433,57 +433,62 @@</p>
<pre>        self.base_region = base_region
        self.base_selector = base_region.selector
</pre>
<p>+class OctreeSubsetBlockSlicePosition(object): +    def __init__(self, ind, block_slice): +        self.ind = ind +        self.block_slice = block_slice +        nz = self.block_slice.octree_subset.nz +        self.ActiveDimensions = np.array([nz,nz,nz], dtype="int64") + +    def __getitem__(self, key): +        bs = self.block_slice +        rv = bs.octree_subset[key][:,:,:,self.ind] +        if bs.octree_subset._block_reorder: +            rv = rv.copy(order=bs.octree_subset._block_reorder) +        return rv + +    @property +    def id(self): +        return self.ind + +    @property +    def Level(self): +        return self.block_slice._ires[0,0,0,self.ind] + +    @property +    def LeftEdge(self): +        LE = (self.block_slice._fcoords[0,0,0,self.ind,:] +            – self.block_slice._fwidth[0,0,0,self.ind,:]*0.5) +        return LE + +    @property +    def RightEdge(self): +        RE = (self.block_slice._fcoords[-1,-1,-1,self.ind,:] +            + self.block_slice._fwidth[-1,-1,-1,self.ind,:]*0.5) +        return RE + +    @property +    def dds(self): +        return self.block_slice._fwidth[0,0,0,self.ind,:] + +    def clear_data(self): +        pass + +    def get_vertex_centered_data(self, *args, **kwargs): +        raise NotImplementedError + +</p>
<pre>class OctreeSubsetBlockSlice(object):
    def __init__(self, octree_subset):</pre>
<ul><li><p>self.ind = None self.octree_subset = octree_subset # Cache some attributes</p></li>
<li><p>nz = octree_subset.nz</p></li>
<li><p>self.ActiveDimensions = np.array([nz,nz,nz], dtype="int64") for attr in ["ires", “icoords”, “fcoords”, "fwidth"]:</p>
<pre>   v = getattr(octree_subset, attr)
   setattr(self, "_%s" % attr, octree_subset._reshape_vals(v))
</pre></li></ul>
<pre>def __iter__(self):
    for i in range(self._ires.shape[-1]):</pre>
<ul><li><p>self.ind = i</p></li>
<li><p>yield i, self</p></li></ul>
<p>–</p>
<ul><li><p>def clear_data(self):</p></li>
<li><p>pass</p></li></ul>
<p>–</p>
<ul><li><p>def __getitem__(self, key):</p></li>
<li><p>rv = self.octree_subset[key][:,:,:,self.ind]</p></li>
<li><p>if self.octree_subset._block_reorder:</p></li>
<li><p>rv = rv.copy(order=self.octree_subset._block_reorder)</p></li>
<li><p>return rv</p></li></ul>
<p>–</p>
<ul><li><p>def get_vertex_centered_data(self, *args, **kwargs):</p></li>
<li><p>raise NotImplementedError</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def id(self):</p></li>
<li><p>return np.random.randint(1)</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def Level(self):</p></li>
<li><p>return self._ires[0,0,0,self.ind]</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def LeftEdge(self):</p></li>
<li><p>LE = (self._fcoords[0,0,0,self.ind,:]</p></li>
<li><ul><li><p>self._fwidth[0,0,0,self.ind,:]*0.5)</p></li></ul></li>
<li><p>return LE</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def RightEdge(self):</p></li>
<li><p>RE = (self._fcoords[-1,-1,-1,self.ind,:]</p></li>
<li><p>+ self._fwidth[-1,-1,-1,self.ind,:]*0.5)</p></li>
<li><p>return RE</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def dds(self):</p></li>
<li><p>return self._fwidth[0,0,0,self.ind,:]</p></li></ul>
<p>+            yield i, OctreeSubsetBlockSlicePosition(i, self)</p>
<pre>class YTPositionArray(YTArray):
    @property</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/709f120991e6/">https://bitbucket.org/yt_analysis/yt/commits/709f120991e6/</a> Changeset:   709f120991e6 Branch:      yt User:        ngoldbaum Date:        2016-05-16 17:56:35+00:00 Summary:     Fix remaining segfaults for octree construction Affected #:  1 file</p>
<p>diff -r aeabb6b91093da1aef6e893ece39a4a49514b844 -r 709f120991e600640eb4b7e676d1d8dd0eac016e yt/utilities/lib/amr_kdtools.pyx --- a/yt/utilities/lib/amr_kdtools.pyx +++ b/yt/utilities/lib/amr_kdtools.pyx @@ -438,7 +438,6 @@</p>
<pre># If best_dim is -1, then we have found a place where there are no choices.
# Exit out and set the node to None.
if best_dim == -1:</pre>
<ul><li><p>print ‘Failed to split grid.’ return -1</p></li></ul>
<p>@@ -509,6 +508,11 @@</p>
<pre>best_dim = dim
my_max = n_unique
my_split = (n_unique-1)/2</pre>
<p>+    if best_dim == -1: +        for i in range(3): +            free(uniquedims[i]) +        free(uniquedims) +        return -1, 0, 0, 0</p>
<pre># I recognize how lame this is.
cdef np.ndarray[np.float64_t, ndim=1] tarr = np.empty(my_max, dtype='float64')
for i in range(my_max):</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/ff0ec06d8bd6/">https://bitbucket.org/yt_analysis/yt/commits/ff0ec06d8bd6/</a> Changeset:   ff0ec06d8bd6 Branch:      yt User:        bwkeller Date:        2016-05-18 18:20:23+00:00 Summary:     Merged in ngoldbaum/yt (pull request #2177)</p>
<p>Eliminate segfaults in KDTree construction Affected #:  2 files</p>
<p>diff -r cfc61bdb1b70f6ae65acd4bad85e0aee069bbd62 -r ff0ec06d8bd66146811459f03f99c6cf7b7b0883 yt/data_objects/octree_subset.py --- a/yt/data_objects/octree_subset.py +++ b/yt/data_objects/octree_subset.py @@ -433,57 +433,62 @@</p>
<pre>        self.base_region = base_region
        self.base_selector = base_region.selector
</pre>
<p>+class OctreeSubsetBlockSlicePosition(object): +    def __init__(self, ind, block_slice): +        self.ind = ind +        self.block_slice = block_slice +        nz = self.block_slice.octree_subset.nz +        self.ActiveDimensions = np.array([nz,nz,nz], dtype="int64") + +    def __getitem__(self, key): +        bs = self.block_slice +        rv = bs.octree_subset[key][:,:,:,self.ind] +        if bs.octree_subset._block_reorder: +            rv = rv.copy(order=bs.octree_subset._block_reorder) +        return rv + +    @property +    def id(self): +        return self.ind + +    @property +    def Level(self): +        return self.block_slice._ires[0,0,0,self.ind] + +    @property +    def LeftEdge(self): +        LE = (self.block_slice._fcoords[0,0,0,self.ind,:] +            – self.block_slice._fwidth[0,0,0,self.ind,:]*0.5) +        return LE + +    @property +    def RightEdge(self): +        RE = (self.block_slice._fcoords[-1,-1,-1,self.ind,:] +            + self.block_slice._fwidth[-1,-1,-1,self.ind,:]*0.5) +        return RE + +    @property +    def dds(self): +        return self.block_slice._fwidth[0,0,0,self.ind,:] + +    def clear_data(self): +        pass + +    def get_vertex_centered_data(self, *args, **kwargs): +        raise NotImplementedError + +</p>
<pre>class OctreeSubsetBlockSlice(object):
    def __init__(self, octree_subset):</pre>
<ul><li><p>self.ind = None self.octree_subset = octree_subset # Cache some attributes</p></li>
<li><p>nz = octree_subset.nz</p></li>
<li><p>self.ActiveDimensions = np.array([nz,nz,nz], dtype="int64") for attr in ["ires", “icoords”, “fcoords”, "fwidth"]:</p>
<pre>   v = getattr(octree_subset, attr)
   setattr(self, "_%s" % attr, octree_subset._reshape_vals(v))
</pre></li></ul>
<pre>def __iter__(self):
    for i in range(self._ires.shape[-1]):</pre>
<ul><li><p>self.ind = i</p></li>
<li><p>yield i, self</p></li></ul>
<p>–</p>
<ul><li><p>def clear_data(self):</p></li>
<li><p>pass</p></li></ul>
<p>–</p>
<ul><li><p>def __getitem__(self, key):</p></li>
<li><p>rv = self.octree_subset[key][:,:,:,self.ind]</p></li>
<li><p>if self.octree_subset._block_reorder:</p></li>
<li><p>rv = rv.copy(order=self.octree_subset._block_reorder)</p></li>
<li><p>return rv</p></li></ul>
<p>–</p>
<ul><li><p>def get_vertex_centered_data(self, *args, **kwargs):</p></li>
<li><p>raise NotImplementedError</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def id(self):</p></li>
<li><p>return np.random.randint(1)</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def Level(self):</p></li>
<li><p>return self._ires[0,0,0,self.ind]</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def LeftEdge(self):</p></li>
<li><p>LE = (self._fcoords[0,0,0,self.ind,:]</p></li>
<li><ul><li><p>self._fwidth[0,0,0,self.ind,:]*0.5)</p></li></ul></li>
<li><p>return LE</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def RightEdge(self):</p></li>
<li><p>RE = (self._fcoords[-1,-1,-1,self.ind,:]</p></li>
<li><p>+ self._fwidth[-1,-1,-1,self.ind,:]*0.5)</p></li>
<li><p>return RE</p></li></ul>
<p>–</p>
<ul><li><p>@property</p></li>
<li><p>def dds(self):</p></li>
<li><p>return self._fwidth[0,0,0,self.ind,:]</p></li></ul>
<p>+            yield i, OctreeSubsetBlockSlicePosition(i, self)</p>
<pre>class YTPositionArray(YTArray):
    @property</pre>
<p>diff -r cfc61bdb1b70f6ae65acd4bad85e0aee069bbd62 -r ff0ec06d8bd66146811459f03f99c6cf7b7b0883 yt/utilities/lib/amr_kdtools.pyx --- a/yt/utilities/lib/amr_kdtools.pyx +++ b/yt/utilities/lib/amr_kdtools.pyx @@ -438,7 +438,6 @@</p>
<pre># If best_dim is -1, then we have found a place where there are no choices.
# Exit out and set the node to None.
if best_dim == -1:</pre>
<ul><li><p>print ‘Failed to split grid.’ return -1</p></li></ul>
<p>@@ -509,6 +508,11 @@</p>
<pre>best_dim = dim
my_max = n_unique
my_split = (n_unique-1)/2</pre>
<p>+    if best_dim == -1: +        for i in range(3): +            free(uniquedims[i]) +        free(uniquedims) +        return -1, 0, 0, 0</p>
<pre># I recognize how lame this is.
cdef np.ndarray[np.float64_t, ndim=1] tarr = np.empty(my_max, dtype='float64')
for i in range(my_max):</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-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27A97V0t8O3jtHH5WVSfi-2FcKyQ-2BKO1bOOVc6IvQonhZ99NHtCdrRO8Ky3AnEBrnwQewpk-2B8yiTfDHP7qmQSWr9FpEOMS-2FMU2P82U6vaDhFqPyVXyQt1sLBvQI5dhthp9Nar-2BryqeBtn7K8MvieGn-2FbqrbCAJxljTYdwiQxAT5scILo-2B325PJNP-2BgUdhIXcTis24-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>