-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support multiple dimensions in DataArray.argmin() and DataArray.argmax() methods #3936
Commits on Apr 5, 2020
-
DataArray.indices_min() and DataArray.indices_max() methods
These return dicts of the indices of the minimum or maximum of a DataArray over several dimensions.
Configuration menu - View commit details
-
Copy full SHA for 8e7fb53 - Browse repository at this point
Copy the full SHA 8e7fb53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b06811 - Browse repository at this point
Copy the full SHA 2b06811View commit details -
Configuration menu - View commit details
-
Copy full SHA for f6a966c - Browse repository at this point
Copy the full SHA f6a966cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4395e7a - Browse repository at this point
Copy the full SHA 4395e7aView commit details
Commits on Apr 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for deee3f8 - Browse repository at this point
Copy the full SHA deee3f8View commit details -
Merge behaviour of indices_min/indices_max into argmin/argmax
When argmin or argmax are called with a sequence for 'dim', they now return a dict with the indices for each dimension in dim.
Configuration menu - View commit details
-
Copy full SHA for be8b26c - Browse repository at this point
Copy the full SHA be8b26cView commit details -
Basic overload of argmin() and argmax() for Dataset
If single dim is passed to Dataset.argmin() or Dataset.argmax(), then pass through to _argmin_base or _argmax_base. If a sequence is passed for dim, raise an exception, because the result for each DataArray would be a dict, which cannot be stored in a Dataset.
Configuration menu - View commit details
-
Copy full SHA for 6d9d509 - Browse repository at this point
Copy the full SHA 6d9d509View commit details -
Update Variable and dask tests with _argmin_base, _argmax_base
The basic numpy-style argmin() and argmax() methods were renamed when adding support for handling multiple dimensions in DataArray.argmin() and DataArray.argmax(). Variable.argmin() and Variable.argmax() are therefore renamed as Variable._argmin_base() and Variable._argmax_base().
Configuration menu - View commit details
-
Copy full SHA for 70aaa9d - Browse repository at this point
Copy the full SHA 70aaa9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f8952a8 - Browse repository at this point
Copy the full SHA f8952a8View commit details
Commits on Apr 10, 2020
-
Explicitly defined class methods override injected methods
If a method (such as 'argmin') has been explicitly defined on a class (so that hasattr(cls, "argmin")==True), then do not inject that method, as it would override the explicitly defined one. Instead inject a private method, prefixed by "_injected_" (such as '_injected_argmin'), so that the injected method is available to the explicitly defined one. Do not perform the hasattr check on binary ops, because this breaks some operations (e.g. addition between DataArray and int in test_dask.py).
Configuration menu - View commit details
-
Copy full SHA for 8caf2b8 - Browse repository at this point
Copy the full SHA 8caf2b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4778cfd - Browse repository at this point
Copy the full SHA 4778cfdView commit details -
Revert use of _argmin_base and _argmax_base
Now not needed because of change to injection in ops.py.
Configuration menu - View commit details
-
Copy full SHA for 66cf085 - Browse repository at this point
Copy the full SHA 66cf085View commit details -
Move implementation of argmin, argmax from DataArray to Variable
Makes use of argmin and argmax more general (they are available for Variable) and is straightforward for DataArray to wrap the Variable version.
Configuration menu - View commit details
-
Copy full SHA for c78c1fe - Browse repository at this point
Copy the full SHA c78c1feView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb6742d - Browse repository at this point
Copy the full SHA cb6742dView commit details -
Add 'out' keyword to argmin/argmax methods - allow numpy call signature
When np.argmin(da) is called, numpy passes an 'out' keyword argument to argmin/argmax. Need to allow this argument to avoid errors (but an exception is thrown if out is not None).
Configuration menu - View commit details
-
Copy full SHA for ab480b5 - Browse repository at this point
Copy the full SHA ab480b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for dca8e45 - Browse repository at this point
Copy the full SHA dca8e45View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52554b6 - Browse repository at this point
Copy the full SHA 52554b6View commit details
Commits on Apr 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for ef826f6 - Browse repository at this point
Copy the full SHA ef826f6View commit details -
Fix typo in name of argminmax_func
Co-Authored-By: keewis <keewis@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 8a7c7ad - Browse repository at this point
Copy the full SHA 8a7c7adView commit details -
Mark argminmax argument to _unravel_argminmax as a string
Co-Authored-By: keewis <keewis@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for e56e2e7 - Browse repository at this point
Copy the full SHA e56e2e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a99697a - Browse repository at this point
Copy the full SHA a99697aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a785c34 - Browse repository at this point
Copy the full SHA a785c34View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac897d4 - Browse repository at this point
Copy the full SHA ac897d4View commit details -
Revert "Explicitly defined class methods override injected methods"
This reverts commit 8caf2b8.
Configuration menu - View commit details
-
Copy full SHA for 752518e - Browse repository at this point
Copy the full SHA 752518eView commit details -
Revert "Add 'out' keyword to argmin/argmax methods - allow numpy call…
… signature" This reverts commit ab480b5.
Configuration menu - View commit details
-
Copy full SHA for 8b7365b - Browse repository at this point
Copy the full SHA 8b7365bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 46b04a6 - Browse repository at this point
Copy the full SHA 46b04a6View commit details -
Use self.reduce() in Dataset.argmin() and Dataset.argmax()
Replaces need for "_injected_argmin" and "_injected_argmax".
Configuration menu - View commit details
-
Copy full SHA for 1ef3c97 - Browse repository at this point
Copy the full SHA 1ef3c97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65ca2ad - Browse repository at this point
Copy the full SHA 65ca2adView commit details -
Remove tests of np.argmax() and np.argmin() functions from test_units.py
Applying numpy functions to xarray objects is not necessarily expected to work, and the wrapping of argmin() and argmax() is broken by xarray-specific interface of argmin() and argmax() methods of Variable, DataArray and Dataset.
Configuration menu - View commit details
-
Copy full SHA for 1736abf - Browse repository at this point
Copy the full SHA 1736abfView commit details -
Clearer deprecation warnings in Dataset.argmin() and Dataset.argmax()
Also, previously suggested workaround was not correct. Remove suggestion as there is no workaround (but the removed behaviour is unlikely to be useful).
Configuration menu - View commit details
-
Copy full SHA for d9b55ee - Browse repository at this point
Copy the full SHA d9b55eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 432dfbb - Browse repository at this point
Copy the full SHA 432dfbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20b448a - Browse repository at this point
Copy the full SHA 20b448aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95845f9 - Browse repository at this point
Copy the full SHA 95845f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ee5146 - Browse repository at this point
Copy the full SHA 0ee5146View commit details
Commits on Jun 24, 2020
-
Configuration menu - View commit details
-
Copy full SHA for daa2ea5 - Browse repository at this point
Copy the full SHA daa2ea5View commit details -
Configuration menu - View commit details
-
Copy full SHA for d029183 - Browse repository at this point
Copy the full SHA d029183View commit details
Commits on Jun 26, 2020
-
Tidy up argmin/argmax following code review
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for a758b0f - Browse repository at this point
Copy the full SHA a758b0fView commit details -
Remove filters for warnings from argmin/argmax from tests
Pass an explicit axis or dim argument instead to avoid the warning.
Configuration menu - View commit details
-
Copy full SHA for 9a54e0c - Browse repository at this point
Copy the full SHA 9a54e0cView commit details -
Swap order of reduce_dims checks in Dataset.reduce()
Prefer to pass reduce_dims=None when possible, including for variables with only one dimension. Avoids an error if an 'axis' keyword was passed.
Configuration menu - View commit details
-
Copy full SHA for a07ce29 - Browse repository at this point
Copy the full SHA a07ce29View commit details -
Configuration menu - View commit details
-
Copy full SHA for f73e10e - Browse repository at this point
Copy the full SHA f73e10eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d77fe11 - Browse repository at this point
Copy the full SHA d77fe11View commit details -
Configuration menu - View commit details
-
Copy full SHA for 308bb23 - Browse repository at this point
Copy the full SHA 308bb23View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b53f49 - Browse repository at this point
Copy the full SHA 1b53f49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f80205 - Browse repository at this point
Copy the full SHA 5f80205View commit details -
Configuration menu - View commit details
-
Copy full SHA for 540c281 - Browse repository at this point
Copy the full SHA 540c281View commit details
Commits on Jun 27, 2020
-
Co-authored-by: keewis <keewis@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 4aca9d9 - Browse repository at this point
Copy the full SHA 4aca9d9View commit details