home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 464717028

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
464717028 MDU6SXNzdWU0NjQ3MTcwMjg= 3081 Method chaining on magic methods? 4441865 closed 0     2 2019-07-05T17:02:44Z 2019-07-09T19:28:11Z 2019-07-09T19:28:11Z CONTRIBUTOR      

Apologies if this has been discussed, I couldn't find it.

In pandas and xarray I prefer a method-chaining style, and with pandas this is now very well supported. However, xarray is missing a number of simple methods. I often find myself having to use magic methods like __eq__ directly to avoid breaking the chain. Is there any reason not to do

class DataArray:
    ...
    eq = __eq__
    gt = __gt__
    ge = __ge__
    lt = __lt__
    le = __le__
    add = __add__
    subtract = __sub__
    multiply = __mul__
    divide = __div__
    pow = __pow__
    # etc.

Probably it is more complicated than this, but hopefully it communicates the idea.

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

Links from other tables

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