<html><body>
<p>4 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/edf7d8fb0a2d/">https://bitbucket.org/yt_analysis/yt/commits/edf7d8fb0a2d/</a> Changeset:   edf7d8fb0a2d Branch:      yt User:        ngoldbaum Date:        2016-03-24 22:58:51+00:00 Summary:     Re-enable max_level for projections, ProjectionPlot, and OffAxisProjectionPlot. Closes #1049 Affected #:  3 files</p>
<p>diff -r a776e67368c5629296b1e365dfca0b68b41ef1d5 -r edf7d8fb0a2d844f9f9f7bfdae44463d92e8c21d yt/data_objects/construction_data_containers.py --- a/yt/data_objects/construction_data_containers.py +++ b/yt/data_objects/construction_data_containers.py @@ -221,7 +221,7 @@</p>
<pre>     def __init__(self, field, axis, weight_field = None,
center = None, ds = None, data_source = None,
style = None, method = "integrate",</pre>
<ul><li><p>field_parameters = None):</p></li></ul>
<p>+                 field_parameters = None, max_level = None):</p>
<pre>YTSelectionContainer2D.__init__(self, axis, ds, field_parameters)
# Style is deprecated, but if it is set, then it trumps method
# keyword.  TODO: Remove this keyword and this check at some point in</pre>
<p>@@ -243,6 +243,8 @@</p>
<pre>self._set_center(center)
self._projected_units = {}
if data_source is None: data_source = self.ds.all_data()</pre>
<p>+        if max_level is not None: +            data_source.max_level = max_level</p>
<pre>         for k, v in data_source.field_parameters.items():
if k not in self.field_parameters or \
  self._is_default_field_parameter(k):</pre>
<p>diff -r a776e67368c5629296b1e365dfca0b68b41ef1d5 -r edf7d8fb0a2d844f9f9f7bfdae44463d92e8c21d yt/visualization/fixed_resolution.py --- a/yt/visualization/fixed_resolution.py +++ b/yt/visualization/fixed_resolution.py @@ -569,11 +569,13 @@</p>
<pre>         width = self.ds.arr((self.bounds[1] - self.bounds[0],
self.bounds[3] - self.bounds[2],
self.bounds[5] - self.bounds[4]))</pre>
<ul><li><p>buff = off_axis_projection(dd.ds, dd.center, dd.normal_vector,</p></li></ul>
<p>+        buff = off_axis_projection(dd.dd, dd.center, dd.normal_vector,</p>
<pre>width, dd.resolution, item,
weight=dd.weight_field, volume=dd.volume,</pre>
<ul><li><p>no_ghost=dd.no_ghost, interpolated=dd.interpolated,</p></li>
<li><p>north_vector=dd.north_vector, method=dd.method)</p></li></ul>
<p>+                                   no_ghost=dd.no_ghost, +                                   interpolated=dd.interpolated, +                                   north_vector=dd.north_vector, +                                   method=dd.method)</p>
<pre>ia = ImageArray(buff.swapaxes(0,1), info=self._get_info(item))
self[item] = ia
return ia</pre>
<p>diff -r a776e67368c5629296b1e365dfca0b68b41ef1d5 -r edf7d8fb0a2d844f9f9f7bfdae44463d92e8c21d yt/visualization/plot_window.py --- a/yt/visualization/plot_window.py +++ b/yt/visualization/plot_window.py @@ -1407,7 +1407,8 @@</p>
<pre>         else:
proj = ds.proj(fields, axis, weight_field=weight_field,
               center=center, data_source=data_source,</pre>
<ul><li><p>field_parameters = field_parameters, method = method)</p></li></ul>
<p>+                           field_parameters=field_parameters, method=method, +                           max_level=max_level)</p>
<pre>         PWViewerMPL.__init__(self, proj, bounds, fields=fields, origin=origin,
fontsize=fontsize, window_size=window_size,
aspect=aspect)</pre>
<p>@@ -1640,6 +1641,8 @@</p>
<pre>center_rot, ds, normal, oap_width, fields, interpolated,
weight=weight_field,  volume=volume, no_ghost=no_ghost,
le=le, re=re, north_vector=north_vector, method=method)</pre>
<p>+        if max_level is not None: +            OffAxisProj.dd.max_level = max_level</p>
<pre>         # If a non-weighted, integral projection, assure field-label reflects that
         if weight_field is None and OffAxisProj.method == "integrate":
