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/3349#issuecomment-566220633,https://api.github.com/repos/pydata/xarray/issues/3349,566220633,MDEyOklzc3VlQ29tbWVudDU2NjIyMDYzMw==,81219,2019-12-16T20:04:44Z,2019-12-16T20:04:44Z,CONTRIBUTOR,@clyne Let me rephrase my question: how do you feel about xarray providing a polyfit/polyval implementation essentially duplicating GeoCat's implementation ? ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499477363
https://github.com/pydata/xarray/issues/3349#issuecomment-566070483,https://api.github.com/repos/pydata/xarray/issues/3349,566070483,MDEyOklzc3VlQ29tbWVudDU2NjA3MDQ4Mw==,81219,2019-12-16T13:53:27Z,2019-12-16T13:53:27Z,CONTRIBUTOR,"@maboualidev Is your objective to integrate the GeoCat implementation into xarray or keep it standalone ?
On my end, I'll submit a PR to add support for non-standard calendars to `xarray.core.missing.get_clean_interp`, which you'd then be able to use to get x values from coordinates. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499477363
https://github.com/pydata/xarray/issues/3349#issuecomment-565733023,https://api.github.com/repos/pydata/xarray/issues/3349,565733023,MDEyOklzc3VlQ29tbWVudDU2NTczMzAyMw==,81219,2019-12-14T16:43:14Z,2019-12-14T16:43:14Z,CONTRIBUTOR,"@maboualidev Nice ! I see you're storing the residuals in the DataArray attributes. From my perspective, it would be useful to have those directly as DataArrays. Thoughts ?
So it looks like there are multiple inspirations to draw from. Here is what I could gather.
- `xscale.signal.fitting.polyfit(obj, deg=1, dim=None, coord=None)` supports chunking along the fitting dimension using `dask.array.linalg.lstsq`. No explicit missing data handling.
- `xyzpy.signal.xr_polyfit(obj, dim, ix=None, deg=0.5, poly='hermite')` applies `np.polynomial.polynomial.polyfit` using `xr.apply_ufunc` along dim with the help of `numba`. Also supports other types of polynomial (legendre, chebyshev, ...). Missing values are masked out 1D wise.
- `geocat.comp.ndpolyfit(x: Iterable, y: Iterable, deg: int, axis: int = 0, **kwargs) -> (xr.DataArray, da.Array)` reorders the array to apply `np.polyfit` along dim, returns the full outputs (residuals, rank, etc) as DataArray attributes. Missing values are masked out in bulk if possible, 1D-wise otherwise.
There does not seem to be matching `polyval` implementations for any of those nor support for indexing along a time dimension with a non-standard calendar.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499477363
https://github.com/pydata/xarray/issues/3349#issuecomment-565608876,https://api.github.com/repos/pydata/xarray/issues/3349,565608876,MDEyOklzc3VlQ29tbWVudDU2NTYwODg3Ng==,81219,2019-12-13T21:07:39Z,2019-12-13T21:07:39Z,CONTRIBUTOR,"My current implementation is pretty naive. It's just calling numpy.polyfit using dask.array.apply_along_axis. Happy to put that in a PR as a starting point, but there are a couple of questions I had:
* How to return the full output (residuals, rank, singular_values, rcond) ? A tuple of dataarrays or a dataset ?
* Do we want to use the dask least square functionality to allow for chunking within the x dimension ? Then it's not just a simple wrapper around polyfit.
* Should we use np.polyfit or np.polynomial.polynomial.polyfit ?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499477363
https://github.com/pydata/xarray/issues/3349#issuecomment-565504692,https://api.github.com/repos/pydata/xarray/issues/3349,565504692,MDEyOklzc3VlQ29tbWVudDU2NTUwNDY5Mg==,81219,2019-12-13T16:20:19Z,2019-12-13T16:20:19Z,CONTRIBUTOR,"Thanks, it seems to work !","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499477363
https://github.com/pydata/xarray/issues/3349#issuecomment-565452240,https://api.github.com/repos/pydata/xarray/issues/3349,565452240,MDEyOklzc3VlQ29tbWVudDU2NTQ1MjI0MA==,81219,2019-12-13T14:04:23Z,2019-12-13T14:04:23Z,CONTRIBUTOR,"Started to work on this and facing some issues with the x-coordinate when its a datetime. For standard calendars, I can use `pd.to_numeric(da.time)`, but for non-standard calendars, it's not clear how to go ahead. If I use `xr.coding.times.encode_cf_datetime(coord)`, the coefficients we'll find will only make sense in the `polyval` function if we use the same time encoding.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,499477363