<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 12, 2016 at 6:47 PM, Rasmi Elasmar <span dir="ltr"><<a href="mailto:re2300@columbia.edu" target="_blank">re2300@columbia.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I'm running into more issues with Halo Catalogs and units. I'm not sure if the <a href="https://bitbucket.org/yt_analysis/yt/pull-requests/2208/" target="_blank">last PR</a> is causing this or not. </div></div></blockquote><div><br></div><div>It might very well be.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm running the latest code from the repo as of right now (fd8796c8e06d). Here's the error, generated on <a href="https://drive.google.com/open?id=0BwK-7Z3S5X_yMDNyZ1RTcG56SFU" target="_blank">this data</a> with <a href="https://gist.github.com/rasmi/6cf6017b50277390735dd484c120855f" target="_blank">this script</a>.</div></div></blockquote><div><br></div><div>Thanks! If you don't spot the fix, I'll try to take a look at this tomorrow.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">







<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/units/yt_array.py:976: RuntimeWarning: divide by zero encountered in divide<br>  return super(YTArray, self).__div__(ro)<br>Traceback (most recent call last):<br>  File "/work/03330/tg826294/applications/scripts/findhalos.py", line 65, in <module><br>    hc.create()<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/analysis_modules/halo_analysis/halo_catalog.py", line 335, in create<br>    self._run(save_halos, save_catalog, njobs=njobs, dynamic=dynamic)<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 302, in barrierize<br>    return func(*args, **kwargs)<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/analysis_modules/halo_analysis/halo_catalog.py", line 427, in _run<br>    action(new_halo)<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/analysis_modules/halo_analysis/halo_callbacks.py", line 60, in __call__<br>    self.function(halo, *self.args, **self.kwargs)<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/analysis_modules/halo_analysis/halo_callbacks.py", line 571, in iterative_center_of_mass<br>    sphere = halo.halo_catalog.data_ds.sphere(center_orig, halo.quantities[radius_field])<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/data_objects/selection_data_containers.py", line 649, in __init__<br>    if radius < self.index.get_smallest_dx():<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/units/yt_array.py", line 1095, in __lt__<br>    return super(YTArray, self).__lt__(oth)<br>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt-3.3.dev0-py2.7-linux-x86_64.egg/yt/units/yt_array.py", line 1225, in __array_wrap__<br>    raise YTUfuncUnitError(context[0], unit1, unit2)<br>yt.utilities.exceptions.YTUfuncUnitError: The NumPy <ufunc 'less'> operation is only allowed on objects with identical units. Convert one of the arrays to the other's units first. Received units (code_length) and (code_length).</font></blockquote><div><br></div></div></div></blockquote><div><br></div><div>This means you're directly comparing units from two different datasets (maybe the halo catalog dataset and the original dataset?). If these two are identical, this should work, but maybe there's a bug in the handling for that.</div><div><br></div><div>In fact, `validate_comparison_units` (see <a href="https://bitbucket.org/yt_analysis/yt/src/fd8796c8e06dabb5deee71b1a40a6e7c37adc9b3/yt/units/yt_array.py?at=yt&fileviewer=file-view-default#yt_array.py-166">https://bitbucket.org/yt_analysis/yt/src/fd8796c8e06dabb5deee71b1a40a6e7c37adc9b3/yt/units/yt_array.py?at=yt&fileviewer=file-view-default#yt_array.py-166</a>) is supposed to take care of this case - so I guess the bug is there? I don't think users should hit this exception unless they're using a ufunc directly. (i.e. np.less, not a < b).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div>Has anyone run into this before? yt seems to think these two units aren't the same -- is it possible the HaloCatalog unit import is being done incorrectly? At this point, I haven't written anything to the disk, so I'm not sure what the issue might be.</div></div></div></blockquote><div><br></div><div>Sorry for the trouble and thanks for the careful report. If you file an issue to track this we can move further discussion there:</div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/issues/new">https://bitbucket.org/yt_analysis/yt/issues/new</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Rasmi</div></div>
<br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div></div>