<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm very much with Nathan on this one.<div><br></div><div>John </div><div><br><div><div>On Dec 4, 2012, at 7:47 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Matt,<div><br></div><div>I'm personally not a fan of the level of abstraction necessary to produce an MPL object and save it to disk (i.e. in the notebook linked in the YTEP: <a href="http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/8df3719ddfd248ce9a3f10ca38a4ad57.ipynb">http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/8df3719ddfd248ce9a3f10ca38a4ad57.ipynb</a>)</div><div><br></div><div>One of the things I like about the plot window is that it's completely separate from the generation of the actual image buffers and depends on the FixedResolutionBuffer to do all the nasty work of touching the grids, pixelizing, and dealing with the real-world nature of the actual data.</div><div><br></div><div>It would be nice if we had a similar situation on the profile/phase plot side of things.  We could use ProfilePlotter and PhasePlotter to generate the raw histogram data and then use something similar to the PlotWindow to generate the plots, save them to disk or display them in iPython notebooks.</div><div><br></div><div>I guess I'm proposing another level of abstraction:</div><div><br></div><div>pf = load(filename)</div><div>dd = pf.h.all_data()</div><div>pha = PhasePlot(dd, 'Density', 'Temperature')</div><div><br></div><div>One could then access the MPL Figure object via something similar to PlotWindow:</div><div><br></div><div>fig = pha.Figure</div><div><br></div><div>and it would be just as easy to save the figure to disk:</div><div><br></div><div>pha.save()</div><div><br></div><div>I'll confess that I haven't looked at PhasePlotter or ProfilePlotter too carefully so it might be easier to just change them to match this API.  I also don't make profile plots very often so someone who uses them all the time should probably have more weight in this discussion.</div><div><br></div><div>Cheers,</div><div><br></div><div>Nathan</div><div><br><div><div>On Dec 4, 2012, at 1:21 PM, Matthew Turk wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi everyone,<br><br>I've put in a YTEP, which has been built here:<br><br><a href="https://yt.readthedocs.org/projects/ytep/en/latest/YTEPs/YTEP-0002.html">https://yt.readthedocs.org/projects/ytep/en/latest/YTEPs/YTEP-0002.html</a><br><br>Before it goes forward I'd like to hear feedback on what it describes<br>and proposes, and then I will continue with implementing and shoring<br>things up.  In particular, hearing how it could be made to provide as<br>seamless an experience as the PlotWindow would be nice.<br><br>-Matt<br><br>On Mon, Dec 3, 2012 at 2:03 PM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br><blockquote type="cite">On Mon, Dec 3, 2012 at 2:02 PM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">Hi all,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">As I noted in my other email, there was one major feature we'd talked<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">about for yt 2.5 that we never even really worked on.  Nathan and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">others pushed really hard on rethinking and redesigning the way image<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">plots were made and handled back in the 2.4 series, which eliminated<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the main use case for the PlotCollection.  However, the remaining<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">firewalls on PlotCollection are the 1-D and 2-D phase plots.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">There's been broad consensus that we need a new method for doing this,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">analogous to how PlotWindow serves to replace "add_slice" and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">"add_projection" from the PlotCollection.  Something that gets out of<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the way and lets people modify their plots as they see fit.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">A while back I implemented a first pass at this, which you can see in<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">yt/visualization/profile_plotter.py:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="https://bitbucket.org/yt_analysis/yt/src/711e95aff04b54e6ccda7dfefb0b0ae17c3830a7/yt/visualization/profile_plotter.py?at=yt">https://bitbucket.org/yt_analysis/yt/src/711e95aff04b54e6ccda7dfefb0b0ae17c3830a7/yt/visualization/profile_plotter.py?at=yt</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The idea here is that you create an instance of ProfilePlotter or<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">PhasePlotter, which then "Does the right thing" and creates the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">necessary data objects and the like.  This object can then either<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">create its own axes+figure in matplotlib, or it can deposit itself<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">into an existing axes object.  It includes axis objects and plot<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">containers that know how to plot themselves.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I don't know that I necessarily like how this is done.  It's very<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">declarative, and step by step, but I think it could be easier.  Here's<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">an example:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="https://hub.yt-project.org/go/vlilvw">https://hub.yt-project.org/go/vlilvw</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">That should read:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="https://hub.yt-project.org/nb/vlilvw">https://hub.yt-project.org/nb/vlilvw</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">One thing I think *is* quite nice is that the *plot* object is<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">independent of the profile itself.  This makes it easier to pickle and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">unpickle things, and is the reason for the existence of the various<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">sub-objects off of ProfilePlotter.  This is useful for the use case of<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">making very large datasets into profiles, pickling the resulting<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">plots, and modifying them later.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">So here are my specific questions:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> * Does this rough outline of how the object works seem good?  As in,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">making a plotter object, making it have a sub .plot object, and then<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">dispatching that plot object to various backends?  (Probably nearly<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">always matplotlib.)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> * Should we add on additional convenience operations?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> * How should it interface with existing profiles?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> * Should implementing this and finalizing the design be a blocker for 2.5?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I will create and update a YTEP with the resulting discussion from<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">this.  Nathan, Jeff and Britton -- I would very much appreciate your<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">feedback, as I know you have experience with (respectively) plot<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">windows, matplotlib, and large datasets being profiled.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-Matt<br></blockquote></blockquote>_______________________________________________<br>yt-dev mailing list<br><a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org<br></blockquote></div><br></div></div>_______________________________________________<br>yt-dev mailing list<br><a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org<br></blockquote></div><br></div></body></html>