self.projected = True</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/e301c446aed5/">https://bitbucket.org/yt_analysis/yt/commits/e301c446aed5/</a> Changeset:   e301c446aed5 Branch:      yt User:        ngoldbaum Date:        2016-03-24 22:59:30+00:00 Summary:     Clarify that data_source for off_axis_projections can be a data object Affected #:  1 file</p>
<p>diff -r edf7d8fb0a2d844f9f9f7bfdae44463d92e8c21d -r e301c446aed53518bf06bbf019f61e7736ab80bd yt/visualization/volume_rendering/off_axis_projection.py --- a/yt/visualization/volume_rendering/off_axis_projection.py +++ b/yt/visualization/volume_rendering/off_axis_projection.py @@ -38,8 +38,8 @@</p>
<pre>Parameters
----------</pre>
<ul><li><p>data_source : `~yt.data_objects.api.Dataset`</p></li>
<li><p>This is the dataset to volume render.</p></li></ul>
<p>+    data_source : `~yt.data_objects.static_output.Dataset` or `~yt.data_objects.data_containers.YTSelectionDataContainer` +        This is the dataset or data object to volume render.</p>
<pre>center : array_like
    The current 'center' of the view port -- the focal point for the
    camera.</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/6597de44fa2e/">https://bitbucket.org/yt_analysis/yt/commits/6597de44fa2e/</a> Changeset:   6597de44fa2e Branch:      yt User:        ngoldbaum Date:        2016-03-24 23:10:05+00:00 Summary:     Add a test for projection max levels Affected #:  1 file</p>
<p>diff -r e301c446aed53518bf06bbf019f61e7736ab80bd -r 6597de44fa2e83bf2604d111816a699b389486de yt/data_objects/tests/test_projection.py --- a/yt/data_objects/tests/test_projection.py +++ b/yt/data_objects/tests/test_projection.py @@ -1,6 +1,9 @@</p>
<pre>import numpy as np
from yt.testing import \</pre>
<ul><li><p>fake_random_ds, assert_equal, assert_rel_equal</p></li></ul>
<p>+    fake_random_ds, \ +    assert_equal, \ +    assert_rel_equal, \ +    fake_amr_ds</p>
<pre>from yt.units.unit_object import Unit
import os
import tempfile</pre>
<p>@@ -111,3 +114,12 @@</p>
<pre>v2 = (LENGTH_UNIT * dd["density"] * dd["d%s" % an]).sum()
yield assert_rel_equal, v1, v2, 10
     teardown_func(fns)</pre>
<p>+ + +def test_max_level(): +    ds = fake_amr_ds() +    proj = ds.proj('Density', 2, method='mip', max_level=2) +    assert proj['grid_level'].max() == 2 + +    proj = ds.proj('Density', 2, method='mip') +    assert proj['grid_level'].max() == ds.index.max_level</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/9625fb44ed87/">https://bitbucket.org/yt_analysis/yt/commits/9625fb44ed87/</a> Changeset:   9625fb44ed87 Branch:      yt User:        xarthisius Date:        2016-03-30 18:28:17+00:00 Summary:     Merged in ngoldbaum/yt (pull request #2080)</p>
<p>Re-enable max_level for projections, ProjectionPlot, and OffAxisProjectionPlot. Closes #1049 Affected #:  5 files</p>
<p>diff -r a98dd29e4e93fef8002811e9e05e34810574b9cd -r 9625fb44ed8778de289dd42d501dc9bedc1ee1c4 yt/data_objects/construction_data_containers.py --- a/yt/data_objects/construction_data_containers.py +++ b/yt/data_objects/construction_data_containers.py @@ -221,7 +221,7 @@</p>
<pre>     def __init__(self, field, axis, weight_field = None,
center = None, ds = None, data_source = None,
style = None, method = "integrate",</pre>
<ul><li><p>field_parameters = None):</p></li></ul>
<p>+                 field_parameters = None, max_level = None):</p>
<pre>YTSelectionContainer2D.__init__(self, axis, ds, field_parameters)
# Style is deprecated, but if it is set, then it trumps method
# keyword.  TODO: Remove this keyword and this check at some point in</pre>
<p>@@ -243,6 +243,8 @@</p>
<pre>self._set_center(center)
self._projected_units = {}
if data_source is None: data_source = self.ds.all_data()</pre>
<p>+        if max_level is not None: +            data_source.max_level = max_level</p>
<pre>         for k, v in data_source.field_parameters.items():
if k not in self.field_parameters or \
  self._is_default_field_parameter(k):</pre>
<p>diff -r a98dd29e4e93fef8002811e9e05e34810574b9cd -r 9625fb44ed8778de289dd42d501dc9bedc1ee1c4 yt/data_objects/tests/test_projection.py --- a/yt/data_objects/tests/test_projection.py +++ b/yt/data_objects/tests/test_projection.py @@ -1,6 +1,9 @@</p>
<pre>import numpy as np
from yt.testing import \</pre>
<ul><li><p>fake_random_ds, assert_equal, assert_rel_equal</p></li></ul>
<p>+    fake_random_ds, \ +    assert_equal, \ +    assert_rel_equal, \ +    fake_amr_ds</p>
<pre>from yt.units.unit_object import Unit
import os
import tempfile</pre>
<p>@@ -111,3 +114,12 @@</p>
<pre>v2 = (LENGTH_UNIT * dd["density"] * dd["d%s" % an]).sum()
yield assert_rel_equal, v1, v2, 10
     teardown_func(fns)</pre>
<p>+ + +def test_max_level(): +    ds = fake_amr_ds() +    proj = ds.proj('Density', 2, method='mip', max_level=2) +    assert proj['grid_level'].max() == 2 + +    proj = ds.proj('Density', 2, method='mip') +    assert proj['grid_level'].max() == ds.index.max_level</p>
<p>diff -r a98dd29e4e93fef8002811e9e05e34810574b9cd -r 9625fb44ed8778de289dd42d501dc9bedc1ee1c4 yt/visualization/fixed_resolution.py --- a/yt/visualization/fixed_resolution.py +++ b/yt/visualization/fixed_resolution.py @@ -569,11 +569,13 @@</p>
<pre>         width = self.ds.arr((self.bounds[1] - self.bounds[0],
self.bounds[3] - self.bounds[2],
self.bounds[5] - self.bounds[4]))</pre>
<ul><li><p>buff = off_axis_projection(dd.ds, dd.center, dd.normal_vector,</p></li></ul>
<p>+        buff = off_axis_projection(dd.dd, dd.center, dd.normal_vector,</p>
<pre>width, dd.resolution, item,
weight=dd.weight_field, volume=dd.volume,</pre>
<ul><li><p>no_ghost=dd.no_ghost, interpolated=dd.interpolated,</p></li>
<li><p>north_vector=dd.north_vector, method=dd.method)</p></li></ul>
<p>+                                   no_ghost=dd.no_ghost, +                                   interpolated=dd.interpolated, +                                   north_vector=dd.north_vector, +                                   method=dd.method)</p>
<pre>ia = ImageArray(buff.swapaxes(0,1), info=self._get_info(item))
self[item] = ia
return ia</pre>
<p>diff -r a98dd29e4e93fef8002811e9e05e34810574b9cd -r 9625fb44ed8778de289dd42d501dc9bedc1ee1c4 yt/visualization/plot_window.py --- a/yt/visualization/plot_window.py +++ b/yt/visualization/plot_window.py @@ -1407,7 +1407,8 @@</p>
<pre>         else:
proj = ds.proj(fields, axis, weight_field=weight_field,
               center=center, data_source=data_source,</pre>
<ul><li><p>field_parameters = field_parameters, method = method)</p></li></ul>
<p>+                           field_parameters=field_parameters, method=method, +                           max_level=max_level)</p>
<pre>         PWViewerMPL.__init__(self, proj, bounds, fields=fields, origin=origin,
fontsize=fontsize, window_size=window_size,
aspect=aspect)</pre>
<p>@@ -1640,6 +1641,8 @@</p>
<pre>center_rot, ds, normal, oap_width, fields, interpolated,
weight=weight_field,  volume=volume, no_ghost=no_ghost,
le=le, re=re, north_vector=north_vector, method=method)</pre>
<p>+        if max_level is not None: +            OffAxisProj.dd.max_level = max_level</p>
<pre>         # If a non-weighted, integral projection, assure field-label reflects that
         if weight_field is None and OffAxisProj.method == "integrate":
self.projected = True</pre>
<p>diff -r a98dd29e4e93fef8002811e9e05e34810574b9cd -r 9625fb44ed8778de289dd42d501dc9bedc1ee1c4 yt/visualization/volume_rendering/off_axis_projection.py --- a/yt/visualization/volume_rendering/off_axis_projection.py +++ b/yt/visualization/volume_rendering/off_axis_projection.py @@ -38,8 +38,8 @@</p>
<pre>Parameters
----------</pre>
<ul><li><p>data_source : `~yt.data_objects.api.Dataset`</p></li>
<li><p>This is the dataset to volume render.</p></li></ul>
<p>+    data_source : `~yt.data_objects.static_output.Dataset` or `~yt.data_objects.data_containers.YTSelectionDataContainer` +        This is the dataset or data object to volume render.</p>
<pre>center : array_like
    The current 'center' of the view port -- the focal point for the
    camera.</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-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27ATKc3Wc2XLVnigzyBpTCUhOdhSXp3uLNaueP4JJmED0rfxZ-2FMzBD81BLzRlBaZ48VpHcR8tjSkHsX5bgC3xEVtE62Wv6Hc0oGcXvZ653wZhmnCA5oVnIR5cN-2F-2FKohjJuJJbEM-2BZ2QUGZpZcWJllrnc4yw3Cu3aefALCBqvj4oXIiuIOUBPN3pRh2zWP9baLE8-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>