Skip to content

Commit

Permalink
doc: add IMS complexity options table to readthedocs (MODFLOW-USGS#1941)
Browse files Browse the repository at this point in the history
* add GWE and PRT to readthedocs Input Guide
* add IMS complexity options table to readthedocs - updated mf6ivar.py to read LaTeX table
  • Loading branch information
jdhughes-usgs authored Jul 15, 2024
1 parent 01fbaa7 commit 3598862
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .build_rtd_docs/mf6io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ Groundwater Transport
_mf6io/gwt-*


Groundwater Energy Transport
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. toctree::
:maxdepth: 1
:glob:

_mf6io/gwe-*


Particle Tracking
^^^^^^^^^^^^^^^^^

.. toctree::
:maxdepth: 1
:glob:

_mf6io/prt-*


Model Exchanges
^^^^^^^^^^^^^^^

Expand Down
37 changes: 37 additions & 0 deletions doc/mf6io/mf6ivar/mf6ivar.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ def md_replace(s):
}
for key, value in replace_dict.items():
s = s.replace(key, value)

# delete lines
delete_tuple = (r"{tabular}", r"hline")
for value in delete_tuple:
if value in s:
s = ""

return s


Expand Down Expand Up @@ -802,6 +809,36 @@ def write_variables():
if len(s) > 0:
f.write(s)

# special cases
if "sln-ims" in mdname:
with open("../ims_table.tex", "r") as fims:
lines = fims.readlines()
s = "\n\n#### IMS variable values for the available complexity options\n"
for line in lines:
line = md_replace(line.rstrip())
save_line = True
if len(line) < 1:
save_line = False
elif line.strip().startswith("%"):
save_line = False
if save_line:
if "Variable" in line:
prepend = "\n\n"
postpend = (
"|----------------"
+ "|----------------"
+ "|----------------"
+ "|----------------|\n"
)
else:
prepend = ""
postpend = ""
s += f"{prepend}| {line.replace('&', '|')} |\n{postpend}"

if len(s) > 0:
s += "\n\n"
f.write(s)

# write markdown
write_md(fmd, vardict, component, package)

Expand Down

0 comments on commit 3598862

Please sign in to comment.