Hi Matt and Nathan,<br><br>Thanks for your responses. I'm fine with an explicit field_parameters instead of **kwargs - in fact, now that you both mention it, I agree that it's better to do it that way. I'll submit a pull request shortly for you to look at. <br>
<br>Thanks,<br>Andrew<br><br><div class="gmail_quote">On Sun, Jan 13, 2013 at 4: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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andrew,<br>
<br>
Rather than adding **kwargs to the signature of __init__ for PWViewMPL, I think it would be better to add a field_parameters keyword argument.  This would be a dict that would be iterated over to set field parameters.  This is actually exactly how **kwargs is handled in the AMRData base class but I think mandating that the dict is referred to as field_parameters internally is a bit clearer with the added benefit that the API is concrete and doesn't rely on a somewhat advanced python concept.  I'm not a big fan of how the data containers currently handle the kwargs dict and am -1 on exposing **kwargs in a user-facing function.<br>

<br>
That being said, I haven't thought about this issue as deeply as others on the project have, and there may be very good reasons for using **kwargs in this context.<br>
<br>
Cheers,<br>
<br>
Nathan<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Folks,<br>
<br>
I was wondering if there are any objections (particularly from Nathan) to adding an optional **kwargs argument to SlicePlot and ProjectionPlot, so that we can pass in field parameters like this:<br>
<br>
pw = SlicePlot(pf, 2, 'GravitationalForceMag', center=c, width=(1e4, 'au'), particle_data=pd)<br>
<br>
instead of the (very slighty) more clunky:<br>
<br>
slice = pf.h.slice(2, c[2], ['GravitationalForceMag'], particle_data=pd)<br>
pw = slice.to_pw('<u></u>GravitationalForceMag', center=c, width=(1e4, 'au'))<br>
<br>
I think it would be nice to able to use the same syntax to generate slices and projections whether or not a derived field requires extra field parameters.<br>
<br>
Thanks,<br>
Andrew<br>
<br>
<br>
<br></div></div><div class="im">
______________________________<u></u>_________________<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" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-dev-spacepope.<u></u>org</a><br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
______________________________<u></u>_________________<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" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-dev-spacepope.<u></u>org</a><br>
</div></div></blockquote></div><br>