Skip to content

Commit

Permalink
ravel-concatenate weights and goals in LeastSquaresProblem.from_tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
smiet committed Oct 6, 2023
1 parent 085177e commit 43b08df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/simsopt/objectives/least_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 43b08df

Please sign in to comment.