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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri May 13 10:57:28 PDT 2016


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/e2f2325d3e09/
Changeset:   e2f2325d3e09
Branch:      yt
User:        MatthewTurk
Date:        2016-05-11 18:54:43+00:00
Summary:     Overriding select in semistructured mesh
Affected #:  1 file

diff -r 78591f39a47d294c9ff8d5be7121fbe51e5a2acd -r e2f2325d3e09555e1da3de5b8dc74da23679aea0 yt/data_objects/unstructured_mesh.py
--- a/yt/data_objects/unstructured_mesh.py
+++ b/yt/data_objects/unstructured_mesh.py
@@ -225,3 +225,12 @@
             else:
                 self._last_count = mask.sum()
         return mask
+
+    def select(self, selector, source, dest, offset):
+        mask = self._get_selector_mask(selector)
+        count = self.count(selector)
+        if count == 0: return 0
+        # Note: this likely will not work with vector fields.
+        dest[offset:offset+count] = source.flat[mask]
+        return count
+


https://bitbucket.org/yt_analysis/yt/commits/78f2d05ddeec/
Changeset:   78f2d05ddeec
Branch:      yt
User:        MatthewTurk
Date:        2016-05-11 19:05:45+00:00
Summary:     Adding a test that gets an FRB
Affected #:  1 file

diff -r e2f2325d3e09555e1da3de5b8dc74da23679aea0 -r 78f2d05ddeecb679c6c52313bbdc8cb27ba94be1 yt/frontends/stream/tests/test_stream_hexahedral.py
--- a/yt/frontends/stream/tests/test_stream_hexahedral.py
+++ b/yt/frontends/stream/tests/test_stream_hexahedral.py
@@ -51,3 +51,7 @@
     yield assert_almost_equal, dd["dx"].to_ndarray(), 1.0/Nx
     yield assert_almost_equal, dd["dy"].to_ndarray(), 1.0/Ny
     yield assert_almost_equal, dd["dz"].to_ndarray(), 1.0/Nz
+
+    s = yt.SlicePlot(ds, "x", "random_field")
+    s._setup_plots()
+    s.frb["random_field"]


https://bitbucket.org/yt_analysis/yt/commits/ed60a128a9ec/
Changeset:   ed60a128a9ec
Branch:      yt
User:        MatthewTurk
Date:        2016-05-11 20:42:58+00:00
Summary:     Fixing missing import
Affected #:  1 file

diff -r 78f2d05ddeecb679c6c52313bbdc8cb27ba94be1 -r ed60a128a9ec9358a0e2d4326d5ff1fd7d4996bc yt/frontends/stream/tests/test_stream_hexahedral.py
--- a/yt/frontends/stream/tests/test_stream_hexahedral.py
+++ b/yt/frontends/stream/tests/test_stream_hexahedral.py
@@ -6,6 +6,7 @@
 from yt.testing import \
     assert_almost_equal, \
     assert_equal
+from yt import SlicePlot
 # Field information
 
 def test_stream_hexahedral() :
@@ -52,6 +53,6 @@
     yield assert_almost_equal, dd["dy"].to_ndarray(), 1.0/Ny
     yield assert_almost_equal, dd["dz"].to_ndarray(), 1.0/Nz
 
-    s = yt.SlicePlot(ds, "x", "random_field")
+    s = SlicePlot(ds, "x", "random_field")
     s._setup_plots()
     s.frb["random_field"]


https://bitbucket.org/yt_analysis/yt/commits/ea2fb8f2dcda/
Changeset:   ea2fb8f2dcda
Branch:      yt
User:        MatthewTurk
Date:        2016-05-13 15:43:58+00:00
Summary:     Switching both cases of random field to be mesh, not particle
Affected #:  1 file

diff -r ed60a128a9ec9358a0e2d4326d5ff1fd7d4996bc -r ea2fb8f2dcda3a65a6797c0ef7b3aee9c4d0076c yt/frontends/stream/tests/test_stream_hexahedral.py
--- a/yt/frontends/stream/tests/test_stream_hexahedral.py
+++ b/yt/frontends/stream/tests/test_stream_hexahedral.py
@@ -31,7 +31,7 @@
     cell_z[0] = 0.0
 
     coords, conn = hexahedral_connectivity(cell_x, cell_y, cell_z)
