[yt-dev] Issue with PlotWindow and Callbacks

Nathan Goldbaum nathan12343 at gmail.com
Thu Jul 12 09:58:38 PDT 2012


Hey Matt,

I'm not sure, that try/catch block was added by Jeff Oishi in 
97c0e3d2c19d back in 2010.  It may not be necessary anymore.

Cheers,

Nathan

On 7/12/12 5:52 AM, Matthew Turk wrote:
> Sure, it's done in restore_grid_state in yt/data_objects/data_containers.py.
>
> I looked into this and it looks to me like the recreate frb function,
> which calls this get_data_source_fields, is the problem.  Once the FRB
> gets invalidated, it looks at this and gets them back.  PR #
>
> Also, Nathan, what is the exception you're expecting to catch in the
> naked try/except block there?
>
> On Wed, Jul 11, 2012 at 10:19 PM, John ZuHone <jzuhone at gmail.com> wrote:
>> Matt,
>>
>> Can you point to where this is done?
>>
>> John
>>
>> On Jul 12, 2012, at 1:06 AM, Matthew Turk wrote:
>>
>>> Hi Nathan and John,
>>>
>>> What if the quiver callback simply popped any newly generated fields
>>> when it was done?  That's what we do for the grids when calculating
>>> derived fields.
>>>
>>> -Matt
>>>
>>> On Wed, Jul 11, 2012 at 10:05 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>>>> Hi John,
>>>>
>>>> I haven't tested the quiver callbacks yet and I'm not particularly surprised
>>>> that they're a bit broken.
>>>>
>>>> Your list should probably be attached to every instance PWViewer so that it
>>>> is accessible by the CallbackWrapper.  At line 638 you can set the fields to
>>>> plot to be self._frb.data.keys() minus the fields included in your new list.
>>>>
>>>> It might be a bit tricky to generate the list since the callbacks are
>>>> generated dynamically.  Maybe the thing to do is inspect
>>>> self._frb.data.keys() before and after the callback is called inside
>>>> PWViewerMPL._setup_plots() (line 689 in my version of plot_window.py).
>>>>
>>>> Please let us know if you run into any difficulties.
>>>>
>>>> Cheers,
>>>>
>>>> Nathan
>>>>
>>>>
>>>> On 7/11/12 9:52 PM, John Zuhone wrote:
>>>>> Hi all,
>>>>>
>>>>> I've found an issue with PlotWindow and callbacks. The example script I
>>>>> have included adds velocity vectors on top of a slice:
>>>>>
>>>>> http://paste.yt-project.org/show/2544/
>>>>>
>>>>> Later on in the script, I try to resize the plot, but I get this error:
>>>>>
>>>>> http://paste.yt-project.org/show/2545/
>>>>>
>>>>> This is because the field list now includes x-velocity and y-velocity, but
>>>>> there are not any plots corresponding to these fields in the list. I figure
>>>>> that the answer to this is to retain some sort of field list that
>>>>> corresponds to the fields that are actually being plotted in the colorscale,
>>>>> but I figured before I just went in and dropped it in somewhere I'd ask for
>>>>> opinions as to where it should go.
>>>>>
>>>>> Best,
>>>>>
>>>>> John Z
>>>>>
>>>>> --
>>>>> John ZuHone
>>>>>
>>>>> Postdoctoral Researcher
>>>>> NASA/Goddard Space Flight Center
>>>>>
>>>>> jzuhone at gmail.com <mailto:jzuhone at gmail.com>
>>>>> john.zuhone at nasa.gov <mailto:john.zuhone at nasa.gov>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> yt-dev mailing list
>>>>> yt-dev at lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>>>
>>>>
>>>> _______________________________________________
>>>> yt-dev mailing list
>>>> yt-dev at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>> _______________________________________________
>>> yt-dev mailing list
>>> yt-dev at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>> _______________________________________________
>> yt-dev mailing list
>> yt-dev at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org





More information about the yt-dev mailing list