home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "MEMBER" and issue = 797302408 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, created_at (date), updated_at (date)

user 2

  • TomNicholas 3
  • dcherian 1

issue 1

  • Basic curvefit implementation · 4 ✖

author_association 1

  • MEMBER · 4 ✖
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
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
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

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 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
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 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
}
  Basic curvefit implementation 797302408

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 11.901ms · About: xarray-datasette