[yt-users] Derived field conflicts

David Collins dcollins4096 at gmail.com
Mon Mar 13 15:08:44 PDT 2017


Ahh, I see what I did.
I _did_ have all my fields in a plugin file, but at some point started
calling it from my init script as another script.
Before (for some value of before) I never had a problem doing that, and had
forgotten that it wasn't getting called in the right place.
If I have them _actually_ called from the plugins, you're correct and it
behaves as I thought it should.

Thanks for your time!
d.

On Mon, Mar 13, 2017 at 5:35 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> Hmm, if it's in a plugins file I think that's not supposed to happen for
> the reason you provide in your original email.
>
> Any chance you can make a minimal example using one of the datasets on
> yt-project.org/data that triggers this behavior? If so please file an
> issue so I can reproduce and take a look.
>
> Nathan
>
> On Mon, Mar 13, 2017 at 4:31 PM David Collins <dcollins4096 at gmail.com>
> wrote:
>
>> 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.
>> _______________________________________________
>> 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/b543fe35/attachment.html>


More information about the yt-users mailing list