question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
max-sixtycommented, Mar 28, 2020

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.

0reactions
smartass101commented, Mar 28, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documenting different argument possibilities on same function
So, you explicitly state what is optional as indicated, otherwise it would be understood as a mandatory argument.
Read more >
Applying unvectorized functions with apply_ufunc - Xarray
We will iteratively build up the right set of arguments to apply_ufunc and ... exclude_dims : set, optional Core dimensions on the inputs...
Read more >
What's New — xarray 0.11.0 documentation - PyData |
The autoclose argument to open_dataset and related functions has been ... Fixed DataArray.to_iris() failure while creating DimCoord by falling back to ...
Read more >
Python functions and stateful objects - PySD - Read the Docs
DataArray ) – Input value. dim (list of strs (optional)) – Dimensions to apply the function over. If not given the function will...
Read more >
Interactive — hvPlot 0.8.2 documentation
Dataset> Dimensions: (lat: 25, time: 2920, lon: 53) Coordinates: * lat (lat) ... We can supply both regular values, widgets and parameters as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found