Skip to content

Commit

Permalink
add sidl/python language tabs to control functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Nov 21, 2024
1 parent 1dba193 commit a7b6433
Showing 1 changed file with 58 additions and 12 deletions.
70 changes: 58 additions & 12 deletions docs/source/bmi.control_funcs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ updating.
*initialize*
^^^^^^^^^^^^

.. code-block:: java
.. tab-set::
:sync-group: lang

/* SIDL */
int initialize(in string config_file);
.. tab-item:: SIDL
:sync: sidl

.. code-block:: java
int initialize(in string config_file);
.. tab-item:: Python
:sync: python

.. code-block:: python
def initialize(self, config_file: str) -> None:
The `initialize` function accepts a string argument that gives the
path to its :term:`configuration file`.
Expand Down Expand Up @@ -48,10 +59,22 @@ formatted.
*update*
^^^^^^^^

.. code-block:: java
.. tab-set::
:sync-group: lang

.. tab-item:: SIDL
:sync: sidl

.. code-block:: java
int update();
.. tab-item:: Python
:sync: python

.. code-block:: python
/* SIDL */
int update();
def update(self) -> None:
The `update` function advances the model by a single time step. This
is the model's own internal time step (as returned by the BMI
Expand All @@ -75,10 +98,22 @@ function can just return without doing anything.
*update_until*
^^^^^^^^^^^^^^

.. code-block:: java
.. tab-set::
:sync-group: lang

/* SIDL */
int update_until(in double time);
.. tab-item:: SIDL
:sync: sidl

.. code-block:: java
int update_until(in double time);
.. tab-item:: Python
:sync: python

.. code-block:: python
def update_until(self, time: float) -> None:
The `update_until` function updates the model to a particular time,
as provided by its *time* argument.
Expand All @@ -101,11 +136,22 @@ to reflect that the model was updated to the requested time.
*finalize*
^^^^^^^^^^

.. code-block:: java
.. tab-set::
:sync-group: lang

.. tab-item:: SIDL
:sync: sidl

.. code-block:: java
int finalize();
.. tab-item:: Python
:sync: python

/* SIDL */
int finalize();
.. code-block:: python
def finalize(self) -> None:
The `finalize` function should perform all tasks that take place
after exiting the model's time loop. This typically includes
Expand Down

0 comments on commit a7b6433

Please sign in to comment.