home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 787732195 and user = 14371165 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

  • Illviljan · 4 ✖

issue 1

  • Add dataset line plot · 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
778596102 https://github.com/pydata/xarray/pull/4820#issuecomment-778596102 https://api.github.com/repos/pydata/xarray/issues/4820 MDEyOklzc3VlQ29tbWVudDc3ODU5NjEwMg== Illviljan 14371165 2021-02-13T10:25:13Z 2021-02-13T10:25:13Z MEMBER

I think this is ready now.

I'm not super happy with the docs, I think copying makes sense but it doesn't match completely at the moment. I was thinking that can be solved by rewriting the dataarray version in a smarter way.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add dataset line plot 787732195
775390720 https://github.com/pydata/xarray/pull/4820#issuecomment-775390720 https://api.github.com/repos/pydata/xarray/issues/4820 MDEyOklzc3VlQ29tbWVudDc3NTM5MDcyMA== Illviljan 14371165 2021-02-08T19:34:46Z 2021-02-08T19:35:57Z MEMBER

I think making the dataset plots a thin wrapper for the dataarray plot functions is the way to go. I think most things for the lineplot works as intended now. I'm not sure about the decorator though. It's a bit too simple compared to _dsplot at the moment.

Supporting linewidth in plots should be possible but this is for a future pr I think. I did a small proof of concept here: ```python def _lineplot(ds, x, y, hue, linewidth): if len(ds[y].dims) > 3: raise NotImplementedError("too many dims.")

fig, ax = plt.subplots(1, 1)
for i, width in enumerate(ds[linewidth]):
    # Filter along linewidth:
    dsi = ds.isel(**{linewidth: i})

    # Values to plot:
    xplt = dsi[x]

    # if xplt has no dims:
    (xdim,) = xplt.dims
    (huedim,) = dsi[hue].dims
    yplt = dsi[y].transpose(..., xdim, huedim)

    # Set plot properties:
    len_lines = len(ds[hue])
    cmap = plt.get_cmap("viridis", len_lines)
    colors = plt.cycler(color=cmap(np.arange(len_lines)))
    lw = plt.cycler(lw=[1 + i * 3])
    ax.set_prop_cycle(colors * lw)

    # p = xr.broadcast(xplt, yplt)
    plt.plot(xplt, yplt, label=width.values)
    plt.legend()

# ax.plot doesn't return a mappable that fig.colorbar can parse. Create
# one and return that one instead:
norm = plt.Normalize(vmin=ds[hue].min(), vmax=ds[hue].max())
primitive = plt.cm.ScalarMappable(cmap=plt.get_cmap("viridis"), norm=norm)
fig.colorbar(mappable=primitive)

return fig, ax

ds = xr.tutorial.scatter_example_dataset() ds1 = ds.sel(z=0) _lineplot(ds=ds1, x="y", y="A", hue="w", linewidth="x") ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add dataset line plot 787732195
767765210 https://github.com/pydata/xarray/pull/4820#issuecomment-767765210 https://api.github.com/repos/pydata/xarray/issues/4820 MDEyOklzc3VlQ29tbWVudDc2Nzc2NTIxMA== Illviljan 14371165 2021-01-26T19:12:16Z 2021-01-26T19:12:16Z MEMBER

Added a variant using dataarray, it's much cleaner although the wrappers had to be redone. I think we can move ds.plot.scatter to the dataarray side as well.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add dataset line plot 787732195
766095911 https://github.com/pydata/xarray/pull/4820#issuecomment-766095911 https://api.github.com/repos/pydata/xarray/issues/4820 MDEyOklzc3VlQ29tbWVudDc2NjA5NTkxMQ== Illviljan 14371165 2021-01-23T15:26:42Z 2021-01-23T15:26:42Z MEMBER

I've added a little todo list of things I've noticed, @mathause. Did you have something else in mind?

I wouldn't mind some more examples and matplotlib solutions if anyone has done any nice looking line plots with xarray before.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add dataset line plot 787732195

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