<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 21, 2016 at 3:37 PM, Yi-Hao Chen <span dir="ltr"><<a href="mailto:yihaochentw@gmail.com" target="_blank">yihaochentw@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Wed, Dec 21, 2016 at 3:04 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Dec 21, 2016 at 2:55 PM, Yi-Hao Chen <span dir="ltr"><<a href="mailto:yihaochentw@gmail.com" target="_blank">yihaochentw@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<br><br>I am wondering why ProjectionPlot (and others) do not take all the keyword arguments and pass them to PWViewerMPL and PlotWindow. For example, currently there is no way to set buff_size at the creation of a plot. One has to call .set_buff_size after the plot was created.<br><br>I am thinking about leaving only the arguments specific to ProjectionPlot explicitly, and use **kwargs to pass all other arguments to PlotWindow. But if there are reasons not to do this, please let me know.<br></div></blockquote><div><br></div></span><div>This is on purpose, to reduce the API complexity. ProjectionPlot already has a huge number of keyword arguments, adding more will only make it harder to discover functionality.</div></div></div></div></blockquote></span><div><br>I see. That make sense.<br></div><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>I'd be much more interested in figuring out ways to make the setters more intuitive - possibly by exposing plot attributes as descriptors?</div></div></div></div></blockquote><div><br></div></span><div>I have no idea how to implement the descriptors... <br></div></div></div></div></blockquote><div><br></div><div>Here's a nice article on descriptors that I've often referred to in the past:</div><div><br></div><div><a href="http://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb">http://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb</a><br></div><div><br></div><div>The idea would be to expose the internal state for the plot objects via descriptors. This would make it possible to do, e.g.:</div><div><br></div><div>    plot = yt.ProjectionPlot(ds, 2, 'density')</div><div><br></div><div>    # both of these should work and be handled by the descriptor</div><div>    plot.buff_size = (800, 1600)</div><div>    plot.buff_size = np.array(800, 1600)</div><div><br></div><div>    print(plot.buff_size)</div><div>    plot.save()</div><div><br></div><div>There are a number of plot attributes (some of them currently private) that we could handle (hopefully) more intuitively using this sort of API. The reason why I think it needs to happen (if it should happen) as part of a bigger refactoring is that we shouldn't leave the API partially converted to look like this, as that will be even more awkward to use.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>Thanks!<span class="gmail-m_-5720543438653983114m_-1550955214613379125HOEnZb"><font color="#888888"><br>Yi-Hao<div class="gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-yj6qo gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-ajU"><div id="gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-:2cq" class="gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-ajR"><span class="gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-HOEnZb gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-adL"></span></div></div><span class="gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-HOEnZb gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-adL"></span></font></span></div>
<br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div></div>
<br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></span></div><br></div></div>
<br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-dev-spacepope.<wbr>org</a><br>
<br></blockquote></div><br></div></div>