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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Sep 26 15:11:21 PDT 2013


2 new commits in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/9ba30354184d/
Changeset:   9ba30354184d
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-09-26 23:04:22
Summary:     Removing unused ARTIOChunk object.
Affected #:  1 file

diff -r 18be596249263152c80589b31e52db9db0c39d28 -r 9ba30354184d77e11576d20d814bdc16aa6b239f yt/frontends/artio/data_structures.py
--- a/yt/frontends/artio/data_structures.py
+++ b/yt/frontends/artio/data_structures.py
@@ -154,86 +154,6 @@
         if vals is None: return
         return np.asfortranarray(vals)
 
-class ARTIOChunk(object):
-
-    def __init__(self, pf, sfc_start, sfc_end):
-        self.pf = pf
-        self.sfc_start = sfc_start
-        self.sfc_end = sfc_end
-
-    _data_size = None
-
-    @property
-    def data_size(self):
-        if self._data_size is None:
-            mylog.error("ARTIOChunk.data_size called before fill")
-            raise RuntimeError
-        return self._data_size
-
-    _fcoords = None
-    def select_fcoords(self, dobj):
-        if self._fcoords is None:
-            mylog.error("ARTIOChunk.fcoords called before fill")
-            raise RuntimeError
-        return self._fcoords
-
-    _ires = None
-    def select_ires(self, dobj):
-        if self._ires is None:
-            raise RuntimeError("ARTIOChunk.select_ires called before fill")
-        return self._ires
-
-    def select_fwidth(self, dobj):
-        if self._ires is None:
-            raise RuntimeErorr("ARTIOChunk.fwidth called before fill")
-        return np.array([2.**-self._ires, 2.**-self._ires,
-                         2.**-self._ires]).transpose()
-
-    def select_icoords(self, dobj):
-        if self._fcoords is None or self._ires is None:
-            raise RuntimeError("ARTIOChunk.icoords called before fill")
-        return (int)(self._fcoords/2**-self._ires)
-
-    def fill(self, fields, selector):
-        art_fields = [yt_to_art[f[1]] for f in fields]
-        (self._fcoords, self._ires, artdata) = \
-            self.pf._handle.read_grid_chunk(selector,
-                                            self.sfc_start,
-                                            self.sfc_end, art_fields)
-        data = {}
-        for i, f in enumerate(fields):
-            data[f] = artdata[i]
-        self._data_size = len(self._fcoords)
-        return data
-
-    def fill_particles(self, field_data, fields, selector):
-        art_fields = {}
-        for s, f in fields:
-            for i in range(self.pf.num_species):
-                if s == "all" or self.pf.particle_species[i] == yt_to_art[s]:
-                    if yt_to_art[f] in self.pf.particle_variables[i]:
-                        art_fields[(i, yt_to_art[f])] = 1
-
-        species_data = self.pf._handle.read_particle_chunk(
-            selector, self.sfc_start, self.sfc_end, art_fields.keys())
-
-        for s, f in fields:
-            af = yt_to_art[f]
-            np = sum(len(species_data[(i, af)])
-                     for i in range(self.pf.num_species)
-                     if s == "all"
-                     or self.pf.particle_species[i] == yt_to_art[s])
-
-            cp = len(field_data[(s, f)])
-            field_data[(s, f)].resize(cp + np)
-            for i in range(self.pf.num_species):
-                if s == "all" or self.pf.particle_species[i] == yt_to_art[s]:
-                    np = len(species_data[(i, yt_to_art[f])])
-                    field_data[(s, f)][cp:cp+np] = \
-                        species_data[(i, yt_to_art[f])]
-                    cp += np
-
-
 class ARTIOGeometryHandler(GeometryHandler):
 
     def __init__(self, pf, data_style='artio'):
@@ -361,7 +281,6 @@
         if ngz > 0:
             raise NotImplementedError
         sobjs = getattr(dobj._current_chunk, "objs", dobj._chunk_info)
-        # These are ARTIOChunk objects
         for i,og in enumerate(sobjs):
             if ngz > 0:
                 g = og.retrieve_ghost_zones(ngz, [], smoothed=True)


https://bitbucket.org/yt_analysis/yt-3.0/commits/f261b59f1b6c/
Changeset:   f261b59f1b6c
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-09-26 23:44:36
Summary:     We need to avoid a domain check for ARTIO subsets, where the domain of an Oct
might be non-zero but the domain of the object might be -1.
Affected #:  2 files

diff -r 9ba30354184d77e11576d20d814bdc16aa6b239f -r f261b59f1b6ce921f97b037ee59482473c18fa5e yt/frontends/artio/_artio_caller.pyx
--- a/yt/frontends/artio/_artio_caller.pyx
+++ b/yt/frontends/artio/_artio_caller.pyx
@@ -820,8 +820,11 @@
         free(num_octs_per_level)
 
     def fill_sfc_particles(self, fields):
-        rv = read_sfc_particles(self.artio_handle,
-                                self.sfc_start, self.sfc_end,
+        # This handles not getting particles for refined sfc values.
+        cdef np.int64_t sfc_start, sfc_end
+        sfc_start = self.domains[0].con_id
+        sfc_end = self.domains[self.num_domains - 1].con_id
+        rv = read_sfc_particles(self.artio_handle, sfc_start, sfc_end,
                                 0, fields)
         return rv
 

diff -r 9ba30354184d77e11576d20d814bdc16aa6b239f -r f261b59f1b6ce921f97b037ee59482473c18fa5e yt/geometry/selection_routines.pyx
--- a/yt/geometry/selection_routines.pyx
+++ b/yt/geometry/selection_routines.pyx
@@ -1429,7 +1429,9 @@
         # checking this.
         cdef int res
         res = self.base_selector.select_grid(left_edge, right_edge, level, o)
-        if res == 1 and o != NULL and o.domain != self.domain_id:
+        if self.domain_id == -1:
+            return res
+        elif res == 1 and o != NULL and o.domain != self.domain_id:
             return -1
         return res

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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