home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 706937046

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/pull/4484#issuecomment-706937046 https://api.github.com/repos/pydata/xarray/issues/4484 706937046 MDEyOklzc3VlQ29tbWVudDcwNjkzNzA0Ng== 1277781 2020-10-12T07:36:34Z 2020-10-12T07:36:34Z CONTRIBUTOR

If we're doing to do this, I would suggest that the right signature is xarray.map(func, *datasets, **optional_kwargs), matching Python's builtin map.

What I'd like to ensure is a clean separation between the arguments of xarray.map and func. Map has three "own" parameters, like func, datasets and keep_attrs. By using the **kwargs approach we are excluding these parameter names from func. Not saying that is likely that anyone would apply a function with such parameter names. But not impossible either. Also having a real dict for keyword args (and maybe a list for positional arguments of func) is more explicit.

In my implementation the order of parameters is datasets and then func to match that of Dataset.map with the implicit self. But probably func and then the datasets is more intuitive.

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