<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;"><div><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Ahh, I think I see the issue.  hg has very strong backward<br>compatibility; however, if a higher versioned hg operates on a repo,<br>it can up-convert it.  So what I think is happening is that you're<br>using an old hg on a repo that's been updated by a newer hg.  Any<br>chance you've switched to, say, the system mercurial after using a<br>personally-installed one?<br></div></blockquote><div><br></div><div>Not intentionally: I normally opt for the install script. But I may have done it under careful direction at some point. Is the best thing to do a refresh install from the repo?</div><div><br></div><div>Elizabeth</div><div> </div><div><br></div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Also, I think this is what's preventing "yt update" from working!<br><br>-Matt<br><br><blockquote type="cite"><br>E.<br><br><br>On 25 April 2014 17:44, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br><blockquote type="cite"><br>Hi Elizabeth,<br><br>On Fri, Apr 25, 2014 at 4:38 AM, Elizabeth Tasker<br><<a href="mailto:tasker@astro1.sci.hokudai.ac.jp">tasker@astro1.sci.hokudai.ac.jp</a>> wrote:<br><blockquote type="cite">Hi Matt,<br><br>Thanks! This is:<br><br>yt module located at:<br>   /home/tasker/yt-new2/src/yt-hg<br><br>The current version of the code is:<br><br>---<br>81c2f6f5f983<br>---<br><br><br>Elizabeth<br></blockquote><br>I've just checked, and I am able to replicate the error with this<br>changeset using this script:<br><br>from yt.mods import *<br>pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")<br>level = 0<br>left = [0.0, 0.0, 0.0]<br>dims = [16, 16, 16]<br>cgrid = pf.h.covering_grid(level, left_edge = left, dims=dims,<br>num_ghost_zones=2)<br><br>However, when I update to the current tip of the yt branch,<br>1a67d558b51c, it works.  :)<br><br>-Matt<br><br><blockquote type="cite"><br><br>On 25 April 2014 17:34, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br><blockquote type="cite"><br>Hi Elizabeth,<br><br>On Fri, Apr 25, 2014 at 3:40 AM, Elizabeth Tasker<br><<a href="mailto:tasker@astro1.sci.hokudai.ac.jp">tasker@astro1.sci.hokudai.ac.jp</a>> wrote:<br><blockquote type="cite">Hi,<br><br>I've hit a problem with the latest version of yt and covering grid<br>that<br>is<br>linked with the number of ghostzones. My code looked like:<br><br>for dim in range(3):<br><br>     left.append(cloud_position[c][dim] - 0.5*width[dim])<br>     right.append(cloud_position[c][dim] + 0.5*width[dim])<br>     dims.append(int(round((right[dim]-left[dim])/cellsize)))<br><br>   cgrid = pf.h.covering_grid(level,<br>                              left_edge = left,<br>                              dims=dims,<br>                              num_ghost_zones=2)<br><br><br>but gives me:<br><br>TypeError                                 Traceback (most recent call<br>last)<br>/home/tasker/yt-new2/src/yt-hg/scripts/iyt in <module>()<br>----> 1 execfile("export_hdf5_cube.py")<br><br>/home/tasker/yt-new2/src/yt-hg/scripts/iyt in <module>()<br>    51                                left_edge = left,<br>    52                                dims=dims,<br>---> 53                                num_ghost_zones=2)<br>    54<br>    55<br><br>/home/tasker/yt-new2/src/yt-hg/yt/data_objects/data_containers.pyc in<br>__init__(self, level, left_edge, dims, fields, pf, num_ghost_zones,<br>use_pbar, **kwargs)<br>  3689         self.level = level<br>  3690         rdx =<br>self.pf.domain_dimensions*self.pf.refine_by**level<br>-> 3691         rdx[np.where(dims - 2 * num_ghost_zones <= 1)] = 1<br>#<br>issue<br>602<br>  3692         self.dds = self.pf.domain_width /<br>rdx.astype("float64")<br>  3693         self.ActiveDimensions = np.array(dims, dtype='int32')<br><br>TypeError: unsupported operand type(s) for -: 'list' and 'int'<br><br><br><br><br>This happens regardless of whether I use num_ghost_zones or not. If I<br>don't<br>have ghost_zones set, the error occurs at line 52, but still points<br>to<br>line<br>3691. Dims and left look fine:<br><br>In [9]: dims<br>Out[9]: [64, 64, 64]<br><br>In [10]: left<br>Out[10]: [20.424700000000001, 11.512700000000001, 15.7158]<br><br>In [11]: level<br>Out[11]: 5<br><br>In [14]: rdx = pf.domain_dimensions*pf.refine_by**level<br>In [15]: rdx<br>Out[15]: array([4096, 4096, 4096])<br><br><br>If I set num_ghost_zones = na.array([0,0,0]) then it runs. However,<br>if I<br>then try<br><br>cgrid["x"]<br><br>I hit more problems circulating around the same area:<br><br>ValueError                                Traceback (most recent call<br>last)<br>/home/tasker/yt-new2/src/yt-hg/scripts/iyt in <module>()<br>----> 1 cgrid["y"]<br><br>/home/tasker/yt-new2/src/yt-hg/yt/data_objects/data_containers.pyc in<br>__getitem__(self, key)<br>   316             if key not in self.fields:<br>   317                 self.fields.append(key)<br>--> 318             self.get_data(key)<br>   319         return self.field_data[key]<br>   320<br><br>/home/tasker/yt-new2/src/yt-hg/yt/data_objects/data_containers.pyc in<br>get_data(self, fields)<br>  3733                 try:<br>  3734                     #print "Generating", field<br>-> 3735                     self._generate_field(field)<br>  3736                     continue<br>  3737                 except NeedsOriginalGrid, ngt_exception:<br><br>/home/tasker/yt-new2/src/yt-hg/yt/data_objects/data_containers.pyc in<br>_generate_field(self, field)<br>  3764         if self.pf.field_info.has_key(field):<br>  3765             # First we check the validator; this might even<br>raise!<br>-> 3766             self.pf.field_info[field].check_available(self)<br>  3767             self[field] = self.pf.field_info[field](self)<br>  3768         else: # Can't find the field, try as it might<br><br><br>/home/tasker/yt-new2/src/yt-hg/yt/data_objects/field_info_container.pyc<br>in<br>check_available(self, data)<br>   354         """<br>   355         for validator in self.validators:<br>--> 356             validator(data)<br>   357         # If we don't get an exception, we're good to go<br>   358         return True<br><br><br>/home/tasker/yt-new2/src/yt-hg/yt/data_objects/field_info_container.pyc<br>in<br>__call__(self, data)<br>   482         if not data._spatial:<br>   483             raise NeedsGridType(self.ghost_zones,self.fields)<br>--> 484         if self.ghost_zones <= data._num_ghost_zones:<br>   485             return True<br>   486         raise NeedsGridType(self.ghost_zones,self.fields)<br><br>ValueError: The truth value of an array with more than one element is<br>ambiguous. Use a.any() or a.all()<br><br><br>cgrid["Density"] and the velocities are fine.<br><br>I'm suspecting this is because the position calculation in the code<br>is<br>not<br>expecting an array for the ghost zone number?<br><br>Oddly, I see from the mailing list is this reminiscent of a problem<br>nyx<br>was<br>having.<br></blockquote><br>Yes, and it feels like this exact issue -- where dims are lists, not<br>arrays -- gets fixed over and over and over again.  :(  Can you report<br>which changeset you're on, and I'll push a fix?<br><br>-Matt<br><br><blockquote type="cite"><br>Elizabeth<br><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br><br></blockquote>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote><br><br><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br><br></blockquote>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote><br><br><br>_______________________________________________<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">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br><br></blockquote>_______________________________________________<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">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div></blockquote></div><br></body></html>