<div dir="ltr"><div><br></div>Ahh, I see what I did.  <div>I _did_ have all my fields in a plugin file, but at some point started calling it from my init script as another script.</div><div>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.  </div><div>If I have them _actually_ called from the plugins, you're correct and it behaves as I thought it should.  </div><div><br></div><div>Thanks for your time!</div><div>d.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 13, 2017 at 5:35 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><div>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.</div></div><div><br></div><div>Any chance you can make a minimal example using one of the datasets on <a href="http://yt-project.org/data" target="_blank">yt-project.org/data</a> that triggers this behavior? If so please file an issue so I can reproduce and take a look.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Nathan</div></font></span><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote"><div>On Mon, Mar 13, 2017 at 4:31 PM David Collins <<a href="mailto:dcollins4096@gmail.com" target="_blank">dcollins4096@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_2479989039961135768gmail_msg">Hi, Nathan--<div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">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. </div><div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">Thanks!</div></div><div class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg">d.</div></div><div class="gmail_extra m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"><div class="gmail_quote m_2479989039961135768gmail_msg">On Mon, Mar 13, 2017 at 5:10 PM, Nathan Goldbaum <span class="m_2479989039961135768gmail_msg"><<a href="mailto:nathan12343@gmail.com" class="m_2479989039961135768gmail_msg" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br class="m_2479989039961135768gmail_msg"><blockquote class="gmail_quote m_2479989039961135768gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_2479989039961135768gmail_msg">Is this yt.add_field call happening your script or in a plugins file?<div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">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.<br class="m_2479989039961135768gmail_msg"><div class="gmail_extra m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"><div class="gmail_quote m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768m_-5690533976585920055h5 m_2479989039961135768gmail_msg">On Mon, Mar 13, 2017 at 4:05 PM, David Collins <span class="m_2479989039961135768gmail_msg"><<a href="mailto:dcollins4096@gmail.com" class="m_2479989039961135768gmail_msg" target="_blank">dcollins4096@gmail.com</a>></span> wrote:<br class="m_2479989039961135768gmail_msg"></div></div><blockquote class="gmail_quote m_2479989039961135768gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768m_-5690533976585920055h5 m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg">Hi, Everybody!<div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">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?  </div><div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">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.</div><div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">Thanks!</div><span class="m_2479989039961135768m_-5690533976585920055m_-2195489779226976747HOEnZb m_2479989039961135768gmail_msg"><font color="#888888" class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg">d.</div><div class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div><div class="m_2479989039961135768gmail_msg">-- <br class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768m_-5690533976585920055m_-2195489779226976747m_-8198660509978076910gmail_signature m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg">-- Sent from a computer.<br class="m_2479989039961135768gmail_msg"></div></div>
</div></div></font></span></div>
<br class="m_2479989039961135768gmail_msg"></div></div>______________________________<wbr>_________________<br class="m_2479989039961135768gmail_msg">
yt-users mailing list<br class="m_2479989039961135768gmail_msg">
<a href="mailto:yt-users@lists.spacepope.org" class="m_2479989039961135768gmail_msg" target="_blank">yt-users@lists.spacepope.org</a><br class="m_2479989039961135768gmail_msg">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" class="m_2479989039961135768gmail_msg" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br class="m_2479989039961135768gmail_msg">
<br class="m_2479989039961135768gmail_msg"></blockquote></div><br class="m_2479989039961135768gmail_msg"></div></div></div>
<br class="m_2479989039961135768gmail_msg">______________________________<wbr>_________________<br class="m_2479989039961135768gmail_msg">
yt-users mailing list<br class="m_2479989039961135768gmail_msg">
<a href="mailto:yt-users@lists.spacepope.org" class="m_2479989039961135768gmail_msg" target="_blank">yt-users@lists.spacepope.org</a><br class="m_2479989039961135768gmail_msg">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" class="m_2479989039961135768gmail_msg" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br class="m_2479989039961135768gmail_msg">
<br class="m_2479989039961135768gmail_msg"></blockquote></div><br class="m_2479989039961135768gmail_msg"><br clear="all" class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768gmail_msg"><br class="m_2479989039961135768gmail_msg"></div>-- <br class="m_2479989039961135768gmail_msg"><div class="m_2479989039961135768m_-5690533976585920055gmail_signature m_2479989039961135768gmail_msg" data-smartmail="gmail_signature"><div class="m_2479989039961135768gmail_msg">-- Sent from a computer.<br class="m_2479989039961135768gmail_msg"></div></div>
</div>
______________________________<wbr>_________________<br class="m_2479989039961135768gmail_msg">
yt-users mailing list<br class="m_2479989039961135768gmail_msg">
<a href="mailto:yt-users@lists.spacepope.org" class="m_2479989039961135768gmail_msg" target="_blank">yt-users@lists.spacepope.org</a><br class="m_2479989039961135768gmail_msg">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" class="m_2479989039961135768gmail_msg" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br class="m_2479989039961135768gmail_msg">
</blockquote></div></div>
</div></div><br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- Sent from a computer.<br></div></div>
</div>