home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 587048587 and user = 10194086 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

  • mathause · 3 ✖

issue 1

  • weighted operations: performance optimisations · 3 ✖

author_association 1

  • MEMBER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
630387515 https://github.com/pydata/xarray/issues/3883#issuecomment-630387515 https://api.github.com/repos/pydata/xarray/issues/3883 MDEyOklzc3VlQ29tbWVudDYzMDM4NzUxNQ== mathause 10194086 2020-05-18T19:21:55Z 2020-10-27T14:27:50Z MEMBER

```python %load_ext line_profiler

import numpy as np import xarray as xr

from xarray.core.weighted import Weighted as w

shape_weights = (1000, 1000) shape_data = (1000, 1000, 10) add_nans = False

def lprun_weighted(shape_weights, shape_data, add_nans, skipna=None):

weights = xr.DataArray(np.random.randn(*shape_weights))

data = np.random.randn(*shape_data)

# add approximately 25 % NaNs
if add_nans:
    c = int(data.size * 0.25)
    data.ravel()[np.random.choice(data.size, c, replace=False)] = np.NaN

data = xr.DataArray(data)


return data.weighted(weights).mean(skipna=skipna)

%lprun -f w._reduce -f w._weighted_mean -f w._sum_of_weights -f w._weighted_sum -f w.init -f lprun_weighted -u 1e-03 lprun_weighted(shape_weights, shape_data, add_nans, skipna=None)

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  weighted operations: performance optimisations 587048587
633918109 https://github.com/pydata/xarray/issues/3883#issuecomment-633918109 https://api.github.com/repos/pydata/xarray/issues/3883 MDEyOklzc3VlQ29tbWVudDYzMzkxODEwOQ== mathause 10194086 2020-05-26T09:33:40Z 2020-05-26T09:34:25Z MEMBER

weighted(weights).mean(skipna=True) calls

https://github.com/pydata/xarray/blob/d1f7cb8fd95d588d3f7a7e90916c25747b90ad5a/xarray/core/weighted.py#L143

and

https://github.com/pydata/xarray/blob/d1f7cb8fd95d588d3f7a7e90916c25747b90ad5a/xarray/core/weighted.py#L130

da.fillna(0.0) in turn calls where(null(data), other). Thus null/ notnull is called twice. This could be optimized by doing self.null = obj.null() in __init__(...). This might also allow self.any_null = self.null.any() to skip NaN handling if there are none. However, this needs more thinking if a Dataset is passed. Probably overkill but leaving this here for reference.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  weighted operations: performance optimisations 587048587
603717924 https://github.com/pydata/xarray/issues/3883#issuecomment-603717924 https://api.github.com/repos/pydata/xarray/issues/3883 MDEyOklzc3VlQ29tbWVudDYwMzcxNzkyNA== mathause 10194086 2020-03-25T08:49:45Z 2020-03-25T08:49:45Z MEMBER

maybe relevant: #1995

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  weighted operations: performance optimisations 587048587

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