home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 496064041

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2292#issuecomment-496064041 https://api.github.com/repos/pydata/xarray/issues/2292 496064041 MDEyOklzc3VlQ29tbWVudDQ5NjA2NDA0MQ== 1217238 2019-05-27T03:15:53Z 2019-05-27T03:15:53Z MEMBER

From a typing perspective, what if xarray.Dataset was a generic type? Then you could write something like xarray.Dataset[str, np.ndarray] to get a Dataset specialized to string keys and numpy arrays in the .data attribute of its constituent data.

I don't think we need to change the signature of xarray functions to support "hashable or sequence of hashable". It's OK if convenience features (like support for passing in only a single argument as a string) don't work in all cases. I agree that it would be a good idea to use a centralized helper function for this, though.

It is unfortunate that there doesn't seem to be a good way to distinguish between "string" and "non-string sequence of strings" in Python's typing system. But I don't know a good way to solve this problem. Certainly the folks who work on typing in Python are aware of this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  341643235
Powered by Datasette · Queries took 0.503ms · About: xarray-datasette