home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "MEMBER" and issue = 621078539 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • shoyer 3
  • keewis 2
  • rabernat 1
  • dcherian 1

issue 1

  • Unnamed dimensions · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1435715372 https://github.com/pydata/xarray/issues/4079#issuecomment-1435715372 https://api.github.com/repos/pydata/xarray/issues/4079 IC_kwDOAMm_X85Vk0cs keewis 14808389 2023-02-18T16:51:14Z 2023-02-18T16:51:14Z MEMBER

hmm... would np.nan work?

not sure about alignment, but at least obj.sizes would break with multiple dims: while it does not compare as equal, the hash() of np.nan stays constant (same with any other object, I guess).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539
1434959378 https://github.com/pydata/xarray/issues/4079#issuecomment-1434959378 https://api.github.com/repos/pydata/xarray/issues/4079 IC_kwDOAMm_X85Vh74S dcherian 2448579 2023-02-17T17:16:14Z 2023-02-17T17:16:22Z MEMBER

This reminds me of the issue with nan shaped dimensions. Where again we want to avoid automatic alignment (well in that case you can't align).

For this particular issue could we define a xr.UNNAMED that doesn't equal itself (hmm... would np.nan work?). Would that skip alignment checks?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539
1434932769 https://github.com/pydata/xarray/issues/4079#issuecomment-1434932769 https://api.github.com/repos/pydata/xarray/issues/4079 IC_kwDOAMm_X85Vh1Yh shoyer 1217238 2023-02-17T17:03:52Z 2023-02-17T17:03:52Z MEMBER

I agree, automatic dimension only ever really made sense for interactive usecases, where a user could see and fix the default names.

It's a little late to change the default now to raising an error instead, but maybe we could add a warning?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539
1434805981 https://github.com/pydata/xarray/issues/4079#issuecomment-1434805981 https://api.github.com/repos/pydata/xarray/issues/4079 IC_kwDOAMm_X85VhWbd keewis 14808389 2023-02-17T15:28:07Z 2023-02-17T15:28:07Z MEMBER

I'd probably use itertools.count() or the uuid module to generate globally unique dimension names... something like ```python class UnnamedDimensions: def __init__(self): self.dimension_names = (f"unnamed_dim{number}" for number in itertools.count())

def __call__(self, n):
    return list(itertools.islice(dimension_names, None, n))

unnamed_dimensions = _UnnamedDimensions() or using `uuid` (probably overkill):python def unnamed_dimensions(n): return [uuid.uuid4() for _ in range(n)] you'd use it like this:python d1 = xr.DataArray(data=[1, 2], dims=unnamed_dimensions(1)) d2 = xr.DataArray(data=[[1, 2]], dims=unnamed_dimensions(2)) ``` which would make "unnamed" a bit more explicit.

Edit: that's probably not so different from what you meant with d1_i

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539
630936142 https://github.com/pydata/xarray/issues/4079#issuecomment-630936142 https://api.github.com/repos/pydata/xarray/issues/4079 MDEyOklzc3VlQ29tbWVudDYzMDkzNjE0Mg== shoyer 1217238 2020-05-19T16:33:49Z 2020-05-19T16:33:49Z MEMBER

In the specific example from your notebook, where do the dimensions lengths __variants/BaseCounts_dim1, __variants/MLEAC_dim1 and __variants/MLEAF_dim1 come from?

BaseCounts_dim1 is length 4, so maybe that corresponds to DNA bases ATGC?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539
630916682 https://github.com/pydata/xarray/issues/4079#issuecomment-630916682 https://api.github.com/repos/pydata/xarray/issues/4079 MDEyOklzc3VlQ29tbWVudDYzMDkxNjY4Mg== shoyer 1217238 2020-05-19T16:00:34Z 2020-05-19T16:00:34Z MEMBER

The main problem is that unnamed dimensions (in NumPy, at least) have different semantics than named dimensions, particular for how dimensions are matched up in broadcasting. For that reason, we really want all dimensions to always be named.

We could possibly add support for unnamed dimensions in the Dataset constructor, but on the other hand it also provides a gentle nudge to chose names.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539
630906095 https://github.com/pydata/xarray/issues/4079#issuecomment-630906095 https://api.github.com/repos/pydata/xarray/issues/4079 MDEyOklzc3VlQ29tbWVudDYzMDkwNjA5NQ== rabernat 1197350 2020-05-19T15:42:07Z 2020-05-19T15:42:07Z MEMBER

Is there a way to create arrays and datasets with unnamed dimensions?

No. Xarray's data model requires all dimensions to have a name.

Xarray allows you to create DataArrays without specifying dimensions:

python import xarray as xr import numpy as np da = xr.DataArray(np.zeros((4, 5)))

Xarray will choose dimension names in this case (dim_0, dim_1, etc.)

This doesn't work with creating Datasets, because you have to specify all variables' dimensions in the Dataset constructor.

I imagine that unnamed dimensions would break lots of internal Xarray logic.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unnamed dimensions 621078539

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