[yt-dev] Grid drawing
Anthony Scopatz
scopatz at gmail.com
Thu Oct 4 10:56:17 PDT 2012
On Thu, Oct 4, 2012 at 12:50 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi Anthony,
>
> On Thu, Oct 4, 2012 at 9:53 AM, Anthony Scopatz <scopatz at gmail.com> wrote:
> > Hi Matt,
> >
> > Thanks for your efforts here. I have pulled down the changes and
> everything
> > seems to build appropriately. In my 1 min glance, there seem to still be
> > some issues using it, but I will try to correct those later today if I
> get a
> > chance.
>
> Hm, with the grid drawing? Did you find any issues with the merge?
>
Well it is actually that Slices don't work anymore:
---------------------------------------------------------------------------NameError
Traceback (most recent call
last)<ipython-input-2-58d5b2a9fce3> in <module>()----> 1 p =
SlicePlot(pf, 2, 'dens',) 2 z = 10.0 3 p.set_window((0.0,
1.0/z, -1.0/z/2, 1.0/z/2)) 4 p.annotate_grids() 5
p.annotate_flash_ray_data(pf, 'jet', 10)
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.pyc
in __init__(self, pf, axis, fields, center, width, axes_unit, origin)
984 (bounds,center) = GetBoundsAndCenter(axis, center,
width, pf) 985 slc = pf.h.slice(axis, center[axis])--> 986
slc.get_data(fields) 987 PWViewerMPL.__init__(self,
slc, bounds, origin=origin) 988
self.set_axes_unit(axes_unit)
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.pyc
in get_data(self, fields) 419 def get_data(self, fields=None):
420 if self._current_chunk is None:--> 421
self.hierarchy._identify_base_chunk(self) 422 if fields is
None: return 423 fields = self._determine_fields(fields)
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/geometry/grid_geometry_handler.pyc
in _identify_base_chunk(self, dobj) 172
dobj._chunk_info = np.array(grids, dtype='object') 173 if
getattr(dobj, "size", None) is None:--> 174 dobj.size =
self._count_selection(dobj) 175 dobj.shape =
(dobj.size,) 176 dobj._current_chunk =
list(self._chunk_all(dobj))[0]
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/geometry/grid_geometry_handler.pyc
in _count_selection(self, dobj, grids) 178 def
_count_selection(self, dobj, grids = None): 179 if grids is
None: grids = dobj._chunk_info--> 180 count =
sum((g.count(dobj.selector) for g in grids)) 181 return
count 182
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/geometry/grid_geometry_handler.pyc
in <genexpr>((g,)) 178 def _count_selection(self, dobj, grids =
None): 179 if grids is None: grids = dobj._chunk_info-->
180 count = sum((g.count(dobj.selector) for g in grids))
181 return count 182
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/grid_patch.pyc
in count(self, selector) 554 if self._last_mask is
None: return 0 555 return self._last_mask.sum()--> 556
self.select(selector) 557 return
self.count(selector) 558
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/grid_patch.pyc
in select(self, selector) 546 if id(selector) ==
self._last_selector_id: 547 return self._last_mask-->
548 self._last_mask = selector.fill_mask(self) 549
self._last_selector_id = id(selector) 550 return
self._last_mask
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/geometry/selection_routines.so
in yt.geometry.selection_routines.SelectorObject.fill_mask
(build/src.linux-x86_64-2.7/yt/geometry/selection_routines.c:4972)()
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/grid_patch.pyc
in _get_child_mask(self) 340 def _get_child_mask(self): 341
if self._child_mask == None:--> 342
self.__generate_child_mask() 343 return self._child_mask
344
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/grid_patch.pyc
in __generate_child_mask(self) 396 self._child_mask =
np.ones(self.ActiveDimensions, 'bool') 397 for child in
self.Children:--> 398 self.__fill_child_mask(child,
self._child_mask, 0) 399 if self.OverlappingSiblings is not
None: 400 for sibling in self.OverlappingSiblings:
/home/scopatz/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/grid_patch.pyc
in __fill_child_mask(self, child, mask, tofill) 377 def
__fill_child_mask(self, child, mask, tofill): 378 rf =
self.pf.refine_by--> 379 if dlevel != 1: 380 rf
= rf**dlevel 381 gi, cgi = self.get_global_startindex(),
child.get_global_startindex()
NameError: global name 'dlevel' is not defined
>
> >
> > Be Well
> > Anthony
> >
> > PS thanks for the hg and vim tricks ;)
> >
> >
> > On Thu, Oct 4, 2012 at 12:25 AM, Matthew Turk <matthewturk at gmail.com>
> wrote:
> >>
> >> Hi Anthony,
> >>
> >> I've gone ahead and merged in changeset 24087b9826d1. This merge also
> >> overlapped with the na/np changes -- so I had to do a whole bunch of
> >> conflict resolution. I think I did it correctly, but you can also check
> >> this by inspecting the actual diffs:
> >>
> >> hg up 24087b9826d1
> >>
> >> # To see differences in 3.0 versus the most recent common ancestor of
> the
> >> parents
> >> hg diff -r "p1()" -r "ancestor(p1(), p2())" some/file.py
> >> # To see differences between the yt branch and that ancestor
> >> hg diff -r "p2()" -r "ancestor(p1(), p2())" some/file.py
> >>
> >> If something looks wrong when you use it next, this is a good way to
> >> figure out what the differences could have been. (revsets are awesome.)
> >> Fortunately none of the files I split up into multiple files changed
> very
> >> much.
> >>
> >> Sidenote: this took me a while (nearly all of the episode "The Final
> >> Sacrifice" from season 10), largely because of the na/np stuff touching
> >> other changes, although I am glad we applied that change to both
> branches
> >> roughly simultaneously. But, I also discovered you can 1) set options
> in
> >> vimdiff based on whether you're in diff mode or not, so I conditionally
> >> disabled a couple plugins, and 2) use vimdiff in horizontal mode. So
> >> those're both good!
> >>
> >> -Matt
> >>
> >>
> >> On Monday, October 1, 2012, Anthony Scopatz wrote:
> >>>
> >>> Thanks a ton, Matt.
> >>>
> >>> I was hoping to get to this myself, but it doesn't look like I am going
> >>> to have the chance in the next week or so. And you are probably right
> that
> >>> a real merge needs to be done anyway.
> >>>
> >>> Be Well
> >>> Anthony
> >>>
> >>> On Mon, Oct 1, 2012 at 9:24 PM, Matthew Turk <matthewturk at gmail.com>
> >>> wrote:
> >>>>
> >>>> Hi Anthony,
> >>>>
> >>>> I'll have a go at merging all the changes into 3.0 sometime this week
> >>>> -- I'm still "offline" until tomorrow, but I should be able to take
> >>>> the time sometime either tomorrow, or Wednesday evening. That should
> >>>> fix the grid annotation; it's been a while since I've merged into 3.0,
> >>>> and I think a few points of divergence might cause some head
> >>>> scratching, but I'll ping the list when I'm done.
> >>>>
> >>>> -Matt
> >>>>
> >>>> On Fri, Sep 28, 2012 at 4:34 PM, Anthony Scopatz <scopatz at gmail.com>
> >>>> wrote:
> >>>> > Ahh Thanks Nathan,
> >>>> >
> >>>> > I missed it in yt-3.0 because it is called "annotate_grids()" and it
> >>>> > is
> >>>> > associated with the GridBoundaryCallback class. Also, it is totally
> >>>> > broken
> >>>> > in yt-3.0 so I will probably be fixing it up.
> >>>> >
> >>>> > Be Well
> >>>> > Anthony
> >>>> >
> >>>> >
> >>>> > On Fri, Sep 28, 2012 at 2:31 PM, Nathan Goldbaum
> >>>> > <nathan12343 at gmail.com>
> >>>> > wrote:
> >>>> >>
> >>>> >> Hi Anthony,
> >>>> >>
> >>>> >> Yes there is, annotate_grid (see the grid callback in
> >>>> >> plot_modifications.py.).
> >>>> >>
> >>>> >> -Nathan
> >>>> >>
> >>>> >> On Sep 28, 2012, at 12:28 PM, Anthony Scopatz wrote:
> >>>> >>
> >>>> >> > Hello yters,
> >>>> >> >
> >>>> >> > Is there already code that can be used to draw or display an AMR
> >>>> >> > grid on
> >>>> >> > the plot itself? Or is this an annotation that I should write
> ;)?
> >>>> >> >
> >>>> >> > Be Well
> >>>> >> > Anthony
> >>>> >> > _______________________________________________
> >>>> >> > yt-dev mailing list
> >>>> >> > yt-dev at lists.spacepope.org
> >>>> >> > http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> >>>> >>
> >>>> >> _______________________________________________
> >>>> >> yt-dev mailing list
> >>>> >> yt-dev at lists.spacepope.org
> >>>> >> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> >>>> >
> >>>> >
> >>>> >
> >>>> > _______________________________________________
> >>>> > yt-dev mailing list
> >>>> > yt-dev at lists.spacepope.org
> >>>> > http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> >>>> >
> >>>> _______________________________________________
> >>>> yt-dev mailing list
> >>>> yt-dev at lists.spacepope.org
> >>>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> >>>
> >>>
> >>
> >> _______________________________________________
> >> yt-dev mailing list
> >> yt-dev at lists.spacepope.org
> >> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> >>
> >
> >
> > _______________________________________________
> > yt-dev mailing list
> > yt-dev at lists.spacepope.org
> > http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> >
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20121004/077199e4/attachment.html>
More information about the yt-dev
mailing list