Skip to content

Commit

Permalink
change underscores to dashes for references
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Nov 7, 2024
1 parent b88df28 commit 6b64972
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 182 deletions.
8 changes: 4 additions & 4 deletions docs/source/bmi.best_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ In no particular order,
here are some tips to help when writing a BMI for a model.

- All functions in the BMI must be implemented. For example, even if a
model operates on a {ref}`uniform rectilinear <uniform_rectilinear>`
grid, a {ref}`get_grid_x` function has to be written. This function
model operates on a {ref}`uniform rectilinear <uniform-rectilinear>`
grid, a {ref}`get-grid-x` function has to be written. This function
can be empty and simply return the `BMI_FAILURE` status code or
raise a `NotImplemented` exception, depending on the language.
- The {ref}`BMI functions <basic_model_interface>` listed in the
- The {ref}`BMI functions <basic-model-interface>` listed in the
documentation are the minimum required. Optional functions that act
as helpers can be added to a model's BMI. For example, an
`update_frac` function that updates a model's state by a fractional
Expand Down Expand Up @@ -41,7 +41,7 @@ here are some tips to help when writing a BMI for a model.
- Recall that models can have multiple grids. This can be particularly
useful for defining {term}`exchange items <exchange item>` that
don't vary over the model domain; e.g., a diffusivity -- just define
the variable on a separate {ref}`scalar grid <unstructured_grids>`.
the variable on a separate {ref}`scalar grid <unstructured-grids>`.
- Avoid using global variables, if possible. This isn't strictly a BMI
requirement, but if a model only uses local variables, its BMI will
be self-contained. This may allow multiple instances of the model to
Expand Down
4 changes: 2 additions & 2 deletions docs/source/bmi.control_funcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ formatted.

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
{ref}`get_time_step` function), not the time step
{ref}`get-time-step` function), not the time step
of a controlling application.
This function should perform all tasks that take place during one
pass through the model's time loop. It does not contain the time
Expand Down Expand Up @@ -121,7 +121,7 @@ If the model permits,
the *time* argument can be a non-integral multiple of time steps,
and even negative.
Once called, the value returned
by the BMI {ref}`get_current_time` function must return the provided time
by the BMI {ref}`get-current-time` function must return the provided time
to reflect that the model was updated to the requested time.

**Implementation notes**
Expand Down
12 changes: 6 additions & 6 deletions docs/source/bmi.getter_setter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

These functions are used to access and modify the variables
that a model exposes through its BMI
(see {ref}`get_input_var_names` and {ref}`get_output_var_names`).
(see {ref}`get-input-var-names` and {ref}`get-output-var-names`).

A *getter* is a function called to get a variable from a model's *state*.
A model's state variables typically change with each time step,
Expand Down Expand Up @@ -41,7 +41,7 @@ The `get_value` function takes a variable name and copies values into a
provided array parameter.
The type and size of the array parameter depend on the variable,
and can be determined through
{ref}`get_var_type`, {ref}`get_var_nbytes`, etc.
{ref}`get-var-type`, {ref}`get-var-nbytes`, etc.
Recall that arrays are always flattened in BMI,
even if the model uses dimensional variables.

Expand Down Expand Up @@ -85,7 +85,7 @@ even if the model uses dimensional variables.

The `get_value_ptr` function takes a variable name and returns a reference
to a variable.
Unlike the array parameter returned from {ref}`get_value`,
Unlike the array parameter returned from {ref}`get-value`,
the reference always points to the current values of the variable,
even if the model's state has changed.

Expand Down Expand Up @@ -131,7 +131,7 @@ The values are returned through the *dest* argument.

**Implementation notes**

All the notes from {ref}`get_value` apply.
All the notes from {ref}`get-value` apply.
Additionally,

- Both *dest* and *inds* are flattened arrays.
Expand Down Expand Up @@ -166,7 +166,7 @@ and copies those values into the model's internal array of values,
overwriting the current contents.
The type and size of *src* must match the model's internal array,
and can be determined through
{ref}`get_var_type`, {ref}`get_var_nbytes`, etc.
{ref}`get-var-type`, {ref}`get-var-nbytes`, etc.
Recall that arrays are always flattened in BMI,
even if the model uses dimensional variables.

Expand Down Expand Up @@ -213,7 +213,7 @@ in the *inds* argument.

**Implementation notes**

All the notes from {ref}`set_value` apply.
All the notes from {ref}`set-value` apply.
Additionally,

- Both *src* and *inds* are flattened arrays.
Expand Down
10 changes: 5 additions & 5 deletions docs/source/bmi.getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ If you want to add a Basic Model Interface (BMI) to your own model,
here are some tips on getting started.

1\. Take a look at the list of BMI
{ref}`control functions and their descriptions <basic_model_interface>`
{ref}`control functions and their descriptions <basic-model-interface>`
to get an idea of what these functions are meant to do
and how they provide a standard set of controls for your model.

2\. On the theory that it's often easier to start with an example and
modify it, we recommend starting with a copy of
the {ref}`BMI example code<specs_and_examples>`---look for the version
the {ref}`BMI example code<specs-and-examples>`---look for the version
written in the language of your model---to use as a template.
Each link points to a GitHub repository that includes an
example model called "heat", and a corresponding BMI in a file called
Expand All @@ -35,15 +35,15 @@ whereas codes that are more monolithic tend to require a lot more
refactoring (but that is probably worthwhile anyway for the sake of
the quality and sustainability of the code!).
Each case is a bit different.
Be sure to check out our {ref}`BMI best practices <best_practices>` document
Be sure to check out our {ref}`BMI best practices <best-practices>` document
for tips.
We encourage you to contact us with questions by posting an
issue on the [CSDMS Help Desk].

4\. Test it out. Try writing a program or script that initializes your
model with a simple test case using the {ref}`initialize` function,
runs it with the {ref}`update` or {ref}`update_until` functions,
and exchanges data using {ref}`get_value` and {ref}`set_value`.
runs it with the {ref}`update` or {ref}`update-until` functions,
and exchanges data using {ref}`get-value` and {ref}`set-value`.
Run a test to verify that you get the same output from your BMI'd model
that you got from it prior to BMI'ing.
(Note: we recommend writing a {term}`unit test` for each of your
Expand Down
Loading

0 comments on commit 6b64972

Please sign in to comment.