issue_comments
12 rows where issue = 797302408 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Basic curvefit implementation · 12 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
811250515 | https://github.com/pydata/xarray/pull/4849#issuecomment-811250515 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDgxMTI1MDUxNQ== | dcherian 2448579 | 2021-03-31T16:55:47Z | 2021-03-31T16:55:47Z | MEMBER | Thanks @slevang. Sorry for the delay! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
810635014 | https://github.com/pydata/xarray/pull/4849#issuecomment-810635014 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDgxMDYzNTAxNA== | slevang 39069044 | 2021-03-30T23:04:52Z | 2021-03-30T23:04:52Z | CONTRIBUTOR | I think so. I pushed a merge commit to get this up to date with the current release. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
770131469 | https://github.com/pydata/xarray/pull/4849#issuecomment-770131469 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3MDEzMTQ2OQ== | pep8speaks 24736507 | 2021-01-30T01:28:23Z | 2021-03-30T22:35:03Z | NONE | Hello @slevang! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: Comment last updated at 2021-03-30 22:35:02 UTC |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
810486127 | https://github.com/pydata/xarray/pull/4849#issuecomment-810486127 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDgxMDQ4NjEyNw== | TomNicholas 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 } |
Basic curvefit implementation 797302408 | |
782731258 | https://github.com/pydata/xarray/pull/4849#issuecomment-782731258 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc4MjczMTI1OA== | slevang 39069044 | 2021-02-20T18:46:55Z | 2021-02-20T18:46:55Z | CONTRIBUTOR | Thanks for the review @dcherian! The latest commit has been refactored with a couple helper functions and associated tests, and any steps that served no purpose other than consistency with If you can think of any more specific test cases that should be included, happy to add them. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
777602757 | https://github.com/pydata/xarray/pull/4849#issuecomment-777602757 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3NzYwMjc1Nw== | slevang 39069044 | 2021-02-11T16:02:54Z | 2021-02-11T16:02:54Z | CONTRIBUTOR | I've been playing around with this some more, and found the performance to be much better using a process-heavy dask scheduler. For example: ```python import xarray as xr import numpy as np import time import dask def exponential(x, a, xc): return np.exp((x - xc) / a) x = np.arange(-5, 5, 0.001) t = np.arange(-5, 5, 0.01) X, T = np.meshgrid(x, t) Z1 = np.random.uniform(low=-5, high=5, size=X.shape) Z2 = exponential(Z1, 3, X) + np.random.normal(scale=0.1, size=Z1.shape) ds = xr.Dataset( data_vars=dict(var1=(["t", "x"], Z1), var2=(["t", "x"], Z2)), coords={"t": t, "x": x}, ) ds = ds.chunk({'x':10}) def test_fit(): start = time.time() fit = ds.var2.curvefit( coords=ds.var1, func=exponential, reduce_dim="t", ).compute() print(f'Fitting time: {time.time() - start:.2f}s') with dask.config.set(scheduler='threads'):
test_fit()
with dask.config.set(scheduler='processes'):
test_fit()
with dask.distributed.Client() as client:
test_fit()
with dask.distributed.Client(n_workers=8, threads_per_worker=1) as client:
test_fit()
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
772874760 | https://github.com/pydata/xarray/pull/4849#issuecomment-772874760 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3Mjg3NDc2MA== | slevang 39069044 | 2021-02-03T22:37:50Z | 2021-02-03T22:37:50Z | CONTRIBUTOR | Added some checks that will raise errors if Also added minimal tests, but these should probably be expanded. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
771907303 | https://github.com/pydata/xarray/pull/4849#issuecomment-771907303 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3MTkwNzMwMw== | slevang 39069044 | 2021-02-02T19:19:01Z | 2021-02-02T19:19:01Z | CONTRIBUTOR | Added a couple usage examples in the docs, including one that replicates the scipy example of fitting multiple peaks. Because of the wrapper function and variable args, this requires supplying |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
771320891 | https://github.com/pydata/xarray/pull/4849#issuecomment-771320891 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3MTMyMDg5MQ== | slevang 39069044 | 2021-02-02T03:12:41Z | 2021-02-02T03:12:41Z | CONTRIBUTOR | Some more progress here.
The best way to specify the fitting coordinates is a bit tricky to figure out. My original use case for this was needing to fit a relationship between two time/lat/lon dataarrays with the fit done over all time. But probably a more common use would be to just fit a curve over one or two dimensions that already exist in your data. So it would be great to handle these possibilities seamlessly. What I've settled on for now is a Fit a 1d function in time, returns parameters with dims (x, y)da.curvefit(coords='time', ...) Fit a 2d function in space, returns parameters with dims (t)da.curvefit(coords=['x', 'y'], ...) Fit a 1d function with another 3d dataarray and aggregate over time, returns parameters with dims (x, y)da.curvefit(coords=da1, reduce_dim='time', ...)
Will eventually need to add tests and improve docs and examples. Tests especially I could use some help on. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
770410638 | https://github.com/pydata/xarray/pull/4849#issuecomment-770410638 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3MDQxMDYzOA== | TomNicholas 35968931 | 2021-01-31T16:41:59Z | 2021-01-31T16:41:59Z | MEMBER |
You're right! My bad. The consistency with polyfit looks good.
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 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 } |
Basic curvefit implementation 797302408 | |
770395357 | https://github.com/pydata/xarray/pull/4849#issuecomment-770395357 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3MDM5NTM1Nw== | slevang 39069044 | 2021-01-31T14:59:12Z | 2021-01-31T14:59:12Z | CONTRIBUTOR |
I think the way I configured things now does replicate the polyfit results. For example: ```python ds = xr.tutorial.open_dataset('air_temperature') ds['air2'] = ds.air.copy() ds.polyfit(dim='time', deg=2) <xarray.Dataset>
Dimensions: (degree: 3, lat: 25, lon: 53)
Coordinates:
* degree (degree) int64 2 1 0
* lat (lat) float64 75.0 72.5 70.0 ... 20.0 17.5 15.0
* lon (lon) float64 200.0 202.5 205.0 ... 327.5 330.0
Data variables:
air_polyfit_coefficients (degree, lat, lon) float64 -1.162e-32 ... 1.13...
air2_polyfit_coefficients (degree, lat, lon) float64 -1.162e-32 ... 1.14...
ds.curvefit(x=ds.time, dim='time', func=square) <xarray.Dataset>
Dimensions: (lat: 25, lon: 53, param: 3)
Coordinates:
* lat (lat) float32 75.0 72.5 70.0 ... 20.0 17.5 15.0
* lon (lon) float32 200.0 202.5 205.0 ... 327.5 330.0
* param (param) <U1 'a' 'b' 'c'
Data variables:
air_curvefit_coefficients (param, lat, lon) float64 -1.162e-32 ... 1.13...
air2_curvefit_coefficients (param, lat, lon) float64 -1.162e-32 ... 1.14...
Yeah this would be good. Should be easy to look for default values in the function itself using
Looks like this could be possible with a call to |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Basic curvefit implementation 797302408 | |
770388498 | https://github.com/pydata/xarray/pull/4849#issuecomment-770388498 | https://api.github.com/repos/pydata/xarray/issues/4849 | MDEyOklzc3VlQ29tbWVudDc3MDM4ODQ5OA== | TomNicholas 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
2) Initial guesses for each fit parameter. At the moment the user has to pass an ordered array of initial guesses through like
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 } |
Basic curvefit implementation 797302408 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 4