[yt-dev] Field Parameters Bug

Hilary Egan hilaryye at gmail.com
Wed Oct 1 13:22:31 PDT 2014


Hi all,

I've encountered a bug with this example
<http://yt-project.org/doc/developing/creating_derived_fields.html#a-more-complicated-example>
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" (sample script <http://paste.yt-project.org/show/5142/>),
then it breaks with this error <http://paste.yt-project.org/show/5140/>.

It seems as though this breaks because `has_field_parameter` always returns
True, 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!

-Hilary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20141001/84756a26/attachment.htm>


More information about the yt-dev mailing list