<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 1, 2014 at 1:25 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Oct 1, 2014 at 1:22 PM, Hilary Egan <span dir="ltr"><<a href="mailto:hilaryye@gmail.com" target="_blank">hilaryye@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I've encountered a bug with <a href="http://yt-project.org/doc/developing/creating_derived_fields.html#a-more-complicated-example" target="_blank">this example</a> in the docs of getting/setting field parameters of a dataset for use in a derived field. The example works fine for known yt field parameters like bulk_velocity, but if you change every instance of "bulk_velocity" to "my_bulk_velocity" (<a href="http://paste.yt-project.org/show/5142/" target="_blank">sample script</a>), then it breaks with <a href="http://paste.yt-project.org/show/5140/" target="_blank">this error</a>. </div><div><br></div><div>It seems as though this breaks because `has_field_parameter` always returns True</div></div></blockquote><div><br></div></span><div>Note that this is specifically has_field_parameter as defined in the field_detector class: </div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/src/05de9b2f84be6cc8b933f0af75ac211a57a44d7d/yt/fields/field_detector.py?at=yt#cl-215" target="_blank">https://bitbucket.org/yt_analysis/yt/src/05de9b2f84be6cc8b933f0af75ac211a57a44d7d/yt/fields/field_detector.py?at=yt#cl-215</a></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>, and there is no way to know ahead of time what units a user-defined field parameter will take, so the mock field data can't be set up correctly. Nathan suggested via IRC that this might necessitate creating a way to register user-defined field parameters, but it's probably worth brain-storming about if anyone else has any other suggestions!</div></div></blockquote><div><br></div></span><div>The main issue with the way field parameters work right now is that we can't know the units ahead of time for user-defined field parameters. We could either have a field parameter registry where users would encode that before loading their data, or we could temporarily disable the unit system during field detection, which I am loathe to do since it will cause bugs.</div></div></div></div></blockquote><div><br></div><div>I meant to say "mask bugs" here.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span><font color="#888888"><div><br></div><div>-Hilary</div></font></span></div>
<br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div></div>