-    data = {'random_field': np.random.random(Nx*Ny*Nz)}
+    data = {'random_field': np.random.random((Nx, Ny, Nz))}
     bbox = np.array([ [0.0, 1.0], [0.0, 1.0], [0.0, 1.0] ])
     ds = load_hexahedral_mesh(data, conn, coords, bbox=bbox)
     dd = ds.all_data()
@@ -43,7 +43,7 @@
     cell_y = np.linspace(0.0, 1.0, Ny+1)
     cell_z = np.linspace(0.0, 1.0, Nz+1)
     coords, conn = hexahedral_connectivity(cell_x, cell_y, cell_z)
-    data = {'random_field': np.random.random(Nx*Ny*Nz)}
+    data = {'random_field': np.random.random((Nx, Ny, Nz))}
     bbox = np.array([ [0.0, 1.0], [0.0, 1.0], [0.0, 1.0] ])
     ds = load_hexahedral_mesh(data, conn, coords, bbox=bbox)
     dd = ds.all_data()


https://bitbucket.org/yt_analysis/yt/commits/8d076b60c7da/
Changeset:   8d076b60c7da
Branch:      yt
User:        ngoldbaum
Date:        2016-05-13 17:57:07+00:00
Summary:     Merged in MatthewTurk/yt (pull request #2170)

Override select for semistructured mesh.  Closes #1217
Affected #:  2 files

diff -r bdf16ce177f5fd1d88b07c227b0e5759fba0ecea -r 8d076b60c7dacde1de17041f79ff1a6bd0c3ea8e yt/data_objects/unstructured_mesh.py
--- a/yt/data_objects/unstructured_mesh.py
+++ b/yt/data_objects/unstructured_mesh.py
@@ -225,3 +225,12 @@
             else:
                 self._last_count = mask.sum()
         return mask
+
+    def select(self, selector, source, dest, offset):
+        mask = self._get_selector_mask(selector)
+        count = self.count(selector)
+        if count == 0: return 0
+        # Note: this likely will not work with vector fields.
+        dest[offset:offset+count] = source.flat[mask]
+        return count
+

diff -r bdf16ce177f5fd1d88b07c227b0e5759fba0ecea -r 8d076b60c7dacde1de17041f79ff1a6bd0c3ea8e yt/frontends/stream/tests/test_stream_hexahedral.py
--- a/yt/frontends/stream/tests/test_stream_hexahedral.py
+++ b/yt/frontends/stream/tests/test_stream_hexahedral.py
@@ -6,6 +6,7 @@
 from yt.testing import \
     assert_almost_equal, \
     assert_equal
+from yt import SlicePlot
 # Field information
 
 def test_stream_hexahedral() :
@@ -30,7 +31,7 @@
     cell_z[0] = 0.0
 
     coords, conn = hexahedral_connectivity(cell_x, cell_y, cell_z)
-    data = {'random_field': np.random.random(Nx*Ny*Nz)}
+    data = {'random_field': np.random.random((Nx, Ny, Nz))}
     bbox = np.array([ [0.0, 1.0], [0.0, 1.0], [0.0, 1.0] ])
     ds = load_hexahedral_mesh(data, conn, coords, bbox=bbox)
     dd = ds.all_data()
@@ -42,7 +43,7 @@
     cell_y = np.linspace(0.0, 1.0, Ny+1)
     cell_z = np.linspace(0.0, 1.0, Nz+1)
     coords, conn = hexahedral_connectivity(cell_x, cell_y, cell_z)
-    data = {'random_field': np.random.random(Nx*Ny*Nz)}
+    data = {'random_field': np.random.random((Nx, Ny, Nz))}
     bbox = np.array([ [0.0, 1.0], [0.0, 1.0], [0.0, 1.0] ])
     ds = load_hexahedral_mesh(data, conn, coords, bbox=bbox)
     dd = ds.all_data()
@@ -51,3 +52,7 @@
     yield assert_almost_equal, dd["dx"].to_ndarray(), 1.0/Nx
     yield assert_almost_equal, dd["dy"].to_ndarray(), 1.0/Ny
     yield assert_almost_equal, dd["dz"].to_ndarray(), 1.0/Nz
+
+    s = SlicePlot(ds, "x", "random_field")
+    s._setup_plots()
+    s.frb["random_field"]

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-svn-spacepope.org/attachments/20160513/359edc8d/attachment-0001.htm>


More information about the yt-svn mailing list