[yt-users] Derived field conflicts
David Collins
dcollins4096 at gmail.com
Mon Mar 13 14:31:01 PDT 2017
Hi, Nathan--
They're in a plugins file. I like having my derived fields in one spot to
reduce confusion and improve code re-use. The biggest problem I foresee
with using ds.add_field is the units and validators and logs have gotten
kind of complicated, and I have a morass of scripts that instantiate
datasets in various places, so putting each add_field with each ds will be
cumbersome without making some jig to hold the parts. Maybe that will be
straight forward.
Thanks!
d.
On Mon, Mar 13, 2017 at 5:10 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:
> Is this yt.add_field call happening your script or in a plugins file?
>
> If it's in a script one simple way to do it would be to replace the call
> to yt.add_field with a call to ds.add_field that's inside an if statement
> that checks to see if a needed field is in ds.field_list first.
>
> On Mon, Mar 13, 2017 at 4:05 PM, David Collins <dcollins4096 at gmail.com>
> wrote:
>
>> Hi, Everybody!
>>
>> Every now and then I'll add a new field using yt.add_field() that
>> includes the magnetic field. If I then load another dataset that doesn't
>> have the magnetic field, it chokes when it parses the hierarchy because it
>> tries to validate my new field against the dataset that doesn't have B. Is
>> there a simple way I can fix my field definition to prevent this?
>>
>> I'd like to avoid adding every field manually to each dataset, since I
>> have a lot of fields, and a lot of dataset, and some have B and some dont,
>> etc. but I see that's probably the most obvious fix.
>>
>> Thanks!
>> d.
>>
>> --
>> -- Sent from a computer.
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
--
-- Sent from a computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170313/b5b0bcc1/attachment.html>
More information about the yt-users
mailing list