Skip to content

Commit

Permalink
Add --show-schema support to drivers (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa authored Aug 23, 2024
1 parent 161823b commit 6273086
Show file tree
Hide file tree
Showing 140 changed files with 1,176 additions and 218 deletions.
1 change: 1 addition & 0 deletions docs/sections/user_guide/cli/drivers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
schema
9 changes: 8 additions & 1 deletion docs/sections/user_guide/cli/drivers/cdeps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@ Its contents are described in depth in section :ref:`cdeps_yaml`. Each of the va
The driver creates a ``datm_in`` Fortran namelist file and a ``datm.streams`` stream-configuration file in the directory specified by ``rundir:`` in the config.


* Specifying the ``--dry-run`` flag results in the driver logging messages about actions it would have taken, without actually taking any.

.. code-block:: text
$ uw cdeps run --config-file config.yaml --cycle 2023-12-15T18 --batch --dry-run
.. include:: /shared/key_path.rst

* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: cdeps/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: cdeps/show-schema.out
:language: text
4 changes: 3 additions & 1 deletion docs/sections/user_guide/cli/drivers/cdeps/help.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw cdeps [-h] [--version] TASK ...
usage: uw cdeps [-h] [--version] [--show-schema] TASK ...

Execute cdeps tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
2 changes: 2 additions & 0 deletions docs/sections/user_guide/cli/drivers/cdeps/show-schema.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw cdeps --show-schema >schema
head schema && echo ... && tail schema
21 changes: 21 additions & 0 deletions docs/sections/user_guide/cli/drivers/cdeps/show-schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$defs": {
"streams": {
"additionalProperties": false,
"minProperties": 1,
"patternProperties": {
"^stream0[1-9]$": {
"additionalProperties": false,
"properties": {
"dtlimit": {
...
"required": [
"rundir"
]
}
},
"required": [
"cdeps"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/chgres_cube.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,11 @@ Its contents are described in depth in section :ref:`chgres_cube_yaml`. Each of
.. code-block:: text
$ uw chgres_cube provisioned_rundir --config-file config.yaml --cycle 2023-12-15T18 --batch
* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: chgres_cube/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: chgres_cube/show-schema.out
:language: text
4 changes: 3 additions & 1 deletion docs/sections/user_guide/cli/drivers/chgres_cube/help.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw chgres_cube [-h] [--version] TASK ...
usage: uw chgres_cube [-h] [--version] [--show-schema] TASK ...

Execute chgres_cube tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw chgres_cube --show-schema >schema
head schema && echo ... && tail schema
21 changes: 21 additions & 0 deletions docs/sections/user_guide/cli/drivers/chgres_cube/show-schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"properties": {
"chgres_cube": {
"additionalProperties": false,
"properties": {
"execution": {
"additionalProperties": false,
"properties": {
"batchargs": {
"additionalProperties": true,
...
"rundir"
],
"type": "object"
}
},
"required": [
"chgres_cube"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/esg_grid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,11 @@ The driver creates a ``runscript.esg_grid`` file in the directory specified by `
.. code-block:: text
$ uw esg_grid provisioned_rundir --config-file config.yaml --batch
* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: esg_grid/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: esg_grid/show-schema.out
:language: text
4 changes: 3 additions & 1 deletion docs/sections/user_guide/cli/drivers/esg_grid/help.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw esg_grid [-h] [--version] TASK ...
usage: uw esg_grid [-h] [--version] [--show-schema] TASK ...

Execute esg_grid tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
2 changes: 2 additions & 0 deletions docs/sections/user_guide/cli/drivers/esg_grid/show-schema.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw esg_grid --show-schema >schema
head schema && echo ... && tail schema
21 changes: 21 additions & 0 deletions docs/sections/user_guide/cli/drivers/esg_grid/show-schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$defs": {
"base_file": {
"type": "string"
},
"namelist_content": {
"additionalproperties": false,
"properties": {
"regional_grid_nml": {
"additionalProperties": false,
...
"rundir"
],
"type": "object"
}
},
"required": [
"esg_grid"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/filter_topo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ Its contents are described in section :ref:`filter_topo_yaml`.
$ uw filter_topo run --config-file config.yaml --batch --dry-run
.. include:: /shared/key_path.rst

* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: filter_topo/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: filter_topo/show-schema.out
:language: text
4 changes: 3 additions & 1 deletion docs/sections/user_guide/cli/drivers/filter_topo/help.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw filter_topo [-h] [--version] TASK ...
usage: uw filter_topo [-h] [--version] [--show-schema] TASK ...

Execute filter_topo tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw filter_topo --show-schema >schema
head schema && echo ... && tail schema
21 changes: 21 additions & 0 deletions docs/sections/user_guide/cli/drivers/filter_topo/show-schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"properties": {
"filter_topo": {
"additionalProperties": false,
"properties": {
"config": {
"additionalProperties": false,
"properties": {
"input_grid_file": {
"type": "string"
...
"rundir"
],
"type": "object"
}
},
"required": [
"filter_topo"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/fv3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@ The examples use a configuration file named ``config.yaml``. Its contents are de
.. code-block:: text
$ uw fv3 provisioned_rundir --config-file config.yaml --cycle 2024-02-11T12 --batch
* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: fv3/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: fv3/show-schema.out
:language: text
4 changes: 3 additions & 1 deletion docs/sections/user_guide/cli/drivers/fv3/help.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw fv3 [-h] [--version] TASK ...
usage: uw fv3 [-h] [--version] [--show-schema] TASK ...

Execute fv3 tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
2 changes: 2 additions & 0 deletions docs/sections/user_guide/cli/drivers/fv3/show-schema.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw fv3 --show-schema >schema
head schema && echo ... && tail schema
21 changes: 21 additions & 0 deletions docs/sections/user_guide/cli/drivers/fv3/show-schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"properties": {
"fv3": {
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"domain": {
"const": "regional"
...
"rundir"
],
"type": "object"
}
},
"required": [
"fv3"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/global_equiv_resol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ Its contents are described in section :ref:`global_equiv_resol_yaml`.
$ uw global_equiv_resol run --config-file config.yaml --batch --dry-run
.. include:: /shared/key_path.rst

* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: global_equiv_resol/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: global_equiv_resol/show-schema.out
:language: text
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw global_equiv_resol [-h] [--version] TASK ...
usage: uw global_equiv_resol [-h] [--version] [--show-schema] TASK ...

Execute global_equiv_resol tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw global_equiv_resol --show-schema >schema
head schema && echo ... && tail schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"properties": {
"global_equiv_resol": {
"additionalProperties": false,
"properties": {
"execution": {
"additionalProperties": false,
"properties": {
"batchargs": {
"additionalProperties": true,
...
"rundir"
],
"type": "object"
}
},
"required": [
"global_equiv_resol"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/ioda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ The driver creates a ``runscript.ioda`` file in the directory specified by ``run
$ uw ioda run --config-file config.yaml --cycle 2024-05-22T12 --batch --dry-run
.. include:: /shared/key_path.rst

* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: ioda/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: ioda/show-schema.out
:language: text
4 changes: 3 additions & 1 deletion docs/sections/user_guide/cli/drivers/ioda/help.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usage: uw ioda [-h] [--version] TASK ...
usage: uw ioda [-h] [--version] [--show-schema] TASK ...

Execute ioda tasks

Expand All @@ -7,6 +7,8 @@ Optional arguments:
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit

Positional arguments:
TASK
Expand Down
2 changes: 2 additions & 0 deletions docs/sections/user_guide/cli/drivers/ioda/show-schema.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uw ioda --show-schema >schema
head schema && echo ... && tail schema
21 changes: 21 additions & 0 deletions docs/sections/user_guide/cli/drivers/ioda/show-schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"properties": {
"ioda": {
"additionalProperties": false,
"properties": {
"configuration_file": {
"additionalProperties": false,
"anyOf": [
{
"required": [
...
"rundir"
],
"type": "object"
}
},
"required": [
"ioda"
],
"type": "object"
}
8 changes: 8 additions & 0 deletions docs/sections/user_guide/cli/drivers/jedi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ The driver creates a ``runscript.jedi`` file in the directory specified by ``run
$ uw jedi run --config-file config.yaml --cycle 2024-05-22T12 --batch --dry-run
.. include:: /shared/key_path.rst

* Specifying the ``--show-schema`` flag, with no other options, prints the driver's schema:

.. literalinclude:: jedi/show-schema.cmd
:language: text
:emphasize-lines: 1
.. literalinclude:: jedi/show-schema.out
:language: text
Loading

0 comments on commit 6273086

Please sign in to comment.