From ab6e84f546150d2b5bf305ba182a4ccf9ec1fe1f Mon Sep 17 00:00:00 2001 From: Robert Babin Date: Wed, 10 May 2023 13:32:28 +0200 Subject: [PATCH] fix vector inputs --- profit/util/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/profit/util/util.py b/profit/util/util.py index 9e33e71..2d827d3 100644 --- a/profit/util/util.py +++ b/profit/util/util.py @@ -54,7 +54,10 @@ def params2map(params: Union[None, MutableMapping, np.ndarray, np.void]): if isinstance(params, MutableMapping): return params try: - return {key: params[key] for key in params.dtype.names} + return { + key: params[key].item() if params[key].size == 1 else params[key] + for key in params.dtype.names + } except AttributeError: pass raise TypeError("params are not a Mapping")