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/1074#issuecomment-261316492,https://api.github.com/repos/pydata/xarray/issues/1074,261316492,MDEyOklzc3VlQ29tbWVudDI2MTMxNjQ5Mg==,1217238,2016-11-17T17:44:21Z,2016-11-17T17:44:21Z,MEMBER,"@burnpanck I missed your comments from a few weeks ago. Yes, please do make PRs to update the docs.
I am OK with adding `DataArray.apply` for consistency and discoverability, even if it's basically an alias of `DataArray.pipe`. And if we add a `raw` argument I suppose it should probably default to `raw=False` for both `.apply` methods.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,186868181
https://github.com/pydata/xarray/issues/1074#issuecomment-258327585,https://api.github.com/repos/pydata/xarray/issues/1074,258327585,MDEyOklzc3VlQ29tbWVudDI1ODMyNzU4NQ==,1217238,2016-11-04T02:10:04Z,2016-11-04T02:10:04Z,MEMBER,"We could try to get in a simple version of this before #964.
My only concern is that the functionality here is slightly different from `Dataset.apply`, which takes functions that map `DataArray -> DataArray` or `DataArray -> numpy.ndarray`.
For `DataArray.apply`, we really want something that maps `numpy.ndarray -> numpy.ndarray`, which is now inconsistent. I guess we could pass the original DataArray to the function, but we already have a `.pipe` method for that.
This is also a concern for #964, because any new `xarray.apply` function would have similar consistency issues with `Dataset.apply`.
Two possible solutions, neither of which is fully satisfying:
- New keyword argument `raw` to `Dataset.apply`, defaulting to `False`. Works like the `raw` argument to `DataFrame.apply`. If `raw=True`, then `Dataset.apply` passes unlabeled arrays to the provided function, like `DataArray.apply`. This makes the difference a little less jarring.
- Pick a new name for one of these uses of `apply`, e.g., `apply_raw` for this use case. `xarray.apply_raw` or `DataArray.apply_raw` is pretty verbose, though.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,186868181