-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix release 0.403 / first ogstools release
- Loading branch information
1 parent
27ded1e
commit 52874e9
Showing
19 changed files
with
2,073 additions
and
1,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Provide a central version.""" | ||
__version__ = "0.402" | ||
__version__ = "0.403" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,106 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org) | ||
Distributed under a Modified BSD License. | ||
See accompanying file LICENSE or | ||
http://www.opengeosys.org/project/license | ||
""" | ||
from contextlib import suppress | ||
|
||
from lxml import etree as ET | ||
|
||
try: | ||
from IPython.display import display, Markdown, Latex | ||
from IPython.display import Markdown, display | ||
|
||
verbose = True | ||
except ImportError: | ||
verbose = False | ||
|
||
|
||
# pylint: disable=C0103, R0902, R0914, R0913 | ||
class Display: | ||
""" helper class to create a nested dictionary | ||
"""helper class to create a nested dictionary | ||
representing the xml structure | ||
""" | ||
def __init__(self,tree): | ||
|
||
def __init__(self, tree: ET.ElementTree): | ||
if verbose is True: | ||
display(Markdown('## OpenGeoSys project file')) | ||
display(Markdown('### Main Info')) | ||
display(Markdown(f"**Process name:** {tree.find('./processes/process/name').text}")) | ||
display(Markdown(f"**Process type:** {tree.find('./processes/process/type').text}")) | ||
t_end = float(tree.find('./time_loop/processes/process/time_stepping/t_end').text) | ||
t_init = float(tree.find('./time_loop/processes/process/time_stepping/t_initial').text) | ||
display(Markdown(f"**Simulation time:** {t_end-t_init}")) | ||
proc_vars = tree.findall("./process_variables/process_variable") | ||
display(Markdown(f"**Output prefix:** {tree.find('./time_loop/output/prefix').text}")) | ||
display(Markdown('### Boundary conditions')) | ||
for var in proc_vars: | ||
proc_var_entries = var.getchildren() | ||
for entry in proc_var_entries: | ||
if entry.tag == "name": | ||
display(Markdown(f"**Process Variable:** {entry.text}")) | ||
if entry.tag == "initial_condition": | ||
display(Markdown(f" - **Initial Condition:** {entry.text}")) | ||
if entry.tag == "order": | ||
display(Markdown(f" - **Order:** {entry.text}")) | ||
if entry.tag == "boundary_conditions": | ||
bcs = entry.getchildren() | ||
for bc in bcs: | ||
bc_entries = bc.getchildren() | ||
for subentry in bc_entries: | ||
if subentry.tag == "type": | ||
display(Markdown(f" - **Type:** {subentry.text}")) | ||
if subentry.tag == "mesh": | ||
display(Markdown(f" - **Mesh:** {subentry.text}")) | ||
if subentry.tag == "geometrical_set": | ||
display(Markdown(f" - **Geometrical Set:** {subentry.text}")) | ||
if subentry.tag == "geometry": | ||
display(Markdown(f" - **Geometry:** {subentry.text}")) | ||
display(Markdown("## OpenGeoSys project file")) | ||
display(Markdown("### Main Info")) | ||
with suppress(AttributeError): | ||
display( | ||
Markdown( | ||
f"**Process name:** {tree.find('./processes/process/name').text}" | ||
) | ||
) | ||
with suppress(AttributeError): | ||
display( | ||
Markdown( | ||
f"**Process type:** {tree.find('./processes/process/type').text}" | ||
) | ||
) | ||
with suppress(AttributeError): | ||
t_end = float( | ||
tree.find( | ||
"./time_loop/processes/process/time_stepping/t_end" | ||
).text | ||
) | ||
t_init = float( | ||
tree.find( | ||
"./time_loop/processes/process/time_stepping/t_initial" | ||
).text | ||
) | ||
display(Markdown(f"**Simulation time:** {t_end-t_init}")) | ||
with suppress(AttributeError): | ||
proc_vars = tree.findall("./process_variables/process_variable") | ||
with suppress(AttributeError): | ||
display( | ||
Markdown( | ||
f"**Output prefix:** {tree.find('./time_loop/output/prefix').text}" | ||
) | ||
) | ||
display(Markdown("### Boundary conditions")) | ||
for var in proc_vars: | ||
proc_var_entries = var.getchildren() | ||
for entry in proc_var_entries: | ||
if entry.tag == "name": | ||
display( | ||
Markdown(f"**Process Variable:** {entry.text}") | ||
) | ||
if entry.tag == "initial_condition": | ||
display( | ||
Markdown( | ||
f" - **Initial Condition:** {entry.text}" | ||
) | ||
) | ||
if entry.tag == "order": | ||
display(Markdown(f" - **Order:** {entry.text}")) | ||
if entry.tag == "boundary_conditions": | ||
bcs = entry.getchildren() | ||
for bc in bcs: | ||
bc_entries = bc.getchildren() | ||
for subentry in bc_entries: | ||
if subentry.tag == "type": | ||
display( | ||
Markdown( | ||
f" - **Type:** {subentry.text}" | ||
) | ||
) | ||
if subentry.tag == "mesh": | ||
display( | ||
Markdown( | ||
f" - **Mesh:** {subentry.text}" | ||
) | ||
) | ||
if subentry.tag == "geometrical_set": | ||
display( | ||
Markdown( | ||
f" - **Geometrical Set:** {subentry.text}" | ||
) | ||
) | ||
if subentry.tag == "geometry": | ||
display( | ||
Markdown( | ||
f" - **Geometry:** {subentry.text}" | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.