diff --git a/src/ert/gui/tools/export/export_panel.py b/src/ert/gui/tools/export/export_panel.py index 03c1a1c33df..442c78dbacd 100644 --- a/src/ert/gui/tools/export/export_panel.py +++ b/src/ert/gui/tools/export/export_panel.py @@ -64,7 +64,7 @@ def output_path(self) -> Optional[str]: return self.output_path_model.getPath() @property - def ensemble_list(self) -> str: + def ensemble_data_as_json(self) -> str: ensembles = { str(ensemble.id): { "ensemble_name": ensemble.name, diff --git a/src/ert/gui/tools/export/export_tool.py b/src/ert/gui/tools/export/export_tool.py index ee99e04d6f3..ad277b756fb 100644 --- a/src/ert/gui/tools/export/export_tool.py +++ b/src/ert/gui/tools/export/export_tool.py @@ -40,7 +40,7 @@ def trigger(self) -> None: self._run_export( [ dialog.output_path, - dialog.ensemble_list, + dialog.ensemble_data_as_json, dialog.design_matrix_path, True, dialog.drop_const_columns, diff --git a/src/ert/resources/workflows/jobs/internal-gui/scripts/csv_export.py b/src/ert/resources/workflows/jobs/internal-gui/scripts/csv_export.py index 18d5b340f8c..aaaac201ed1 100644 --- a/src/ert/resources/workflows/jobs/internal-gui/scripts/csv_export.py +++ b/src/ert/resources/workflows/jobs/internal-gui/scripts/csv_export.py @@ -54,17 +54,19 @@ def run( workflow_args, ): output_file = workflow_args[0] - ensemble_list = None if len(workflow_args) < 2 else workflow_args[1] + ensemble_data_as_json = None if len(workflow_args) < 2 else workflow_args[1] design_matrix_path = None if len(workflow_args) < 3 else workflow_args[2] _ = True if len(workflow_args) < 4 else workflow_args[3] drop_const_cols = False if len(workflow_args) < 5 else workflow_args[4] facade = LibresFacade(ert_config) - ensemble_dict = json.loads(ensemble_list) if ensemble_list else {} + ensemble_data_as_dict = ( + json.loads(ensemble_data_as_json) if ensemble_data_as_json else {} + ) # Use the keys (UUIDs as strings) to get ensembles ensembles = [] - for ensemble_id in ensemble_dict: + for ensemble_id in ensemble_data_as_dict: ensemble = self.storage.get_ensemble(ensemble_id) ensembles.append(ensemble) diff --git a/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py b/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py index 9ac47046252..dcb7982cc55 100644 --- a/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py +++ b/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py @@ -60,7 +60,7 @@ class GenDataRFTCSVExportJob(ErtPlugin): Optional arguments: - ensemble_list: a comma separated list of ensembles to export (no spaces allowed) + ensemble_data_as_json: a comma separated list of ensembles to export (no spaces allowed) if no list is provided the current ensemble is exported """ @@ -82,19 +82,20 @@ def run( output_file = workflow_args[0] trajectory_path = workflow_args[1] - ensemble_list = None if len(workflow_args) < 3 else workflow_args[2] + ensemble_data_as_json = None if len(workflow_args) < 3 else workflow_args[2] drop_const_cols = False if len(workflow_args) < 4 else bool(workflow_args[3]) wells = set() - # Parse the ensemble_list from JSON string to dictionary - ensemble_dict = json.loads(ensemble_list) if ensemble_list else {} + ensemble_data_as_dict = ( + json.loads(ensemble_data_as_json) if ensemble_data_as_json else {} + ) - if not ensemble_dict: + if not ensemble_data_as_dict: raise UserWarning("No ensembles given to load from") data = [] - for ensemble_id, ensemble_info in ensemble_dict.items(): + for ensemble_id, ensemble_info in ensemble_data_as_dict.items(): ensemble_name = ensemble_info["ensemble_name"] try: