From ab084be06be70f2cfa45f7c3531328680d43d3a9 Mon Sep 17 00:00:00 2001
From: Polina Lakrisenko
Date: Tue, 10 Oct 2023 08:17:48 +0200
Subject: [PATCH] fix ensembles from optimization endpoints
---
pypesto/ensemble/ensemble.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pypesto/ensemble/ensemble.py b/pypesto/ensemble/ensemble.py
index d2ab53df9..d3bd07687 100644
--- a/pypesto/ensemble/ensemble.py
+++ b/pypesto/ensemble/ensemble.py
@@ -670,7 +670,7 @@ def from_optimization_endpoints(
# did not reach maximum size and the next value is still
# lower than the cutoff value
if start['fval'] <= abs_cutoff and len(x_vectors) < max_size:
- x_vectors.append(start['x'])
+ x_vectors.append(start['x'][result.problem.x_free_indices])
# the vector tag will be a -1 to indicate it is the last step
vector_tags.append((int(start['id']), -1))