Skip to content

Commit 586f7ea

Browse files
committed
validation: make scale-test Python 3 friendly
`zip` will return a generator in Python 3 rather than the zipped list. This results in the Nelder-Mead Simplex to fail as it does not actually perform the optimization of the data. Explicitly convert the data to a form which can be consumed.
1 parent b00753a commit 586f7ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/scale-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def fit_function_to_data_by_least_squares(objective, params, bounds, xs, ys):
361361
assert(len(ys) > 0)
362362
mean_y = sum(ys) / len(ys)
363363
ss_total = sum((y - mean_y) ** 2 for y in ys)
364-
data = zip(xs, ys)
364+
data = list(zip(xs, ys))
365365

366366
def inner(ps):
367367
s = 0.0

0 commit comments

Comments
 (0)