Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dask problem: no dispatch for Lazy Masks #909

Open
keflavich opened this issue May 28, 2024 · 1 comment
Open

Dask problem: no dispatch for Lazy Masks #909

keflavich opened this issue May 28, 2024 · 1 comment

Comments

@keflavich
Copy link
Contributor

Traceback (most recent call last):
  File "/orange/adamginsburg/ACES/reduction_ACES/aces/analysis/giantcube_cuts.py", line 123, in <module>
    signal_mask = ndmorph.binary_dilation(signal_mask, structure=np.ones([3, 3, 3]), iterations=1)
  File "/orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/dask_image/ndmorph/__init__.py", line 57, in binary_dilation
    dispatch_binary_dilation(image),
  File "/orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/dask_image/dispatch/_dispatcher.py", line 23, in __call__
    meth = self.dispatch(datatype)
  File "/orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/dask/utils.py", line 635, in dispatch
    raise TypeError(f"No dispatch for {cls}")
TypeError: No dispatch for <class 'spectral_cube.masks.LazyComparisonMask'>

Unfortunately, it looks like this means mask dilation/erosion can only be done on already-computed masks without some extra work. @astrofrog any ideas on what we need to add to mask objects to make them play nice with dask?

@keflavich
Copy link
Contributor Author

signal_mask.include() is likely all that is needed here; I'll give this a day or two before I decide it's just user error on my part, though maybe we want to have dask utilities default to using the include result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant