From e25d7baaa78edc40d9b8e83dc7df9406b2d07b85 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Thu, 19 Aug 2021 19:06:08 +0100
Subject: [PATCH] fixng the issue of the ensembles

---
 binarycpython/utils/grid.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py
index e30ee9c39..925eb213c 100644
--- a/binarycpython/utils/grid.py
+++ b/binarycpython/utils/grid.py
@@ -1422,8 +1422,9 @@ class Population:
                 )
 
                 # Write to file
+                ensemble_output = extract_ensemble_json_from_string(ensemble_raw_output)
                 with open(output_file, "w") as f:
-                    f.write(self.format_ensemble_results(ensemble_raw_output))
+                    f.write(self.format_ensemble_results(ensemble_output))
 
                 print(
                     "Thread {}: Wrote ensemble results directly to file: {}".format(
-- 
GitLab