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/4849#issuecomment-810486127,https://api.github.com/repos/pydata/xarray/issues/4849,810486127,MDEyOklzc3VlQ29tbWVudDgxMDQ4NjEyNw==,35968931,2021-03-30T18:34:38Z,2021-03-30T18:34:38Z,MEMBER,This seems ready to be merged?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,797302408 https://github.com/pydata/xarray/pull/4849#issuecomment-770410638,https://api.github.com/repos/pydata/xarray/issues/4849,770410638,MDEyOklzc3VlQ29tbWVudDc3MDQxMDYzOA==,35968931,2021-01-31T16:41:59Z,2021-01-31T16:41:59Z,MEMBER,"> I think the way I configured things now does replicate the polyfit results. You're right! My bad. The consistency with polyfit looks good. > Looks like this could be possible with a call to ravel Oh nice! That looks like it would allow for ND functions fit to ND data. It looks like there is a [dask version of ravel](https://docs.dask.org/en/latest/array-api.html#dask.array.ravel) which might be useful. (And judging by the comments on that blog post I think @StanczakDominik would appreciate this feature too!)","{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 1, ""rocket"": 0, ""eyes"": 0}",,797302408 https://github.com/pydata/xarray/pull/4849#issuecomment-770388498,https://api.github.com/repos/pydata/xarray/issues/4849,770388498,MDEyOklzc3VlQ29tbWVudDc3MDM4ODQ5OA==,35968931,2021-01-31T14:12:12Z,2021-01-31T14:12:12Z,MEMBER,"This is great, thanks for submitting this! I just had a go with it, and it worked nicely. I have a couple of suggestions for improving it though: 1) Different fit coefficients as differently-named variables in the output, rather than indexed with a coordinate. This would then be consistent with `Dataset.polyfit`, which returns a set of different variables `[var]_polyfit_coefficients`. We could also get the names from the names of the keyword args when inspecting the function, and if it fails to get names just call them like `param1_fit_coefficients`, `param2_fit_coefficients` etc. What you have now works nicely though, so perhaps you could just reorganise the result before returning, like `Dataset.polyfit` does? 2) Initial guesses for each fit parameter. At the moment the user has to pass an ordered array of initial guesses through like ```python da.curvefit(x=da.x, dim='x', func=linear, kwargs={'p0': [m_guess, c_guess]}) ``` but it would be nicer to just pass them as a dictionary like ```python da.curvefit(x=da.x, dim='x', func=linear, initial_guess={'m': m_guess, 'c': c_guess}) ``` or even have the guesses read from the function definition maybe? i.e. ```python def linear(x, m=m_guess, c=c_guess): return m*x + c ``` 3) (Stretch goal) Ability to fit >1D functions, e.g. fit a 2D gaussian to find a peak in a 2D image. But if we get the API right then this could be left to a later PR. Also, the whole argument inspection thing probably deserves a few dedicated tests, in addition to testing the fitting functionality.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,797302408