<html><body>
<p>1 new commit in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/b6dad5b69998/">https://bitbucket.org/yt_analysis/yt/commits/b6dad5b69998/</a> Changeset:   b6dad5b69998 Branch:      yt User:        ngoldbaum Date:        2016-03-29 15:21:08+00:00 Summary:     Merged in mzingale/yt-mz (pull request #2012)</p>
<p>add a new function, fake_vr_orientation_test_ds() that creates a Affected #:  3 files</p>
<p>diff -r 86db031f1f56a6f396d4440188707f1fdb8e6bfa -r b6dad5b69998cff732a5c3ea7847a4b01092ffc8 tests/tests_2.7.yaml --- a/tests/tests_2.7.yaml +++ b/tests/tests_2.7.yaml @@ -42,7 +42,7 @@</p>
<pre>local_tipsy_270:
  - yt/frontends/tipsy/tests/test_outputs.py
</pre>
<ul><li><p>local_varia_272:</p></li></ul>
<p>+  local_varia_273:</p>
<pre>- yt/analysis_modules/radmc3d_export
- yt/frontends/moab/tests/test_c5.py
- yt/analysis_modules/photon_simulator/tests/test_spectra.py</pre>
<p>diff -r 86db031f1f56a6f396d4440188707f1fdb8e6bfa -r b6dad5b69998cff732a5c3ea7847a4b01092ffc8 yt/testing.py --- a/yt/testing.py +++ b/yt/testing.py @@ -317,7 +317,75 @@</p>
<pre>    return ds

