home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 499477363 and user = 81219 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • huard · 6 ✖

issue 1

  • Implement polyfit? · 6 ✖

author_association 1

  • CONTRIBUTOR 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
566220633 https://github.com/pydata/xarray/issues/3349#issuecomment-566220633 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NjIyMDYzMw== huard 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
}
  Implement polyfit? 499477363
566070483 https://github.com/pydata/xarray/issues/3349#issuecomment-566070483 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NjA3MDQ4Mw== huard 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
}
  Implement polyfit? 499477363
565733023 https://github.com/pydata/xarray/issues/3349#issuecomment-565733023 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTczMzAyMw== huard 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
}
  Implement polyfit? 499477363
565608876 https://github.com/pydata/xarray/issues/3349#issuecomment-565608876 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTYwODg3Ng== huard 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
}
  Implement polyfit? 499477363
565504692 https://github.com/pydata/xarray/issues/3349#issuecomment-565504692 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTUwNDY5Mg== huard 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
}
  Implement polyfit? 499477363
565452240 https://github.com/pydata/xarray/issues/3349#issuecomment-565452240 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTQ1MjI0MA== huard 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
}
  Implement polyfit? 499477363

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 636.263ms · About: xarray-datasette