<div dir="ltr">Hi John,<div><br></div><div>I'm not able to reproduce this behavior. Using the following test script:</div><div><br></div><div><a href="http://paste.yt-project.org/show/7012/">http://paste.yt-project.org/show/7012/</a><br></div><div><br></div><div>I get the following output:</div><div><br></div><div><a href="http://paste.yt-project.org/show/7013/">http://paste.yt-project.org/show/7013/</a><br></div><div><br></div><div>This is using the latest development version of yt.</div><div><br></div><div>Can you let me know which yt version you are using?</div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 2, 2017 at 6:22 AM, John Regan <span dir="ltr"><<a href="mailto:johnanthonyregan@gmail.com" target="_blank">johnanthonyregan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi All, <br><br></div>Just wondering why the snippet of code below fails:<br><br>ds = yt.load("......./galaxy0030/<wbr>galaxy0030")<br><br>dd = ds.all_data()<br>grad_fields = ds.add_gradient_fields(("gas",<wbr>"gravitational_potential"))<br>#for i in sorted(ds.derived_field_list):<br>#    print(i)<br>print dd["gravitational_potential_<wbr>gradient_x"]<br><br><br></div>I see the gradient field (4 in total) have been added to the field list but I can't access the field. <br><br></div>Error:<br>TypeError: only length-1 arrays can be converted to Python scalars<br><br></div>Cheers,<br></div>John<br></div>
<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div>