<html><body>
<p>2 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/75eb04732491/">https://bitbucket.org/yt_analysis/yt/commits/75eb04732491/</a> Changeset:   75eb04732491 Branch:      yt User:        ngoldbaum Date:        2016-03-24 18:52:15+00:00 Summary:     Print a better error message when accessing fields that need ghost zones from a covering grid. Closes #1070. Affected #:  1 file</p>
<p>diff -r 9c03543ba85f4f0aa07f2f0261724831cedfe754 -r 75eb04732491dc00828af6c059f0ed0dd7eb5369 yt/data_objects/construction_data_containers.py --- a/yt/data_objects/construction_data_containers.py +++ b/yt/data_objects/construction_data_containers.py @@ -40,6 +40,8 @@</p>
<pre>YTParticleDepositionNotImplemented, \
YTNoAPIKey, \
YTTooManyVertices</pre>
<p>+from yt.fields.field_exceptions import \ +    NeedsGridType</p>
<pre>from yt.utilities.lib.quad_tree import \
    QuadTree
from yt.utilities.lib.interpolators import \</pre>
<p>@@ -492,6 +494,8 @@</p>
<pre>    Number of cells along each axis of resulting covering_grid
fields : array_like, optional
    A list of fields that you'd like pre-generated for your object</pre>
<p>+    num_ghost_zones : integer, optional +        The number of padding ghost zones used when accessing fields.</p>
<pre>Examples
--------</pre>
<p>@@ -609,7 +613,16 @@</p>
<pre>fields_to_get = [f for f in fields if f not in self.field_data]
fields_to_get = self._identify_dependencies(fields_to_get)
if len(fields_to_get) == 0: return</pre>
<ul><li><p>fill, gen, part, alias = self._split_fields(fields_to_get)</p></li></ul>
<p>+        try: +            fill, gen, part, alias = self._split_fields(fields_to_get) +        except NeedsGridType: +            if self._num_ghost_zones == 0: +                raise RuntimeError( +                    “Attempting to access a field that needs ghost zones, but " +                    "num_ghost_zones = %s. You should create the covering grid " +                    "with nonzero num_ghost_zones.” % self._num_ghost_zones) +            else: +                raise</p>
<pre>if len(part) > 0: self._fill_particles(part)
if len(fill) > 0: self._fill_fields(fill)
for a, f in sorted(alias.items()):</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/a776e67368c5/">https://bitbucket.org/yt_analysis/yt/commits/a776e67368c5/</a> Changeset:   a776e67368c5 Branch:      yt User:        xarthisius Date:        2016-03-24 21:31:25+00:00 Summary:     Merged in ngoldbaum/yt (pull request #2077)</p>
<p>Print a better error message when accessing fields that need ghost zones from a covering grid. Closes #1070. Affected #:  1 file</p>
<p>diff -r 49e7f3e3aa0dd471bcfb6b350af8c9ca8b18e760 -r a776e67368c5629296b1e365dfca0b68b41ef1d5 yt/data_objects/construction_data_containers.py --- a/yt/data_objects/construction_data_containers.py +++ b/yt/data_objects/construction_data_containers.py @@ -40,6 +40,8 @@</p>
<pre>YTParticleDepositionNotImplemented, \
YTNoAPIKey, \
YTTooManyVertices</pre>
<p>+from yt.fields.field_exceptions import \ +    NeedsGridType</p>
<pre>from yt.utilities.lib.quad_tree import \
    QuadTree
from yt.utilities.lib.interpolators import \</pre>
<p>@@ -492,6 +494,8 @@</p>
<pre>    Number of cells along each axis of resulting covering_grid
fields : array_like, optional
    A list of fields that you'd like pre-generated for your object</pre>
<p>+    num_ghost_zones : integer, optional +        The number of padding ghost zones used when accessing fields.</p>
<pre>Examples
--------</pre>
<p>@@ -609,7 +613,16 @@</p>
<pre>fields_to_get = [f for f in fields if f not in self.field_data]
fields_to_get = self._identify_dependencies(fields_to_get)
if len(fields_to_get) == 0: return</pre>
<ul><li><p>fill, gen, part, alias = self._split_fields(fields_to_get)</p></li></ul>
<p>+        try: +            fill, gen, part, alias = self._split_fields(fields_to_get) +        except NeedsGridType: +            if self._num_ghost_zones == 0: +                raise RuntimeError( +                    “Attempting to access a field that needs ghost zones, but " +                    "num_ghost_zones = %s. You should create the covering grid " +                    "with nonzero num_ghost_zones.” % self._num_ghost_zones) +            else: +                raise</p>
<pre>if len(part) > 0: self._fill_particles(part)
if len(fill) > 0: self._fill_fields(fill)
for a, f in sorted(alias.items()):</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-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27CMcDsFtnOaXxUHgG2azlh3jGTedYDeI0UV99hn-2BdzIr8Ah7LY8PMI0BCXuSlYVEn21PK-2BHPohGjPEZDR3QU5HGFeT2E55WlTZQZANcDkCsPEClFJ-2BHc2JhYrm14sOMHkv4526CtE5hRRopJGJ3k2fSQ4jXj9uPAZfeZBCiFPcg7K573NcgNFt0JXGWYUP7cn4-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>