id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 299668148,MDU6SXNzdWUyOTk2NjgxNDg=,1938,Hooks for XArray operations,2190658,open,0,,,53,2018-02-23T10:37:43Z,2019-07-12T16:40:54Z,,MEMBER,,,,"In hope of cleaner dask and sparse support (pydata/sparse#1), I wanted to suggest hooks for XArray operations. Something like the following: ``` try: import dask.array as da xarray.hooks.register('nansum', da.array, da.nansum) ... except ImportError: pass try: import sparse.SparseArray xarray.hooks.register('nansum', sparse.SparseArray, sparse.nansum) ... except ImportError: pass ``` Functions would work something like the following: (the register would fall back to Numpy if nothing is found) - Check type of first/primary argument. - Check register for function. - Call function I would argue that this should be in Numpy, but it's a huge project to put it there.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/1938/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue