Commit db47f82f authored by Dion Häfner's avatar Dion Häfner

finish docs

parent b7f79dbe
......@@ -209,7 +209,7 @@ class ExecDirective(Directive):
self.state_machine.insert_input(lines, source)
return []
except Exception:
return [nodes.error(None, nodes.paragraph(text, "Unable to execute python code at %s:%d:" % (basename(source), self.lineno)), nodes.paragraph(text=str(sys.exc_info()[1])))]
return [nodes.error(None, nodes.paragraph(text="Unable to execute python code at %s:%d:" % (basename(source), self.lineno)), nodes.paragraph(text=str(sys.exc_info()[1])))]
finally:
sys.stdout = oldStdout
......
......@@ -14,7 +14,7 @@ They are available as attributes of all instances of the :class:`Veros state cla
for key, sett in SETTINGS.items():
print(".. _setting-{}:".format(key))
print("")
print(".. data:: {} = {}".format(key, sett.default))
print(".. py:attribute:: VerosState.{} = {}".format(key, sett.default))
print("")
print(" {}".format(sett.description))
print("")
.. _variables:
Model variables
---------------
===============
The variable meta-data (i.e., all instances of :class:`veros.variables.Variable`)
are available in a dictionary as the attribute :attr:`Veros.variables`. The actual
......@@ -18,12 +18,12 @@ are time dependent and should be added to the output, while ``var_data`` is a di
with the same keys containing the corresponding data arrays.
Variable class
++++++++++++++
--------------
.. autoclass:: veros.variables.Variable
Available variables
+++++++++++++++++++
-------------------
There are two kinds of variables in Veros. Main variables are always present in a
simulation, while conditional variables are only available if their respective
......@@ -40,16 +40,18 @@ Attributes:
from veros.variables import MAIN_VARIABLES, CONDITIONAL_VARIABLES
first_condition = True
for condition, vardict in [(None, MAIN_VARIABLES)] + list(CONDITIONAL_VARIABLES.items()):
if not vardict:
continue
if condition:
if first_condition:
print("Conditional variables")
print("=====================")
print("+++++++++++++++++++++")
first_condition = False
print(condition)
print(len(condition) * "#")
else:
print("Main variables")
print("==============")
print("++++++++++++++")
print("")
for key, var in vardict.items():
flags = ""
......@@ -59,7 +61,7 @@ Attributes:
flags += ":fa:`download` "
if var.write_to_restart:
flags += ":fa:`repeat` "
print(".. py:attribute:: Veros.{}".format(key))
print(".. py:attribute:: VerosState.{}".format(key))
print("")
print(" :units: {}".format(var.units))
print(" :dimensions: {}".format(", ".join(var.dims)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment