From 7751bdce14c4967aebc9bb8c0667647722dcef96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Buchwald?= Date: Thu, 4 Jul 2024 15:57:58 +0200 Subject: [PATCH] add python_script and curves to empty element removal --- examples/thm_test.prj | 2 +- ogs6py/classes/python_script.py | 1 + ogs6py/ogs.py | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/thm_test.prj b/examples/thm_test.prj index c95683c..f9984df 100644 --- a/examples/thm_test.prj +++ b/examples/thm_test.prj @@ -1,5 +1,6 @@ + square_1x1_thm.gml quarter_002_2nd.vtu @@ -324,5 +325,4 @@ - square_1x1_thm.gml diff --git a/ogs6py/classes/python_script.py b/ogs6py/classes/python_script.py index 07ef422..5a38080 100644 --- a/ogs6py/classes/python_script.py +++ b/ogs6py/classes/python_script.py @@ -16,6 +16,7 @@ class PythonScript(build_tree.BuildTree): def __init__(self, tree): self.tree = tree self.root = self._get_root() + self.populate_tree(self.root, "python_script", overwrite=True) def set_pyscript(self, filename): diff --git a/ogs6py/ogs.py b/ogs6py/ogs.py index 160a8ec..1ebc41d 100644 --- a/ogs6py/ogs.py +++ b/ogs6py/ogs.py @@ -89,7 +89,6 @@ def __init__(self, **args): self.mesh = mesh.Mesh(self.tree) self.processes = processes.Processes(self.tree) self.python_script = python_script.PythonScript(self.tree) - self.processes = processes.Processes(self.tree) self.media = media.Media(self.tree) self.time_loop = timeloop.TimeLoop(self.tree) self.local_coordinate_system = local_coordinate_system.LocalCoordinateSystem(self.tree) @@ -146,8 +145,8 @@ def _get_root(self, remove_blank_text=False, remove_comments=False): def _remove_empty_elements(self): root = self._get_root() - empty_text_list = ["./geometry"] - empty_el_list = ["./time_loop/global_process_coupling"] + empty_text_list = ["./geometry", "./python_script"] + empty_el_list = ["./time_loop/global_process_coupling", "./curves"] for element in empty_text_list: entry = root.find(element) if entry.text == "":