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/1838#issuecomment-358851474,https://api.github.com/repos/pydata/xarray/issues/1838,358851474,MDEyOklzc3VlQ29tbWVudDM1ODg1MTQ3NA==,1217238,2018-01-19T02:50:13Z,2018-01-19T02:50:13Z,MEMBER,"We do this for two reasons: - bottleneck's aggregation functions like `bottleneck.nansum()` don't have a `dtype` argument, so passing on a dtype argument causes an error to be raised. - If you call a numpy function like `numpy.sum()` on an xarray object, it calls the appropriate method with all keyword arguments, e.g., `numpy.sum(xarray_obj)` -> `xarray_obj.sum(axis=None, dtype=None, out=None)`. What we should probably do here instead of ignoring `dtype` and `out` entirely is to look at their values: - If `dtype` is not None, use numpy's aggregation function instead of bottleneck's. - If `out` is not None, raise an error.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289790965 https://github.com/pydata/xarray/issues/1838#issuecomment-358847017,https://api.github.com/repos/pydata/xarray/issues/1838,358847017,MDEyOklzc3VlQ29tbWVudDM1ODg0NzAxNw==,6815844,2018-01-19T02:21:39Z,2018-01-19T02:22:06Z,MEMBER,"I notice here https://github.com/pydata/xarray/blob/f3deb2f2495220af819021b199a5305b0d62ef36/xarray/core/duck_array_ops.py#L177-L181 we removed `dtype` arguments from reduce methods, but I'm not sure why. This might be a bug. As a temporal solution, ```python da.reduce(np.sum, dtype=""i4"") ``` preserves dtype.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289790965