diff --git a/src/simsopt/objectives/least_squares.py b/src/simsopt/objectives/least_squares.py index 16e146f0f..074a979ac 100644 --- a/src/simsopt/objectives/least_squares.py +++ b/src/simsopt/objectives/least_squares.py @@ -133,7 +133,9 @@ def from_tuples(cls, each tuple (the specified order matters). """ funcs_in, goals, weights = zip(*tuples) - return cls(goals, weights, funcs_in=funcs_in, fail=fail) + goal_array = np.concatenate([np.ravel(x) for x in goals]) + weigth_array = np.concatenate([np.ravel(x) for x in weights]) + return cls(goal_array, weigth_array, funcs_in=funcs_in, fail=fail) def unweighted_residuals(self, x=None, *args, **kwargs): """