<html><body>
<p>1 new commit in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/86db031f1f56/">https://bitbucket.org/yt_analysis/yt/commits/86db031f1f56/</a> Changeset:   86db031f1f56 Branch:      yt User:        ngoldbaum Date:        2016-03-28 20:06:49+00:00 Summary:     Merged in brittonsmith/yt (pull request #2087)</p>
<p>Making YTFieldTypeNotFound exception more informative. (closes #1027) Affected #:  2 files</p>
<p>diff -r 61be4a106d8843629a48f23b27cc532a1e4ee91e -r 86db031f1f56a6f396d4440188707f1fdb8e6bfa yt/data_objects/data_containers.py --- a/yt/data_objects/data_containers.py +++ b/yt/data_objects/data_containers.py @@ -1005,9 +1005,9 @@</p>
<pre># these tests are really insufficient as a field type may be valid, and the
# field name may be valid, but not the combination (field type, field name)
if finfo.particle_type and ftype not in self.ds.particle_types:</pre>
<ul><li><p>raise YTFieldTypeNotFound(ftype)</p></li></ul>
<p>+                raise YTFieldTypeNotFound(ftype, ds=self.ds)</p>
<pre>elif not finfo.particle_type and ftype not in self.ds.fluid_types:</pre>
<ul><li><p>raise YTFieldTypeNotFound(ftype)</p></li></ul>
<p>+                raise YTFieldTypeNotFound(ftype, ds=self.ds)</p>
<pre>            explicit_fields.append((ftype, fname))
        return explicit_fields
</pre>
<p>diff -r 61be4a106d8843629a48f23b27cc532a1e4ee91e -r 86db031f1f56a6f396d4440188707f1fdb8e6bfa yt/utilities/exceptions.py --- a/yt/utilities/exceptions.py +++ b/yt/utilities/exceptions.py @@ -75,11 +75,18 @@</p>
<pre>        return "Could field '%s' in %s could not be generated." % (self.fname, self.ds)

class YTFieldTypeNotFound(YTException):</pre>
<ul><li><p>def __init__(self, fname):</p></li>
<li><p>self.fname = fname</p></li></ul>
<p>+    def __init__(self, ftype, ds=None): +        self.ftype = ftype +        self.ds = ds</p>
<pre>def __str__(self):</pre>
<ul><li><p>return “Could not find field '%s'.” % (self.fname)</p></li></ul>
<p>+        if self.ds is not None and \ +          self.ftype in self.ds.particle_types: +            return ("Could not find field type ‘%s’.  " + +                    “This field type is a known particle type for this dataset.  " + +                    “Try adding this field with particle_type=True.”) % self.ftype +        else: +            return "Could not find field type '%s'.” % (self.ftype)</p>
<pre>class YTSimulationNotIdentified(YTException):
    def __init__(self, sim_type):</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-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27A-2F0FYUII-2Fdtj27GTQ6OQeZEMzK7UaVq1I0RoPCCKEVsnOoEBBBNmzRQG2VIHCz2fkr8L2ZXShU2sPf4cGxEC-2Ft2b-2Fd7rzesSRB75yclr5sY3GZb2zEFMZI08zZtIZQQMAdvJT29MF6ePpw50W9u0AwYuw6-2BeJaqK7kv2eIuVvCbYvGrPxkzvU7iH-2FhBg3iuaw-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>