<div dir="ltr">Just as a conclusion to this email chain, the bug was fixed in a recent pull request by Matt and myself.<div><br></div><div>Cameron</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 4:15 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Cameron,<br>
<br>
Looks to me like derived_field_list is set initially inside<br>
field_info_container, and then updated in the _setup_filtered_type<br>
function to include the filtered particle types.  When<br>
_setup_particle_type is called in that function, the return value of<br>
that call should be appended to derived_field_list.<br>
<br>
-Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jul 14, 2014 at 5:53 PM, Cameron Hummels <<a href="mailto:chummels@gmail.com">chummels@gmail.com</a>> wrote:<br>
> Hey Matt,<br>
><br>
> Thanks for the message.  The deposit fields from the new filter *do* appear<br>
> in ds.field_info.keys(), just not in the ds.derived_field_list.  In fact,<br>
> the desired deposit fields fully exist, so evidently they are being<br>
> deposited on to the grids, and I can use them in Slices and such, but these<br>
> fields just don't appear in the derived_field_list.<br>
><br>
> I've spent the last two hours trying to figure out where fields are added to<br>
> the derived_field_list after they are created.  I see that in<br>
> _setup_filtered_type() is run after a filter is created, it adds the new<br>
> filtered particle fields to the derived_field_list, but nowhere in the<br>
> deposition infrastructure are those fields seemingly added to the<br>
> derived_field_list, unless perhaps it occurs in the registry.add_field()<br>
> step.  Ideas?<br>
><br>
> Cameron<br>
><br>
><br>
> On Mon, Jul 14, 2014 at 10:40 AM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi Cameron,<br>
>><br>
>> So, I've now also dug in.  I think what happens is that the particle<br>
>> fields plugin never gets re-called.  This is the function<br>
>> particle_deposition_functions, which should get called by<br>
>> setup_particle_fields, which gets called by setup_particle_type.  So I<br>
>> don't know why it's not getting called for you.  Are you sure it's not<br>
>> getting called, and is not just not registering it?  Is the field in<br>
>> ds.field_info.keys() ?<br>
>><br>
>> -Matt<br>
>><br>
>> On Sun, Jul 13, 2014 at 9:22 PM, Cameron Hummels <<a href="mailto:chummels@gmail.com">chummels@gmail.com</a>><br>
>> wrote:<br>
>> > So I used pdb to try to track the process of creating a filtered<br>
>> > particle<br>
>> > type.  After the particle filter type namespace is created, all of the<br>
>> > particle fields are added to it and added to the derived_field_list, and<br>
>> > then that _setup_particle_types([<a href="http://filter.name" target="_blank">filter.name</a>]) is called, however, it<br>
>> > doesn't appear that the infrastructure for creating fields in the<br>
>> > "deposit"<br>
>> > namespace is ever called from this.<br>
>> ><br>
>> > I've confirmed that added particle fields are not propagated to<br>
>> > "deposit"<br>
>> > for either gadget or enzo datasets in the following notebook.  Since<br>
>> > it's<br>
>> > unclear to me how to initiate the deposit field infrastructure (no docs<br>
>> > or<br>
>> > docstrings), I'm not sure how to fix this problem.  Any thoughts from<br>
>> > others<br>
>> > more experienced with writing this code?  Matt?  Britton?<br>
>> ><br>
>> > <a href="http://nbviewer.ipython.org/gist/StewardObservatory/918ff0246f1132ef585b" target="_blank">http://nbviewer.ipython.org/gist/StewardObservatory/918ff0246f1132ef585b</a><br>
>> ><br>
>> > Cameron<br>
>> ><br>
>> ><br>
>> > On Sat, Jul 12, 2014 at 4:55 AM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Hi Cameron,<br>
>> >><br>
>> >> On Sat, Jul 12, 2014 at 2:52 AM, Cameron Hummels <<a href="mailto:chummels@gmail.com">chummels@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Hi John,<br>
>> >> ><br>
>> >> > That is what I figured as well, but it doesn't appear to<br>
>> >> > automatically<br>
>> >> > create those deposit fields when you add the particle field after<br>
>> >> > initialization of the dataset.  Yes, it creates other deposit fields<br>
>> >> > for<br>
>> >> > the<br>
>> >> > particle namespaces (e.g. Gas, Stars, DarkMatter) that are defined at<br>
>> >> > initialization. However, when I create a particle filter which makes<br>
>> >> > its<br>
>> >> > own<br>
>> >> > set of fields after initialization, these are not automatically added<br>
>> >> > as<br>
>> >> > deposit fields.<br>
>> >><br>
>> >> Hmm.  _setup_filtered_type is called by add_particle_filter, and then<br>
>> >> it in turn calls _setup_particle_types([<a href="http://filter.name" target="_blank">filter.name</a>]), which should<br>
>> >> eventually create the derived fields.  I would suggest trying to<br>
>> >> figure out at what point the process stops, and then we can figure out<br>
>> >> why it thinks it shouldn't add the deposit fields.<br>
>> >><br>
>> >> ><br>
>> >> > I can add a notebook demonstrating this if it is easier.  I just<br>
>> >> > thought<br>
>> >> > someone might know of a way to force the generation of the deposit<br>
>> >> > fields<br>
>> >> > for newly derived fields not generated at initialization of a<br>
>> >> > dataset.<br>
>> >> ><br>
>> >> > Cameron<br>
>> >> ><br>
>> >> ><br>
>> >> > On Fri, Jul 11, 2014 at 6:51 PM, John Wise <<a href="mailto:jwise@physics.gatech.edu">jwise@physics.gatech.edu</a>><br>
>> >> > wrote:<br>
>> >> >><br>
>> >> >> Hi Cameron,<br>
>> >> >><br>
>> >> >> If the particle filter name is called "bh", you can use the field<br>
>> >> >> ("deposit", "bh_cic").  You can also use the other deposit fields,<br>
>> >> >> like<br>
>> >> >> "bh_count", "bh_density", "bh_mass".<br>
>> >> >><br>
>> >> >> Cheers,<br>
>> >> >> John<br>
>> >> >><br>
>> >> >><br>
>> >> >> On 07/11/2014 08:16 PM, Cameron Hummels wrote:<br>
>> >> >>><br>
>> >> >>> I'm playing with the new particle filter functionality in yt-3.0,<br>
>> >> >>> but<br>
>> >> >>> I'm running into some problems.  I can successfully create a<br>
>> >> >>> particle<br>
>> >> >>> filter, but how do I get those fields to be subsequently deposited<br>
>> >> >>> on<br>
>> >> >>> the grid (like the other fields in the "deposit" namespace)?<br>
>> >> >>><br>
>> >> >>> Is there a command for forcing a particle field deposition on to<br>
>> >> >>> the<br>
>> >> >>> grid?<br>
>> >> >>><br>
>> >> >>> Thanks!<br>
>> >> >>><br>
>> >> >>> Cameron<br>
>> >> >>><br>
>> >> >>><br>
>> >> >>><br>
>> >> >>> --<br>
>> >> >>> Cameron Hummels<br>
>> >> >>> Postdoctoral Researcher<br>
>> >> >>> Steward Observatory<br>
>> >> >>> University of Arizona<br>
>> >> >>> <a href="http://chummels.org" target="_blank">http://chummels.org</a><br>
>> >> >>><br>
>> >> >>><br>
>> >> >>> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >> >>><br>
>> >> >><br>
>> >> >> --<br>
>> >> >> John Wise<br>
>> >> >> Assistant Professor of Physics<br>
>> >> >> Center for Relativistic Astrophysics, Georgia Tech<br>
>> >> >> <a href="http://cosmo.gatech.edu" target="_blank">http://cosmo.gatech.edu</a><br>
>> >> >> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > Cameron Hummels<br>
>> >> > Postdoctoral Researcher<br>
>> >> > Steward Observatory<br>
>> >> > University of Arizona<br>
>> >> > <a href="http://chummels.org" target="_blank">http://chummels.org</a><br>
>> >> ><br>
>> >> > _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >> ><br>
>> >> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Cameron Hummels<br>
>> > Postdoctoral Researcher<br>
>> > Steward Observatory<br>
>> > University of Arizona<br>
>> > <a href="http://chummels.org" target="_blank">http://chummels.org</a><br>
>> ><br>
>> > _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> ><br>
>> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Cameron Hummels<br>
> Postdoctoral Researcher<br>
> Steward Observatory<br>
> University of Arizona<br>
> <a href="http://chummels.org" target="_blank">http://chummels.org</a><br>
><br>
> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cameron Hummels<div>Postdoctoral Researcher</div><div>Steward Observatory</div><div>University of Arizona</div><div><a href="http://chummels.org" target="_blank">http://chummels.org</a></div>


</div>