Hi all,

I'm running into more issues with Halo Catalogs and units. I'm not sure if the last PR is causing this or not. I'm running the latest code from the repo as of right now (fd8796c8e06d). Here's the error, generated on this data with this script.

/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
  return super(YTArray, self).__div__(ro)
Traceback (most recent call last):
  File "/work/03330/tg826294/applications/scripts/findhalos.py", line 65, in <module>
    hc.create()
  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
    self._run(save_halos, save_catalog, njobs=njobs, dynamic=dynamic)
  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
    return func(*args, **kwargs)
  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
    action(new_halo)
  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__
    self.function(halo, *self.args, **self.kwargs)
  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
    sphere = halo.halo_catalog.data_ds.sphere(center_orig, halo.quantities[radius_field])
  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__
    if radius < self.index.get_smallest_dx():
  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__
    return super(YTArray, self).__lt__(oth)
  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__
    raise YTUfuncUnitError(context[0], unit1, unit2)
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).

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.


Thanks,

Rasmi