home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 743129921

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/4644#issuecomment-743129921 https://api.github.com/repos/pydata/xarray/issues/4644 743129921 MDEyOklzc3VlQ29tbWVudDc0MzEyOTkyMQ== 32801740 2020-12-11T11:05:04Z 2020-12-11T11:08:57Z CONTRIBUTOR

Working on a unit test for the subok argument I found no way for creating a DataArray backed by a subclass of np.ndarray (even with NEP 18 enabled).

The DataArray constructor calls xr.core.variable.as_compatible_data. This function:

  • converts np.ma instances to np.ndarray with fill values applied.
  • the NEP 18 specific branch which would keep the supplied data argument (and its type) is not reachable for (subclasses of) np.ndarray
  • it converts these subclasses to np.ndarray.

Is this behaviour intentional?

What to do with astype? If the behaviour is not intentional we could add the subok unit test but marked as xfail until that is fixed. If it is intentional we could omit the subok argument here.

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