From 260361c6f524751efef923cfb67cb49176357322 Mon Sep 17 00:00:00 2001 From: Joel Pasvolsky Date: Tue, 24 Mar 2026 15:04:25 -0700 Subject: [PATCH 1/2] Add missing argsort to __all__ --- dwave/optimization/mathematical.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dwave/optimization/mathematical.py b/dwave/optimization/mathematical.py index d326f972..07901954 100644 --- a/dwave/optimization/mathematical.py +++ b/dwave/optimization/mathematical.py @@ -79,6 +79,7 @@ "absolute", "add", "arange", + "argsort", "as_array_symbols", "atleast_1d", "atleast_2d", @@ -309,9 +310,6 @@ def argsort(array: ArraySymbol) -> ArgSort: [[5. 1. 3.] [0. 2. 4.]] - See Also: - :class:`~dwave.optimization.ArgSort`: equivalent symbol. - .. versionadded:: 0.6.4 """ return ArgSort(array) From e566d75dbf1d08e366bd1f73b307570609a1eb7f Mon Sep 17 00:00:00 2001 From: Joel Pasvolsky Date: Wed, 25 Mar 2026 10:08:30 -0700 Subject: [PATCH 2/2] Fix example to prevent doctest failure when argsort() is visible --- dwave/optimization/mathematical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwave/optimization/mathematical.py b/dwave/optimization/mathematical.py index 07901954..c3c3ea25 100644 --- a/dwave/optimization/mathematical.py +++ b/dwave/optimization/mathematical.py @@ -303,7 +303,7 @@ def argsort(array: ArraySymbol) -> ArgSort: >>> a = model.constant([[5, 2, 7], [4, 9, 1]]) >>> indices = argsort(a) >>> indices.shape() - (5,) + (2, 3) >>> with model.lock(): ... model.states.resize(1) ... print(indices.state())