Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Nov 18, 2024
1 parent 6e1c3dc commit a97b130
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
22 changes: 10 additions & 12 deletions docs/configs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,33 @@ This document provides an overview of the configuration to provide to
the :ref:`anemoi-inference run <run-cli>` command line tool.

The configuration file is a YAML file that specifies various options. It
is composed of :ref:`top level <top-level>` options which are usially
is composed of :ref:`top level <top-level>` options which are usually
simple values such as strings, number or booleans. The configuration
also provide ways to specify which internal classes to use for the
:ref:`inputs <inputs>` and :ref:`outputs <outputs>`, and how to
configure them.

In that case, the configuration as the format as show below. The key
``kind`` corresponds to and underlying Python class that will be used to
process the input, output or any other polymorphic behaviour.
In that case, the general format is shown below. The first entry
(``mars`` or ``grib`` in the examples below) corresponds to the
underlying Python class that will be used to process the input, output
or any other polymorphic behaviour, followed by arguments specific to
that class.

.. literalinclude:: introduction_1.yaml
:language: yaml

If the underlying class does not require any arguments, or you wish to
use the default parameters, you can use the following format:
or:

.. literalinclude:: introduction_2.yaml
:language: yaml

For example, the following configuration specifies the use of the
``grib`` input class, from which to read the initial conditions, and the
``printer`` output class, which prints the minimum and maximum values of
a few fields at each forecasting time step.
If the underlying class does not require any arguments, or you wish to
use the default parameters, then configuration can be simplified as:

.. literalinclude:: introduction_3.yaml
:language: yaml

When a class has a single argument you can ommite the key and directly
provide the value. The previous example can be simplified as:
or if it expects a single argument, it can be simplified as:

.. literalinclude:: introduction_4.yaml
:language: yaml
7 changes: 3 additions & 4 deletions docs/configs/introduction_1.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
input:
kind:
param1: value1
param2: value2
...: ...
mars:
class: ea
stream: oper
4 changes: 3 additions & 1 deletion docs/configs/introduction_2.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
input: kind
input:
grib:
path: /path/to/grib/file.grib
6 changes: 1 addition & 5 deletions docs/configs/introduction_3.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
input:
grib:
path: /path/to/grib/file.grib

output: printer
input: mars
2 changes: 0 additions & 2 deletions docs/configs/introduction_4.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
input:
grib: /path/to/grib/file.grib

output: printer
4 changes: 4 additions & 0 deletions docs/configs/introduction_5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
input:
grib: /path/to/grib/file.grib

output: printer

0 comments on commit a97b130

Please sign in to comment.