home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 738083256

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-738083256 https://api.github.com/repos/pydata/xarray/issues/4644 738083256 MDEyOklzc3VlQ29tbWVudDczODA4MzI1Ng== 2448579 2020-12-03T15:34:58Z 2020-12-03T15:34:58Z MEMBER

@rhkleijn thanks for your thoughtful comment.

Does xarray have some kind of policy for supporting parameters which might not make sense for all types of duck arrays?

Not AFAIK but it would be good to have one.

Another option might be to allow arbitrary **kwargs which will be passed through as-is to the astype method of the underlying array and making it the responsibility of the user to only supply parameters which make sense for that particular array type.

I think this is a good policy.

Another option would be to copy the numpy signature with default None def astype(dtype, order=None, casting=None, subok=None, copy=None) and only forward kwargs that are not None. This has the advantage of surfacing all available parameters in xarray's documentation, but the default value would not be documented. It seems like only a small improvement over following your proposal and linking to numpy.ndarray.astype in the docstring

PS: The "special case" logic in astype will be removed, it was added as a temporary fix to preserve backward compatibility.

{
    "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 79.956ms · About: xarray-datasette