issue_comments: 287680627
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/1288#issuecomment-287680627 | https://api.github.com/repos/pydata/xarray/issues/1288 | 287680627 | MDEyOklzc3VlQ29tbWVudDI4NzY4MDYyNw== | 1217238 | 2017-03-20T05:22:10Z | 2017-03-20T05:22:10Z | MEMBER | Sorry for letting this lapse. Yes, we absolutely want this functionality in some form.
This is a fair point, and I agree with you from a purist OO-programming/software-engineering perspective (TensorFlow, for example, takes this approach). But with xarray, we have been taking a different path, putting methods on objects for the convenience of method chaining (like pandas). So from a consistency perspective, I think it's fine to keep these as methods. This is somewhat similar even to NumPy, where a number of the most commonly used functions are also methods.
I don't see a big advantage to adding such an extension point. Almost assuredly it's less text and more clear to simply write
I normally don't like adding flags for switching functionality entirely but maybe that would make sense here if there's enough shared code (e.g., simply substituting One thing that can be useful to do before writing code is to write out a docstring with all the bells and whistles we might eventually add. So let's give that a shot here and see if Argumentsdim : str or DataArray DataArray or reference to an existing coordinate, labeling what to integrate over. cumulative : bool, optional Whether to do a non-cumulative (default) or cumulative integral. method : 'trapz' or 'simps', optional Whether to use the trapezoidal rule or Simpson's rule. ``` I could also imagine possibly adding a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
210704949 |