home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 831148018 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

  • dcherian 1
  • LunarLanding 1
  • max-sixty 1
  • mathause 1

author_association 2

  • MEMBER 3
  • NONE 1

issue 1

  • output_dtypes needs to be a tuple, not a sequence · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
822729940 https://github.com/pydata/xarray/issues/5034#issuecomment-822729940 https://api.github.com/repos/pydata/xarray/issues/5034 MDEyOklzc3VlQ29tbWVudDgyMjcyOTk0MA== LunarLanding 4441338 2021-04-19T19:33:14Z 2021-04-19T19:33:14Z NONE

@dcherian I tried to reproduce, with this minimal example I couldn't, so I'm closing the issue. ```python

import xarray as xr import numpy as np

n0 = 10 n1 = 3 x1 = xr.DataArray(np.empty((n0,n1),dtype=np.float64),dims=('dim0','dim1')).chunk({'dim0':2}) x2 = xr.DataArray(np.empty(n0,dtype=bool),dims=('dim0',)).chunk({'dim0':2})

n2 = 10

def f(x1,x2): return np.empty(n2,dtype=x1.dtype),np.empty(n2,dtype=np.min_scalar_type(n2))

m,w = xr.apply_ufunc( f, x1,x2, input_core_dims=[('dim0','dim1'),('dim0',)], output_core_dims=[('dim2',),('dim2',)], vectorize=True, dask='parallelized', dask_gufunc_kwargs={ 'output_sizes':{'dim2':n2}, 'allow_rechunk':True,

'meta':(np.empty((M,),dtype=p.dtype),np.empty((M,),dtype=np.min_scalar_type(M)))

'output_dtypes':[p.dtype,np.min_scalar_type(M)],

},
output_dtypes=[x1.dtype,np.min_scalar_type(n2)] # now works

output_dtypes=(x.dtype,np.min_scalar_type(ny)) # works

) m.compute(),w.compute() (<xarray.DataArray (dim2: 10)> array([1.e-323, 2.e-323, 3.e-323, 4.e-323, 5.e-323, 6.e-323, 7.e-323, 8.e-323, 9.e-323, 1.e-322]) Dimensions without coordinates: dim2, <xarray.DataArray (dim2: 10)> array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=uint8) Dimensions without coordinates: dim2) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  output_dtypes needs to be a tuple, not a sequence 831148018
822130302 https://github.com/pydata/xarray/issues/5034#issuecomment-822130302 https://api.github.com/repos/pydata/xarray/issues/5034 MDEyOklzc3VlQ29tbWVudDgyMjEzMDMwMg== dcherian 2448579 2021-04-19T02:49:32Z 2021-04-19T02:49:32Z MEMBER

@LunarLanding can you add a minimal example illustrating the problem?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  output_dtypes needs to be a tuple, not a sequence 831148018
798999639 https://github.com/pydata/xarray/issues/5034#issuecomment-798999639 https://api.github.com/repos/pydata/xarray/issues/5034 MDEyOklzc3VlQ29tbWVudDc5ODk5OTYzOQ== mathause 10194086 2021-03-14T23:23:05Z 2021-03-14T23:23:05Z MEMBER

Hmm would be good to get a MVCE - may be a dask problem. Dask allows a "list of dtypes" according to its docstring.

  • dask.array.apply_gufunc: output_dtypes : Optional, dtype or list of dtypes, keyword only
  • np.vectorize: otypes : str or list of dtypes, optional

Unfortunately np.vectorize is not (yet) typed, but in anycase (and independent of your error report) we should probably write this as Sequence[DTypeLike] (or another container) using xr.core.npcompat.DTypeLike

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  output_dtypes needs to be a tuple, not a sequence 831148018
798973169 https://github.com/pydata/xarray/issues/5034#issuecomment-798973169 https://api.github.com/repos/pydata/xarray/issues/5034 MDEyOklzc3VlQ29tbWVudDc5ODk3MzE2OQ== max-sixty 5635139 2021-03-14T20:22:04Z 2021-03-14T20:22:04Z MEMBER

Thanks @LunarLanding .

Does anyone who knows this better have a view on whether we should accept a list? In lieu of that, we can change the type definition. @LunarLanding would you be up for a small PR?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  output_dtypes needs to be a tuple, not a sequence 831148018

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