You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep the current behavior as it corresponds to how in general tolist behaves.
Do the one-line fix such that both the examples above return a one-dimensional list.
I tend to view 1 as the better possibility, to keep our usage of tolist as standard as possible; what is your opinion? I guess this issue arose from some specific problem in primitives/runtime?
This was prompted by some partner trying to implement an Estimator-like interface.
I'm not against option 1, but if that's the approach, the type hint should be list | dict, and docstring should mention it could return a scalar (dictionary) if the array is 0d (similar to the docstring for numpy.tolist)
Environment
What is happening?
The
tolist()
method inObservablesArray
returns a dictionary instead of a list when there is only 1 observable.How can we reproduce the issue?
What should happen?
Both the method name and type hint suggests it should return a list
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: