[yt-dev] Swapping out a data_source in a Plot Window
Nathan Goldbaum
nathan12343 at gmail.com
Sat Oct 27 16:19:46 PDT 2012
Hi Matt,
Looking at the code it looks like we don't query the data source for anything at initialization besides the location of the maximum density point if the user doesn't provide a center for the plot.
All the relevant metadata is actually obtained from the data_source attached to the frb object. The frb is regenerated every time a function wrapped with the invalidate_data decorator is called so I don't think you'll run into issues if you start swapping out data_sources.
TimeSeriesPlotWindow sounds like a great idea. As you're probably aware, that's just a hop skip and a jump away from having something like:
TimeSeriesPlotWindow.write_movie('awesome_movie.mp4').
Happy hacking :)
Cheers,
Nathan
On Oct 27, 2012, at 3:59 PM, Matthew Turk wrote:
> Hi all (especially Nathan),
>
> Looking over the Plot Window code, I think this is okay, but I wanted
> to make sure that there wasn't something I was missing. Is there any
> reason I can't swap out a data_source in a plot window, invalidate the
> data, and then save()? Or will there be lingering hints of the old
> data source, and the old parameter file?
>
> The context for this is that I'm adding a TimeSeriesPlotWindow, and I
> want to try to retain as much as I can as I switch between datasets.
> Annotations, widht (in code units), limits, etc etc.
>
> Thanks,
>
> Matt
> _______________________________________________
> 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