home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where author_association = "NONE" and user = 25172489 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 6

  • Coordinates have wrong number of elements after a Dataset/DataArray is split by np.split() 2
  • Plotting empty DataArray oddly raises ImportError 2
  • Support non-string dimension/variable names 1
  • Align typing of dimension inputs 1
  • polyval doesn't bind the output type 1
  • Selecting variables from Dataset with view on dict keys is of type DataArray 1

user 1

  • derhintze · 8 ✖

author_association 1

  • NONE · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1426097606 https://github.com/pydata/xarray/issues/7519#issuecomment-1426097606 https://api.github.com/repos/pydata/xarray/issues/7519 IC_kwDOAMm_X85VAIXG derhintze 25172489 2023-02-10T17:07:25Z 2023-02-10T17:07:25Z NONE

The only obvious difference being that one overload annotates self, while the other doesn't. But apart from this, the annotations look straightforward (and correct) to me.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting variables from Dataset with view on dict keys is of type DataArray 1579956621
1324673769 https://github.com/pydata/xarray/issues/7312#issuecomment-1324673769 https://api.github.com/repos/pydata/xarray/issues/7312 IC_kwDOAMm_X85O9Orp derhintze 25172489 2022-11-23T07:58:33Z 2022-11-23T07:58:33Z NONE

note that pylance says the same: Type of "result" is "Dataset | DataArray"

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  polyval doesn't bind the output type 1461231016
1277103850 https://github.com/pydata/xarray/issues/7156#issuecomment-1277103850 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MHw7q derhintze 25172489 2022-10-13T06:40:59Z 2022-10-13T06:40:59Z NONE

This is raised by matplotlib, not pandas. Personally, I prefer aligning with upstream projects, so I'd pick that very same error.

One could argue that it's a ValueError in the sense that there's no data to plot, which is like an invalid value. But I also could see why they picked TypeError, because one could have non-numeric (but not empty) data. But yeah, this is nitpicking, I suppose 😆

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1275752988 https://github.com/pydata/xarray/issues/7156#issuecomment-1275752988 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MCnIc derhintze 25172489 2022-10-12T08:01:31Z 2022-10-12T08:01:31Z NONE

👁️ @headtr1ck

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 2
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1269679657 https://github.com/pydata/xarray/issues/7094#issuecomment-1269679657 https://api.github.com/repos/pydata/xarray/issues/7094 IC_kwDOAMm_X85LrcYp derhintze 25172489 2022-10-06T09:30:30Z 2022-10-06T09:30:44Z NONE

Iterables (implement __iter__) not only aren't ordered, but also neither have a length (implement __len__ nor allow for membership tests (implement __contains__). So in these cases one needs to use Sequences, too; in addition to cases where order matters.

See https://docs.python.org/3.9/library/collections.abc.html#collections-abstract-base-classes

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Align typing of dimension inputs 1388372090
979759002 https://github.com/pydata/xarray/issues/2292#issuecomment-979759002 https://api.github.com/repos/pydata/xarray/issues/2292 IC_kwDOAMm_X846Ze-a derhintze 25172489 2021-11-26T07:48:21Z 2021-11-26T07:52:42Z NONE

Would like to chime in that we use a similar approach as in the last comment of @DerWeh . But we extend this by overloading the __str__ method of the enum.Enum base class, and implement a Dimension base class to use for our enum dimensions:

``` class Dimension(str, enum.Enum): """Base class for all dimension enums

It is of type string because this is needed for xarray.
"""

def __str__(self):
    return type(self).__name__ + "." + self.name

```

Using this the xarray output is more consistent:

```

class CoordId(Dimension): ... LAT = 'lat' ... LON = 'lon' ... xr.DataArray( ... data=np.arange(3 * 2).reshape(3, 2), ... coords={CoordId.LAT: [1, 2, 3], CoordId.LON: [7, 8]}, ... dims=[CoordId.LAT, CoordId.LON], ... ) <xarray.DataArray (CoordId.LAT: 3, CoordId.LON: 2)> array([[0, 1], [2, 3], [4, 5]]) Coordinates: * CoordId.LAT (CoordId.LAT) int64 1 2 3 * CoordId.LON (CoordId.LON) int64 7 8 ```

We then have deserialization code, that re-creates enum members when reading NetCDF files with corresponding dimensions (and coordinates). Access to coordinates works with enum members as well as their string value.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Support non-string dimension/variable names 341643235
917833440 https://github.com/pydata/xarray/issues/5779#issuecomment-917833440 https://api.github.com/repos/pydata/xarray/issues/5779 IC_kwDOAMm_X842tQbg derhintze 25172489 2021-09-13T04:34:02Z 2021-09-13T04:34:02Z NONE

Yes, aux_1 (dim_1) should be split into chunks of two elements. At the same time, the coordinates aux_0 (dim_0) and * dim_0 (dim_0) should not be split at all. Even if it is not part of the API, it still is surprising that such DataArrays are created without warning or error. In other words, there isn't any check for self-consistency. I have to admit, though, that I'm not familiar with the internals of how xarray and numpy interact for these numpy array manipulation routines.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Coordinates have wrong number of elements after a Dataset/DataArray is split by np.split() 991144834
917699896 https://github.com/pydata/xarray/issues/5779#issuecomment-917699896 https://api.github.com/repos/pydata/xarray/issues/5779 IC_kwDOAMm_X842sv04 derhintze 25172489 2021-09-12T19:54:59Z 2021-09-12T19:55:30Z NONE

Thanks for asking this question to clarify! My example probably wasn't as concise as it could've been. In an attempt to improve here, I've shortened the example output a bit.

The issue isn't with the data variable content of the three split arrays, it's with the coordinates. It appears that coordinates along dim_0 have been split instead of those along dim_1. This leaves the resulting DataArrays malformed. Their coordinates do not match their corresponding dimensions in length.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Coordinates have wrong number of elements after a Dataset/DataArray is split by np.split() 991144834

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 755.058ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows