html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/1699#issuecomment-609866371,https://api.github.com/repos/pydata/xarray/issues/1699,609866371,MDEyOklzc3VlQ29tbWVudDYwOTg2NjM3MQ==,2443309,2020-04-06T15:31:16Z,2020-04-06T15:31:16Z,MEMBER,also pinging @dcherian who has been working on a similar problem set with `map_blocks` in #3816.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-609650053,https://api.github.com/repos/pydata/xarray/issues/1699,609650053,MDEyOklzc3VlQ29tbWVudDYwOTY1MDA1Mw==,6213168,2020-04-06T08:26:13Z,2020-04-06T08:26:13Z,MEMBER,still relevant,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-609098334,https://api.github.com/repos/pydata/xarray/issues/1699,609098334,MDEyOklzc3VlQ29tbWVudDYwOTA5ODMzNA==,26384082,2020-04-04T22:37:22Z,2020-04-04T22:37:22Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-386835630,https://api.github.com/repos/pydata/xarray/issues/1699,386835630,MDEyOklzc3VlQ29tbWVudDM4NjgzNTYzMA==,1217238,2018-05-05T21:17:20Z,2018-05-05T21:17:20Z,MEMBER,"`dtype = [getattr(x, 'dtype', getattr(x, 'dtypes'))]` would be another alternative, but I agree it's ugly. The ternary expression `dtype = x.dtypes if isinstance(x, xarray.Dataset) else x.dtype` would also work.
I agree with the concern about duck typing, but my concern with `Dataset.dtype` is that there is strong convention for a `dtype` attribute to be an actual NumPy dtype.
Another option would be accept either objects with a dtype or dtypes in `output_dtypes`, like `np.result_type()`. Then you could write `output_dtype=[x]`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-386721846,https://api.github.com/repos/pydata/xarray/issues/1699,386721846,MDEyOklzc3VlQ29tbWVudDM4NjcyMTg0Ng==,6213168,2018-05-04T20:18:48Z,2018-05-04T20:21:10Z,MEMBER,"The key thing is that for most people it would be extremely elegant and practical to be able to duck-type wrappers around numpy, scipy, and numba kernels that automagically work with Variable, DataArray, and Dataset (see my example above).
You'll agree on how ugly my 1-liner above would become:
```
def myfunc(x):
if isinstance(x, xarray.Dataset):
dtype = x.dtypes
else: # DataArray and Variable
dtype = x.dtype
return apply_ufunc(numpy_kernel, x, dask='parallelized', output_dtypes=[dtype])
```
If you don't like ``Dataset.dtype``, then maybe we could add both ``Dataset.dtypes`` and ``DataArray.dtypes`` (which would be just an alias to ``DataArray.dtype``)? I still like the former more though - I find it less confusing.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-384134364,https://api.github.com/repos/pydata/xarray/issues/1699,384134364,MDEyOklzc3VlQ29tbWVudDM4NDEzNDM2NA==,1217238,2018-04-25T01:42:36Z,2018-04-25T01:42:36Z,MEMBER,"I'm not sure about adding `Dataset.dtype`. Certainly `Dataset.dtypes` returning a dict would make sense -- that would match how pandas defines `DataFrame.dtypes`.
Anyways, I agree that `output_dtypes=[{var1: t1, var2: t2, ...}, ...]` is most natural, because it matches the structure of the outputs.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-384073275,https://api.github.com/repos/pydata/xarray/issues/1699,384073275,MDEyOklzc3VlQ29tbWVudDM4NDA3MzI3NQ==,6213168,2018-04-24T20:42:57Z,2018-04-24T20:42:57Z,MEMBER,"@shoyer that seems counter-intuitive for me - you are returning two datasets after all.
If we go with the ``list(dict)`` notation, we could also add a ``Dataset.dtype`` property, which (coherently with dims and chunks) would return a dict. This would be very handy as, in 99% of the times, people will want to write:
```
def myfunc(x):
return apply_ufunc(numpy_kernel, x, dask='parallelized', output_dtypes=[x.dtype])
```
which would magically work both when x is a DataArray and when it's a Dataset
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812
https://github.com/pydata/xarray/issues/1699#issuecomment-342670406,https://api.github.com/repos/pydata/xarray/issues/1699,342670406,MDEyOklzc3VlQ29tbWVudDM0MjY3MDQwNg==,1217238,2017-11-08T00:32:45Z,2017-11-08T00:32:45Z,MEMBER,"Yes, I like this. Though it's worth considering whether the syntax should reverse the list/dict nesting, e.g., `output_dtypes={var1: [t1, ...], var2: [t2, ...], ...}`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,272004812