From 4b3b4d381ff2a0a40b6ceb13d028b88d83274a44 Mon Sep 17 00:00:00 2001 From: domfournier Date: Fri, 28 Mar 2025 12:13:39 -0700 Subject: [PATCH] More lineant shape of norm values --- simpeg/regularization/sparse.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simpeg/regularization/sparse.py b/simpeg/regularization/sparse.py index b5ba938866..7bf6e23c5d 100644 --- a/simpeg/regularization/sparse.py +++ b/simpeg/regularization/sparse.py @@ -119,10 +119,10 @@ def norm(self, value: float | np.ndarray | None): if value is None: value = np.ones(self._weights_shapes[0]) * 2.0 expected_shapes = self._weights_shapes - if isinstance(expected_shapes, list): - expected_shapes = expected_shapes[0] + if not isinstance(expected_shapes, list): + expected_shapes = [expected_shapes] value = validate_ndarray_with_shape( - "norm", value, shape=[expected_shapes, (1,)], dtype=float + "norm", value, shape=expected_shapes + [(1,)], dtype=float ) if value.shape == (1,): value = np.full(expected_shapes[0], value)