<div dir="ltr">Hi Wolfram,<div><br></div><div>I have two suggestions. First, my line numbers don't match yours for yt/data_objects/data_containers.py. This means that you're not on the latest development version of yt. I would first try updating to the latest development version:</div>
<div><br></div><div>$ cd $YT_HG</div><div>$ hg pull</div><div>$ hg up yt</div><div>$ python setup.py build_ext -i</div><div><br></div><div>and then try your script again. If the issue isn't fixed by updating, I would then try applying the following diff to the nyx frontend:</div>
<div><br></div><div><div>diff -r f936432ed45d yt/frontends/nyx/data_structures.py</div><div>--- a/yt/frontends/nyx/data_structures.py Tue Jul 30 10:08:24 2013 -0700</div><div>+++ b/yt/frontends/nyx/data_structures.py Tue Aug 06 08:10:25 2013 -0700</div>
<div>@@ -611,7 +611,7 @@</div><div> # aliases we need</div><div> self.parameters["TopGridRank"] = len(self.parameters["TopGridDimensions"]</div><div> self.dimensionality = self.parameters["TopGridRank"]</div>
<div>- self.domain_dimensions = self.parameters["TopGridDimensions"]</div><div>+ self.domain_dimensions = np.array(self.parameters["TopGridDimensions"])</div><div> self.refine_by = self.parameters.get("RefineBy", 2) # 2 is silent defaul</div>
<div><br></div><div> # Nyx is always cosmological.</div></div><div><br></div><div>If you take a look at the enzo frontend, EnzoStaticOutput.domain_dimensions will always be a numpy array, for which an astype method is well defined. If that fixes your issue, would you mind submitting the patch as a pull request? There's more information about submitting changes in the yt docs: <a href="http://yt-project.org/docs/2.5/advanced/developing.html#making-and-sharing-changes">http://yt-project.org/docs/2.5/advanced/developing.html#making-and-sharing-changes</a></div>
<div><br></div><div>Cheers,</div><div><br></div><div>Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 2:29 AM, Wolfram Schmidt <span dir="ltr"><<a href="mailto:schmidt@astro.physik.uni-goettingen.de" target="_blank">schmidt@astro.physik.uni-goettingen.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have got problem that concerns Nyx users and/or yt developers.<br>
<br>
I want to read the root-grid level from AMR data sets with the following piece of code:<br>
<br>
<br>
num_ghost_zones=2<br>
left=na.amin(pf.h.grid_left_<u></u>edge,axis=0)<br>
right=na.amax(pf.h.grid_right_<u></u>edge,axis=0)<br>
resolution = (right-left)/pf.h.grids[0]['<u></u>dx']+2*num_ghost_zones<br>
cg = pf.h.covering_grid(0,left,<u></u>resolution,num_ghost_zones=<u></u>num_ghost_zones)<br>
<br>
<br>
This works for Enzo data sets, but it fails for Nyx data sets. The error message is<br>
<br>
<br>
Traceback (most recent call last):<br>
File "/home/h/nipiagws/scripts/<u></u>spect_sb.py", line 52, in <module><br>
cg = pf.h.covering_grid(0,left,<u></u>resolution,num_ghost_zones=<u></u>num_ghost_zones)<br>
File "/home/h/nipschul/yt-x86_64/<u></u>src/yt-hg/yt/data_objects/<u></u>data_containers.py", line 3727, in __init__<br>
self.dds = self.pf.domain_width/rdx.<u></u>astype("float64")<br>
AttributeError: 'list' object has no attribute 'astype'<br>
<br>
<br>
The script used to work also for Nyx data sets, with an older version of yt (about a year ago).<br>
<br>
How can this be fixed?<br>
<br>
Thanks a lot,<br>
Wolfram<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote></div><br></div>