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/pull/6548#issuecomment-1118973967,https://api.github.com/repos/pydata/xarray/issues/6548,1118973967,IC_kwDOAMm_X85CsjAP,5635139,2022-05-05T19:33:53Z,2022-05-05T19:33:53Z,MEMBER,Thanks @headtr1ck !,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1221848774
https://github.com/pydata/xarray/pull/6548#issuecomment-1118960785,https://api.github.com/repos/pydata/xarray/issues/6548,1118960785,IC_kwDOAMm_X85CsfyR,2448579,2022-05-05T19:17:24Z,2022-05-05T19:17:24Z,MEMBER,"Forcing the user to be explicit reduces bugs and user support requests :) so we like to do that.
Thanks again @headtr1ck this is a great PR!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1221848774
https://github.com/pydata/xarray/pull/6548#issuecomment-1115117344,https://api.github.com/repos/pydata/xarray/issues/6548,1115117344,IC_kwDOAMm_X85Cd1cg,2448579,2022-05-02T16:52:59Z,2022-05-02T16:52:59Z,MEMBER,"Nice this looks like an improvement for everything other than dask arrays with only 100 elements, which is not a good use-case for dask.
I was slightly concerned that the recrusive algorithm wouldn't work well with dask but it does seem to work better.
``` python
def other_polyval(coord, coeffs, degree_dim=""degree""):
x = coord.data
deg_coord = coeffs[degree_dim]
N = int(deg_coord.max()) + 1
lhs = xr.DataArray(
np.stack([x ** (N - 1 - i) for i in range(N)], axis=1),
dims=(coord.name, degree_dim),
coords={
coord.name: coord.data,
degree_dim: np.arange(deg_coord.max() + 1)[::-1],
},
)
return xr.dot(lhs, coeffs, dims=degree_dim)
coeffs = xr.DataArray(np.random.randn(2), dims=""degree"")
da = xr.DataArray(dask.array.random.random((10**6), chunks=(10000)), dims=(""x""))
print(len(da.data.dask))
print(len(xr.polyval(da, coeffs).data.dask))
print(len(other_polyval(da, coeffs).data.dask))
```
```
100
502
1005
```
","{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 1, ""eyes"": 0}",,1221848774
https://github.com/pydata/xarray/pull/6548#issuecomment-1114366068,https://api.github.com/repos/pydata/xarray/issues/6548,1114366068,IC_kwDOAMm_X85Ca-B0,5635139,2022-05-01T23:24:56Z,2022-05-01T23:24:56Z,MEMBER,"> Benchmark did not succeed since the inputs are not compatible with the old algorith...
> Do we change it such that it is compatible?
If you're confident this is faster and it's not a trivial amount of work to adjust them, I would leave it...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1221848774
https://github.com/pydata/xarray/pull/6548#issuecomment-1114054278,https://api.github.com/repos/pydata/xarray/issues/6548,1114054278,IC_kwDOAMm_X85CZx6G,5635139,2022-04-30T21:07:10Z,2022-04-30T21:07:10Z,MEMBER,"This looks like excellent code @headtr1ck , especially so for a first PR. Welcome!
> so I used a ""hack"" of adding an 0-valued DataArray/Dataset.
I think it's fine to do the hack and reference that issue; we can clean it up then (though if others have ideas then great).
> I had to add a copy(deep=True) since the broadcast returned a read-only DataArray. Any better ideas?
IIRC we generally leave this up to the caller (and generally discourage mutation).
---
Someone who knows better should review the algo & opine on the datetime issue; I agree I'm not sure whether we need to support them.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1221848774