</pre>
<p>+def fake_vr_orientation_test_ds(N = 96): +    """ +    create a toy dataset that puts a sphere at (0,0,0), a single cube +    on +x, two cubes on +y, and three cubes on +z in a domain from +    [-1,1]**3.  The lower planes (x = -1, y = -1, z = -1) are also +    given non-zero values. + +    This dataset allows you to easily explore orientations and +    handiness in VR and other renderings + +    """ +    from yt.frontends.stream.api import load_uniform_grid + +    xmin = ymin = zmin = -1.0 +    xmax = ymax = zmax = 1.0 + +    dcoord = (xmax – xmin)/N + +    arr = np.zeros((N,N,N), dtype=np.float64) +    arr[:,:,:] = 1.e-4 + +    bbox = np.array([ [xmin, xmax], [ymin, ymax], [zmin, zmax] ]) + +    # coordinates — in the notation data[i, j, k] +    x = (np.arange(N) + 0.5)*dcoord + xmin +    y = (np.arange(N) + 0.5)*dcoord + ymin +    z = (np.arange(N) + 0.5)*dcoord + zmin + +    x3d, y3d, z3d = np.meshgrid(x, y, z, indexing="ij") + +    # sphere at the origin +    c = np.array( [0.5*(xmin + xmax), 0.5*(ymin + ymax), 0.5*(zmin + zmax) ] ) +    r = np.sqrt((x3d – c[0])**2 + (y3d – c[1])**2 + (z3d – c[2])**2) +    arr[r < 0.05] = 1.0 + +    arr[abs(x3d – xmin) < 2*dcoord] = 0.3 +    arr[abs(y3d – ymin) < 2*dcoord] = 0.3 +    arr[abs(z3d – zmin) < 2*dcoord] = 0.3 + +    # single cube on +x +    xc = 0.75 +    dx = 0.05 +    idx = np.logical_and(np.logical_and(x3d > xc-dx, x3d < xc+dx), +                         np.logical_and(np.logical_and(y3d > -dx, y3d < dx), +                                        np.logical_and(z3d > -dx, z3d < dx)) ) +    arr[idx] = 1.0 + +    # two cubes on +y +    dy = 0.05 +    for yc in [0.65, 0.85]: +        idx = np.logical_and(np.logical_and(y3d > yc-dy, y3d < yc+dy), +                             np.logical_and(np.logical_and(x3d > -dy, x3d < dy), +                                            np.logical_and(z3d > -dy, z3d < dy)) ) +        arr[idx] = 0.8 + +    # three cubes on +z +    dz = 0.05 +    for zc in [0.5, 0.7, 0.9]: +        idx = np.logical_and(np.logical_and(z3d > zc-dz, z3d < zc+dz), +                             np.logical_and(np.logical_and(x3d > -dz, x3d < dz), +                                            np.logical_and(y3d > -dz, y3d < dz)) ) +        arr[idx] = 0.6 + +    data = dict(density = (arr, "g/cm**3")) +    ds = load_uniform_grid(data, arr.shape, bbox=bbox) +    return ds +</p>
<pre>def expand_keywords(keywords, full=False):</pre>
<p>+</p>
<pre>"""
expand_keywords is a means for testing all possible keyword
arguments in the nosetests.  Simply pass it a dictionary of all the</pre>
<p>diff -r 86db031f1f56a6f396d4440188707f1fdb8e6bfa -r b6dad5b69998cff732a5c3ea7847a4b01092ffc8 yt/visualization/volume_rendering/tests/test_vr_orientation.py --- a/yt/visualization/volume_rendering/tests/test_vr_orientation.py +++ b/yt/visualization/volume_rendering/tests/test_vr_orientation.py @@ -12,8 +12,7 @@</p>
<pre>import numpy as np</pre>
<p>– -from yt import load_uniform_grid +from yt import testing</p>
<pre>from yt.utilities.answer_testing.framework import \
    requires_answer_testing, \
    VRImageComparisonTest, \</pre>
<p>@@ -25,75 +24,9 @@</p>
<pre>    off_axis_projection

</pre>
<p>-def setup_ds(): –</p>
<ul><li><p>N = 96</p></li></ul>
<p>–</p>
<ul><li><p>xmin = ymin = zmin = -1.0</p></li>
<li><p>xmax = ymax = zmax = 1.0</p></li></ul>
<p>–</p>
<ul><li><p>dcoord = (xmax – xmin)/N</p></li></ul>
<p>–</p>
<ul><li><p>arr = np.zeros((N, N, N), dtype=np.float64)</p></li>
<li><p>arr[:, :, :] = 1.e-4</p></li></ul>
<p>–</p>
<ul><li><p>bbox = np.array([[xmin, xmax], [ymin, ymax], [zmin, zmax]])</p></li></ul>
<p>–</p>
<ul><li><p># coordinates — in the notation data[i, j, k]</p></li>
<li><p>x = (np.arange(N) + 0.5)*(xmax – xmin)/N + xmin</p></li>
<li><p>y = (np.arange(N) + 0.5)*(ymax – ymin)/N + ymin</p></li>
<li><p>z = (np.arange(N) + 0.5)*(zmax – zmin)/N + zmin</p></li></ul>
<p>–</p>
<ul><li><p>x3d, y3d, z3d = np.meshgrid(x, y, z, indexing="ij")</p></li></ul>
<p>–</p>
<ul><li><p># sphere at the origin</p></li>
<li><p>c = np.array([0.5*(xmin + xmax), 0.5*(ymin + ymax), 0.5*(zmin + zmax)])</p></li></ul>
<p>–</p>
<ul><li><p>r = np.sqrt((x3d – c[0])**2 + (y3d – c[1])**2 + (z3d – c[2])**2)</p></li>
<li><p>arr[r < 0.05] = 1.0</p></li></ul>
<p>–</p>
<ul><li><p>arr[abs(x3d – xmin) < 2*dcoord] = 0.3</p></li>
<li><p>arr[abs(y3d – ymin) < 2*dcoord] = 0.3</p></li>
<li><p>arr[abs(z3d – zmin) < 2*dcoord] = 0.3</p></li></ul>
<p>–</p>
<ul><li><p># single cube on +x</p></li>
<li><p>xc = 0.75</p></li>
<li><p>dx = 0.05</p></li>
<li><p>idx = np.logical_and(np.logical_and(x3d > xc-dx, x3d < xc+dx),</p></li>
<li><p>np.logical_and(np.logical_and(y3d > -dx, y3d < dx),</p></li>
<li><p>np.logical_and(z3d > -dx, z3d < dx)))</p></li></ul>
<p>–</p>
<ul><li><p>arr[idx] = 1.0</p></li></ul>
<p>–</p>
<ul><li><p># two cubes on +y</p></li>
<li><p>dy = 0.05</p></li>
<li><p>for yc in [0.65, 0.85]:</p></li></ul>
<p>–</p>
<ul><li><p>idx = np.logical_and(np.logical_and(y3d > yc-dy, y3d < yc+dy),</p></li>
<li><p>np.logical_and(np.logical_and(x3d > -dy, x3d < dy),</p></li>
<li><p>np.logical_and(z3d > -dy, z3d < dy)))</p></li></ul>
<p>–</p>
<ul><li><p>arr[idx] = 0.8</p></li></ul>
<p>–</p>
<ul><li><p># three cubes on +z</p></li>
<li><p>dz = 0.05</p></li>
<li><p>for zc in [0.5, 0.7, 0.9]:</p></li></ul>
<p>–</p>
<ul><li><p>idx = np.logical_and(np.logical_and(z3d > zc-dz, z3d < zc+dz),</p></li>
<li><p>np.logical_and(np.logical_and(x3d > -dz, x3d < dz),</p></li>
<li><p>np.logical_and(y3d > -dz, y3d < dz)))</p></li></ul>
<p>–</p>
<ul><li><p>arr[idx] = 0.6</p></li></ul>
<p>–</p>
<ul><li><p>data = dict(density=(arr, "g/cm**3"))</p></li>
<li><p>ds = load_uniform_grid(data, arr.shape, bbox=bbox)</p></li></ul>
<p>–</p>
<ul><li><p>return ds</p></li></ul>
<p>– –</p>
<pre>@requires_answer_testing()
def test_orientation():</pre>
<ul><li><p>ds = setup_ds()</p></li></ul>
<p>+    ds = testing.fake_vr_orientation_test_ds()</p>
<pre>    sc = Scene()
</pre>
<p>@@ -113,7 +46,7 @@</p>
<pre>    for lens_type in ['plane-parallel', 'perspective']:
        frame = 0
</pre>
<ul><li><p>cam = sc.add_camera(ds, lens_type='plane-parallel')</p></li></ul>
<p>+        cam = sc.add_camera(ds, lens_type=lens_type)</p>
<pre>cam.resolution = (1000, 1000)
cam.position = ds.arr(np.array([-4., 0., 0.]), 'code_length')
cam.switch_orientation(normal_vector=[1., 0., 0.],</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-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27BWN-2FOUvHf0Ly7LoCvO3BNt4Y4eNG4DpF6729xXETzH7QRzswMOZObwmIqi3KAiJSfxrRcMxFszOlf35x-2BjLWv8GFNIMhN9H2I-2BnUeTBwcrFy-2B6vrG17VPx8qS2aHph1Qx0ah0v2llbiAxetcM2d0o2Lwc1mUbHbuohV39smx96QF4EgDvt-2BZEJUd17-2FYY9kZs-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>