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

Bitbucket commits-noreply at bitbucket.org
Wed Feb 13 13:31:19 PST 2013


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/19ba4fb63662/
changeset:   19ba4fb63662
branch:      yt
user:        sskory
date:        2013-02-13 22:22:18
summary:     Adding periodicity to EnzoStaticOutputInMemory
affected #:  1 file

diff -r f65d7380144e0e9739582779b1acc72b92622edf -r 19ba4fb63662432a19d54cf5a4b5c5450d064253 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -995,6 +995,7 @@
         for p, v in self._conversion_override.items():
             self.conversion_factors[p] = v
         self.refine_by = self.parameters["RefineBy"]
+        self.periodicity = ensure_tuple(self.parameters["LeftFaceBoundaryCondition"] == 3)
         self.dimensionality = self.parameters["TopGridRank"]
         self.domain_dimensions = self.parameters["TopGridDimensions"]
         self.current_time = self.parameters["InitialTime"]


https://bitbucket.org/yt_analysis/yt/commits/bd760ea40463/
changeset:   bd760ea40463
branch:      yt
user:        sskory
date:        2013-02-13 22:22:37
summary:     Merge.
affected #:  3 files

diff -r 19ba4fb63662432a19d54cf5a4b5c5450d064253 -r bd760ea404632bd228653d6a9f78c68189fc6536 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -1387,9 +1387,11 @@
         else:
             self.fields = ensure_list(fields)
         from yt.visualization.plot_window import \
-            GetOffAxisBoundsAndCenter, PWViewerMPL
+            GetObliqueWindowParameters, PWViewerMPL
         from yt.visualization.fixed_resolution import ObliqueFixedResolutionBuffer
-        (bounds, center_rot) = GetOffAxisBoundsAndCenter(normal, center, width, self.pf)
+        (bounds, center_rot, units) = GetObliqueWindowParameters(normal, center, width, self.pf)
+        if axes_unit is None and units != ('1', '1'):
+            axes_units = units
         pw = PWViewerMPL(self, bounds, origin='center-window', periodic=False, oblique=True,
                          frb_generator=ObliqueFixedResolutionBuffer, plot_type='OffAxisSlice')
         pw.set_axes_unit(axes_unit)

diff -r 19ba4fb63662432a19d54cf5a4b5c5450d064253 -r bd760ea404632bd228653d6a9f78c68189fc6536 yt/data_objects/tests/test_cutting_plane.py
--- /dev/null
+++ b/yt/data_objects/tests/test_cutting_plane.py
@@ -0,0 +1,45 @@
+from yt.testing import *
+import os
+
+def setup():
+    from yt.config import ytcfg
+    ytcfg["yt","__withintesting"] = "True"
+
+def teardown_func(fns):
+    for fn in fns:
+        os.remove(fn)
+
+def test_cutting_plane():
+    for nprocs in [8, 1]:
+        # We want to test both 1 proc and 8 procs, to make sure that
+        # parallelism isn't broken
+        pf = fake_random_pf(64, nprocs = nprocs)
+        dims = pf.domain_dimensions
+        center = [0.5,0.5,0.5]
+        normal = [1,1,1]
+        fns = []
+        cut = pf.h.cutting(normal, center, ["Ones", "Density"])
+        yield assert_equal, cut["Ones"].sum(), cut["Ones"].size
+        yield assert_equal, cut["Ones"].min(), 1.0
+        yield assert_equal, cut["Ones"].max(), 1.0
+        pw = cut.to_pw()
+        fns += pw.save()
+        frb = cut.to_frb((1.0,'unitary'), 64)
+        for cut_field in ['Ones', 'Density']:
+            yield assert_equal, frb[cut_field].info['data_source'], \
+                cut.__str__()
+            yield assert_equal, frb[cut_field].info['axis'], \
+                4
+            yield assert_equal, frb[cut_field].info['field'], \
+                cut_field
+            yield assert_equal, frb[cut_field].info['units'], \
+                pf.field_info[cut_field].get_units()
+            yield assert_equal, frb[cut_field].info['xlim'], \
+                frb.bounds[:2]
+            yield assert_equal, frb[cut_field].info['ylim'], \
+                frb.bounds[2:]
+            yield assert_equal, frb[cut_field].info['length_to_cm'], \
+                pf['cm']
+            yield assert_equal, frb[cut_field].info['center'], \
+                cut.center
+        teardown_func(fns)

diff -r 19ba4fb63662432a19d54cf5a4b5c5450d064253 -r bd760ea404632bd228653d6a9f78c68189fc6536 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -683,7 +683,7 @@
         """
         if "__IPYTHON__" in dir(__builtin__):
             from IPython.core.displaypub import publish_display_data
-            image = self.snapshot()
+            image = self.snapshot()[:,:,:3]
             if clip_ratio is not None: clip_ratio *= image.std()
             data = write_bitmap(image, None, clip_ratio)
             publish_display_data(

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