Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataArray.diff dim argument should be optional as is in docstring #1040

Closed
smartass101 opened this issue Oct 6, 2016 · 7 comments · Fixed by #3909
Closed

DataArray.diff dim argument should be optional as is in docstring #1040

smartass101 opened this issue Oct 6, 2016 · 7 comments · Fixed by #3909

Comments

@smartass101
Copy link

The dosctring of DataArray.diff lists the dim arg as optional, but it isn't. IMHO it should indeed be optional as it is quite convenient to apply diff to 1D signals without specifying the dimension.

@shoyer
Copy link
Member

shoyer commented Oct 6, 2016

Seems reasonable to me. Want to put together a PR?

smartass101 added a commit to smartass101/xarray that referenced this issue Nov 17, 2016
* {Dataset,DataArray}.diff dim argument defaults to last dimension

* add test cases

* add changelog
@dcherian
Copy link
Contributor

@smartass101 I was about to open an issue for this. Looks like you have already solved it. Wanna open a PR?

@stale
Copy link

stale bot commented Feb 27, 2020

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

@stale stale bot added the stale label Feb 27, 2020
@stale stale bot closed this as completed Mar 28, 2020
@keewis
Copy link
Collaborator

keewis commented Mar 28, 2020

this is still relevant. Should we update the docstring or the implementation? If we choose the latter we might be able to pick the commit by @smartass101 (or he might open a PR for it if he's still around?)

@keewis keewis reopened this Mar 28, 2020
@stale stale bot removed the stale label Mar 28, 2020
@max-sixty
Copy link
Collaborator

I'm low confidence keener on a consistent API that doesn't depend on the number of dimensions, rather than saving a kwarg, so would vote +0.1 on retaining the implementation and changing the docstring, such that it's required to pass a dimension name even with one dimension.

@dcherian
Copy link
Contributor

I agree.

@smartass101
Copy link
Author

These days I mostly use .differentiate('coord') anyways, so I'm also for updating the docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants