Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa committed Nov 27, 2024
1 parent 834b42f commit 59dd711
Showing 1 changed file with 51 additions and 24 deletions.
75 changes: 51 additions & 24 deletions docs/sections/user_guide/yaml/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Converts the tagged node to a Python ``boolean`` object. For example, given ``in
.. code-block:: text
% uw config realize -i ../input.yaml --output-format yaml
$ uw config realize -i ../input.yaml --output-format yaml
flag1: True
flag2: True
Expand All @@ -52,7 +52,7 @@ Converts the tagged node to a Python ``datetime`` object. For example, given ``i
.. code-block:: text
% uw config realize -i ../input.yaml --output-format yaml
$ uw config realize -i ../input.yaml --output-format yaml
date1: 2024-09-01
date2: 2024-09-01 00:00:00
Expand All @@ -69,49 +69,76 @@ Converts the tagged node to a Python ``float`` value. For example, given ``input
.. code-block:: text
% uw config realize --input-file input.yaml --output-format yaml
$ uw config realize --input-file input.yaml --output-format yaml
f2: 5.859
``!int``
^^^^^^^^
``!include``
^^^^^^^^^^^^

Converts the tagged node to a Python ``int`` value. For example, given ``input.yaml``:
Load and parse the files specified in the tagged sequence value and insert their contents here. For example, given ``numbers.yaml``:

.. code-block:: yaml
f1: 3
f2: 11
f3: !int "{{ (f1 + f2) * 10 }}"
values: !include [constants.yaml]
and ``constants.yaml``:

.. code-block:: yaml
e: 2.718
pi: 3.141
.. code-block:: text
% uw config realize --input-file input.yaml --output-format yaml
f1: 3
f2: 11
f2: 140
$ uw config realize --input-file numbers.yaml --output-format yaml
values:
e: 2.718
pi: 3.141
``!include``
^^^^^^^^^^^^
Values from files later in the sequence overwrite their predecessors, and full-value replacement, not structural merging, is performed. For example, giben ``numbers.yaml``:

.. code-block:: yaml
values: !include [e.yaml, pi.yaml]
Parse the tagged file and include its tags. For example, given ``input.yaml``:
``e.yaml``:

.. code-block:: yaml
values: !include [./supplemental.yaml]
constants:
e: 2.718
and ``supplemental.yaml``:
and ``pi.yaml``:

.. code-block:: yaml
e: 2.718
pi: 3.141
constants:
pi: 3.141
.. code-block:: text
% uw config realize --input-file input.yaml --output-format yaml
$ uw config realize --input-file numbers.yaml --output-format yaml
values:
e: 2.718
pi: 3.141
constants:
pi: 3.141
``!int``
^^^^^^^^

Converts the tagged node to a Python ``int`` value. For example, given ``input.yaml``:

.. code-block:: yaml
f1: 3
f2: 11
f3: !int "{{ (f1 + f2) * 10 }}"
.. code-block:: text
$ uw config realize --input-file input.yaml --output-format yaml
f1: 3
f2: 11
f2: 140
``!remove``
^^^^^^^^^^^
Expand All @@ -131,5 +158,5 @@ and ``update.yaml``:
.. code-block:: text
% uw config realize --input-file input.yaml --update-file update.yaml --output-format yaml
$ uw config realize --input-file input.yaml --update-file update.yaml --output-format yaml
pi: 3.141

0 comments on commit 59dd711

Please sign in to comment.