home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 575564170

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
575564170 MDU6SXNzdWU1NzU1NjQxNzA= 3829 {DataArray,Dataset} accessors with parameters 7441788 open 0     4 2020-03-04T16:41:55Z 2020-04-02T12:11:47Z   CONTRIBUTOR      

I would like to be able to create an DataArray accessor that takes parameters, e.g. obj.weighted(w).sum(dim). This appears to be impossible using the existing @register_{dataarray,dataset}_accessor, which supports only accessors of the form obj.weighted.sum(w, dim).

To support the desired syntax, one could simply change https://github.com/pydata/xarray/blob/master/xarray/core/extensions.py#L36 from accessor_obj = self._accessor(obj) to accessor_obj = partial(self._accessor, obj) But that would break the current syntax (i.e. would require obj.accessor().foo(), so is clearly not acceptable.

So any suggestions (short of simply creating slightly modified copies of register_{dataarray,dataset}_accessor) for supporting both the existing obj.accessor.foo() syntax as well as my desired obj.accessor(*args, **kwargs).foo() syntax?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3829/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 0.698ms · About: xarray-datasette