Commits

Matthew Turk  committed b7a4dbc Merge

Merge

  • Participants
  • Parent commits b73090c, 0776521

Comments (0)

Files changed (8)

 hdf5.cfg
 png.cfg
 yt_updater.log
+yt/frontends/artio/_artio_caller.c
 yt/frontends/ramses/_ramses_reader.cpp
+yt/frontends/sph/smoothing_kernel.c
+yt/geometry/oct_container.c
+yt/geometry/selection_routines.c
 yt/utilities/amr_utils.c
 yt/utilities/kdtree/forthonf2c.h
 yt/utilities/libconfig_wrapper.c
 yt/utilities/spatial/ckdtree.c
+yt/utilities/lib/alt_ray_tracers.c
 yt/utilities/lib/CICDeposit.c
 yt/utilities/lib/ContourFinding.c
 yt/utilities/lib/DepthFirstOctree.c

File yt/data_objects/universal_fields.py

 """
+
 The basic field info container resides here.  These classes, code specific and
 universal, are the means by which we access fields across YT, both derived and
 native.
     for i, ax in enumerate('xyz'):
         np.subtract(data["%s%s" % (field_prefix, ax)], center[i], r)
         if data.pf.periodicity[i] == True:
-            np.subtract(DW[i], r, rdw)
             np.abs(r, r)
+            np.subtract(r, DW[i], rdw)
+            np.abs(rdw, rdw)
             np.minimum(r, rdw, r)
         np.power(r, 2.0, r)
         np.add(radius, r, radius)

File yt/frontends/enzo/data_structures.py

         if self.parameter_file.parameters["VersionNumber"] > 2.0:
             active_particles = True
             nap = {}
-            for type in self.parameters["AppendActiveParticleType"]:
+            for type in self.parameters.get("AppendActiveParticleType", []):
                 nap[type] = []
         else:
             active_particles = False
             if active_particles:
                 ptypes = _next_token_line("PresentParticleTypes", f)
                 counts = [int(c) for c in _next_token_line("ParticleTypeCounts", f)]
-                for ptype in self.parameters["AppendActiveParticleType"]:
+                for ptype in self.parameters.get("AppendActiveParticleType", []):
                     if ptype in ptypes:
                         nap[ptype].append(counts[ptypes.index(ptype)])
                     else:

File yt/frontends/ramses/data_structures.py

 
     def select_fwidth(self, dobj):
         # Recall domain_dimensions is the number of cells, not octs
-        base_dx = 1.0/self.domain.pf.domain_dimensions
+        base_dx = (self.domain.pf.domain_width /
+                   self.domain.pf.domain_dimensions)
         widths = np.empty((self.cell_count, 3), dtype="float64")
         dds = (2**self.ires(dobj))
         for i in range(3):

File yt/frontends/sph/data_structures.py

 
     def select_fwidth(self, dobj):
         # Recall domain_dimensions is the number of cells, not octs
-        base_dx = 1.0/self.domain.pf.domain_dimensions
+        base_dx = (self.domain.pf.domain_width /
+                   self.domain.pf.domain_dimensions)
         widths = np.empty((self.cell_count, 3), dtype="float64")
         dds = (2**self.ires(dobj))
         for i in range(3):

File yt/geometry/cartesian_fields.py

 add_cart_field = CartesianFieldInfo.add_field
 
 def _dx(field, data):
-    return data.pf.domain_width[0] * data.fwidth[...,0]
+    return data.fwidth[...,0]
 add_cart_field('dx', function=_dx, display_field=False)
 
 def _dy(field, data):
-    return data.pf.domain_width[1] * data.fwidth[...,1]
+    return data.fwidth[...,1]
 add_cart_field('dy', function=_dy, display_field=False)
 
 def _dz(field, data):
-    return data.pf.domain_width[2] * data.fwidth[...,2]
+    return data.fwidth[...,2]
 add_cart_field('dz', function=_dz, display_field=False)
 
 def _coordX(field, data):
-    return data.pf.domain_left_edge[0] + data.fcoords[...,0]
+    return data.fcoords[...,0]
 add_cart_field('x', function=_coordX, display_field=False)
 
 def _coordY(field, data):
-    return data.pf.domain_left_edge[1] + data.fcoords[...,1]
+    return data.fcoords[...,1]
 add_cart_field('y', function=_coordY, display_field=False)
 
 def _coordZ(field, data):
-    return data.pf.domain_left_edge[2] + data.fcoords[...,2]
+    return data.fcoords[...,2]
 add_cart_field('z', function=_coordZ, display_field=False)
 

File yt/geometry/selection_routines.pyx

                     temp -= self.domain_width[i]
                 elif temp < -self.domain_width[i]/2.0:
                     temp += self.domain_width[i]
-            temp = temp - fclip(temp, -dds[i]/2.0, dds[i]/2.0)
+            #temp = temp - fclip(temp, -dds[i]/2.0, dds[i]/2.0)
             dist2 += temp*temp
         if dist2 <= self.radius2: return 1
         return 0

File yt/utilities/tests/test_selectors.py

         data = pf.h.sphere(center, 0.25)
         data.get_data()
         # WARNING: this value has not be externally verified
-        yield assert_equal, data.size, 19568
+        dd = pf.h.all_data()
+        dd.set_field_parameter("center", center)
+        n_outside = (dd["RadiusCode"] >= 0.25).sum()
+        assert_equal( data.size + n_outside, dd.size)
 
         positions = np.array([data[ax] for ax in 'xyz'])
         centers = np.tile( data.center, data.shape[0] ).reshape(data.shape[0],3).transpose()
                          pf.domain_right_edge-pf.domain_left_edge,
                          pf.periodicity)
         # WARNING: this value has not been externally verified
-        yield assert_almost_equal, dist.max(), 0.261806188752
+        yield assert_array_less, dist, 0.25