Skip to content

Commit

Permalink
add python_script and curves to empty element removal
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbuchwald committed Jul 4, 2024
1 parent 59dcc2b commit 7751bdc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/thm_test.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<OpenGeoSysProject>
<geometry>square_1x1_thm.gml</geometry>
<mesh axially_symmetric="true">quarter_002_2nd.vtu</mesh>
<processes>
<process>
Expand Down Expand Up @@ -324,5 +325,4 @@
</petsc>
</linear_solver>
</linear_solvers>
<geometry>square_1x1_thm.gml</geometry>
</OpenGeoSysProject>
1 change: 1 addition & 0 deletions ogs6py/classes/python_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions ogs6py/ogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 == "":
Expand Down

0 comments on commit 7751bdc

Please sign in to comment.