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-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-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-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