home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "CONTRIBUTOR", issue = 800118528 and user = 12862013 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

  • mark-boer · 2 ✖

issue 1

  • doctest failure with numpy 1.20 · 2 ✖

author_association 1

  • CONTRIBUTOR · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
773647435 https://github.com/pydata/xarray/issues/4858#issuecomment-773647435 https://api.github.com/repos/pydata/xarray/issues/4858 MDEyOklzc3VlQ29tbWVudDc3MzY0NzQzNQ== mark-boer 12862013 2021-02-04T22:33:45Z 2021-02-04T22:34:30Z CONTRIBUTOR

My suggestion is: 1. replace the example with arr.pad(x=1, constant_values=1.23456789) and mention that the float is cast to int (or would you leave the example away?) 2. open a new issue to discuss the issue of assigning float to int

I agree, I think that would be a good solutions for now, I think replacing the example is fine. Maybe we could even open a new issue, to discuss how xarray functions handle np.nan.

Is dask.array.pad gonna handle casting the same way? It would be strange if the cast to float happens, depending on the underlying array type. But that discussion should probably happen in the newly opened issue ;-)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  doctest failure with numpy 1.20 800118528
773240852 https://github.com/pydata/xarray/issues/4858#issuecomment-773240852 https://api.github.com/repos/pydata/xarray/issues/4858 MDEyOklzc3VlQ29tbWVudDc3MzI0MDg1Mg== mark-boer 12862013 2021-02-04T11:33:32Z 2021-02-04T11:34:36Z CONTRIBUTOR

Hi, we had a similar discussion in de #3596, xarray makes a distinction between np.nan and xarray.dtypes.NaN. The current behaviour is consistent with that of other xarray functions such as shift. Though, I am personally not a big fan of this distinction.

Check e.g. this comment: https://github.com/pydata/xarray/pull/3596#discussion_r388612638

The example I posted in this comment: ```

da = xr.DataArray(np.arange(9).reshape(3,3), dims=("x", "y")) da.shift(x=1, fill_value=np.nan) array([[-9223372036854775808, -9223372036854775808, -9223372036854775808], [ 0, 1, 2], [ 3, 4, 5]]) Dimensions without coordinates: x, y

da.rolling(x=3).construct("new_axis", stride=3, fill_value=np.nan) <xarray.DataArray (x: 1, y: 3, new_axis: 3)> array([[[-9223372036854775808, -9223372036854775808, 0], [-9223372036854775808, -9223372036854775808, 1], [-9223372036854775808, -9223372036854775808, 2]]]) Dimensions without coordinates: x, y, new_axis ```

Hmm, so numpy changed its behaviour? Then this example, should probably also fail in numpy 1.20.

On a side note: I am not a big fan of the example in the doctest, it displays an edge case, which is not unique to pad.

I think the nicest solution would be to make the usage xarray.dtypes.NaN and np.nan equivalent. But this would require changes in all xarray functions that take some kind of fill_value.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  doctest failure with numpy 1.20 800118528

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