yt-project / yt

Main yt repository
http://yt-project.org
Other
469 stars 280 forks source link

find_clump not working on octree-AMR datasets #4322

Open PaoloSuin opened 1 year ago

PaoloSuin commented 1 year ago

This is perhaps related to #2610, since other issues with volume rendering (https://github.com/yt-project/yt/issues/1212#issuecomment-470771938 )

    ad = gas.all_data()
    master_clump = Clump(ad, ("gas", "density"))
    c_min = ad["gas", "density"].min()
    c_max = ad["gas", "density"].max()
    step = 2.0
    find_clumps(master_clump, c_min, c_max, step)

leads to

Traceback (most recent call last):
  File "/home/psuin/.local/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-1-e086ea99c2eb>", line 1, in <module>
    find_clumps(master_clump, c_min, c_max, step)
  File "/home/psuin/.local/lib/python3.10/site-packages/yt/data_objects/level_sets/clump_handling.py", line 416, in find_clumps
    clump.find_children(min_val, max_val=max_val)
  File "/home/psuin/.local/lib/python3.10/site-packages/yt/data_objects/level_sets/clump_handling.py", line 152, in find_children
    nj, cids = identify_contours(self.data, self.field, min_val, max_val)
  File "/home/psuin/.local/lib/python3.10/site-packages/yt/data_objects/level_sets/contour_finder.py", line 23, in identify_contours
    for (g, node, (sl, dims, gi)) in data_source.tiles.slice_traverse():
  File "/home/psuin/.local/lib/python3.10/site-packages/yt/data_objects/data_containers.py", line 1508, in tiles
    self._tree = AMRKDTree(self.ds, data_source=self)
  File "/home/psuin/.local/lib/python3.10/site-packages/yt/utilities/amr_kdtree/amr_kdtree.py", line 176, in __init__
    raise RuntimeError(
RuntimeError: AMRKDTree does not support particle or octree-based data.

Is there any solution or workaround?

welcome[bot] commented 1 year ago

Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue.