Skip to content

Commit

Permalink
Merge branch 'main' into logging-update
Browse files Browse the repository at this point in the history
merge main
  • Loading branch information
Byrnetp committed Nov 26, 2024
2 parents c6a6d56 + b9f70c1 commit eaf0725
Show file tree
Hide file tree
Showing 75 changed files with 6,474 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ run_tests() {
devpkgs=$(jq .packages.dev[] recipe/meta.json | tr -d ' "')
conda create --yes --name $env --quiet python=$PYTHON_VERSION $devpkgs
conda activate $env
. notebooks/install-deps
set -x
python --version
git clean -dfx
pip install --editable src # sets new Python version in entry-point scripts
make test
make test && make test-nb
status=$?
set +x
conda deactivate
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CHANNELS = $(addprefix -c ,$(shell tr '\n' ' ' <$(RECIPE_DIR)/channels)) -c local
METADEPS = $(addprefix $(RECIPE_DIR)/,meta.yaml) src/uwtools/resources/info.json
METAJSON = $(RECIPE_DIR)/meta.json
TARGETS = clean-devenv devshell docs env format lint meta package test typecheck unittest
TARGETS = clean-devenv devshell docs env format lint meta package test test-nb typecheck unittest

export RECIPE_DIR := $(shell cd ./recipe && pwd)

Expand Down Expand Up @@ -41,6 +41,9 @@ package: meta
test:
recipe/run_test.sh

test-nb:
$(MAKE) -C notebooks test-nb

typecheck:
recipe/run_test.sh typecheck

Expand Down
6 changes: 6 additions & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: default
channels:
- conda-forge
- ufs-community
dependencies:
- uwtools
3 changes: 3 additions & 0 deletions docs/sections/user_guide/api/config.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
``uwtools.api.config``
======================

.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Fconfig.ipynb

.. automodule:: uwtools.api.config
:inherited-members: UserDict
:members:
3 changes: 3 additions & 0 deletions docs/sections/user_guide/api/fs.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
``uwtools.api.fs``
==================

.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Ffs.ipynb

.. automodule:: uwtools.api.fs
:members:
3 changes: 3 additions & 0 deletions docs/sections/user_guide/api/rocoto.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
``uwtools.api.rocoto``
======================

.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Frocoto.ipynb

.. automodule:: uwtools.api.rocoto
:members:
3 changes: 3 additions & 0 deletions docs/sections/user_guide/api/template.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
``uwtools.api.template``
========================

.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Ftemplate.ipynb

.. automodule:: uwtools.api.template
:members:
32 changes: 16 additions & 16 deletions docs/sections/user_guide/cli/drivers/mpas/show-schema.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"properties": {
"mpas": {
"additionalProperties": false,
"properties": {
"execution": {
"additionalProperties": false,
"properties": {
"batchargs": {
"additionalProperties": true,
"properties": {
"cores": {
"type": "integer"
},
"debug": {
"type": "boolean"
},
"exclusive": {
"type": "boolean"
},
"allOf": [
{
"if": {
"properties": {
"domain": {
"const": "regional"
}
}
},
"then": {
"required": [
"lateral_boundary_conditions"
]
}
}
],
2 changes: 2 additions & 0 deletions docs/sections/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ User Guide
cli/index
api/index
yaml/index

.. include:: /shared/binder_links.rst
11 changes: 8 additions & 3 deletions docs/sections/user_guide/yaml/components/mpas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ An MPAS build provides prototype versions of certain required runtime files. Her
UW YAML for the ``mpas:`` Block
-------------------------------

domain:
^^^^^^^

Accepted values are ``global`` and ``regional``.

execution:
^^^^^^^^^^

See :ref:`this page <execution_yaml>` for details.

boundary_conditions:
^^^^^^^^^^^^^^^^^^^^
lateral_boundary_conditions:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Describes the boundary condition files needed for the forecast. These will be the output from the ``init_atmosphere`` executable, which may be run using the ``mpas_init`` UW driver. Please see its documentation :ref:`here <mpas_init_yaml>`.
Describes the boundary condition files needed for a regional forecast. This section is not used when ``domain`` is set to ``global``. These will be the output from the ``init_atmosphere`` executable, which may be run using the ``mpas_init`` UW driver. Please see its documentation :ref:`here <mpas_init_yaml>`.

**interval_hours:**

Expand Down
10 changes: 5 additions & 5 deletions docs/sections/user_guide/yaml/components/mpas_init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ An MPAS build provides prototype versions of certain required runtime files. Her
UW YAML for the ``mpas_init:`` Block
------------------------------------

execution:
^^^^^^^^^^

See :ref:`this page <execution_yaml>` for details.

boundary_conditions:
^^^^^^^^^^^^^^^^^^^^

Expand All @@ -43,6 +38,11 @@ Describes the boundary condition files needed for the forecast. These will most

An absolute path to the output of the ``ungrib`` tool that will be used to prepare MPAS-ready initial and lateral boundary conditions. The names of the files are specified in the ``streams.init_atmosphere`` XML file, and may be specified in the ``streams: values:`` block of the driver YAML.

execution:
^^^^^^^^^^

See :ref:`this page <execution_yaml>` for details.

files_to_copy:
^^^^^^^^^^^^^^

Expand Down
17 changes: 17 additions & 0 deletions docs/sections/user_guide/yaml/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ Or explicit:
Additionally, UW defines the following tags to support use cases not covered by standard tags:

``!bool``
^^^^^^^^^

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

.. code-block:: yaml
flag1: True
flag2: !bool "{{ flag1 }}"
.. code-block:: text
% uw config realize -i ../input.yaml --output-format yaml
flag1: True
flag2: True
``!datetime``
^^^^^^^^^^^^^

Expand Down
13 changes: 13 additions & 0 deletions docs/shared/binder_links.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Jupyter Notebooks
-----------------

* Jupyter Notebook Tutorials (API)

* `Config Tool <https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Fconfig.ipynb>`_
* `File System Tool <https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Ffs.ipynb>`_
* `Rocoto Tool <https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Frocoto.ipynb>`_
* `Template Tool <https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Ftemplate.ipynb>`_

* Cookbooks

* `Building and Validating an Experiment Configuration <https://mybinder.org/v2/gh/ufs-community/uwtools/main?labpath=notebooks%2Fexp-config-cb.ipynb>`_
1 change: 1 addition & 0 deletions docs/shared/mpas.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mpas:
domain: regional
execution:
batchargs:
cores: 32
Expand Down
2 changes: 2 additions & 0 deletions notebooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.ipynb_checkpoints
tmp
18 changes: 18 additions & 0 deletions notebooks/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
TARGETS = format lint test-nb unittest

.PHONY: $(TARGETS)

all:
$(error Valid targets are: $(TARGETS))

format:
black tests
isort tests

lint:
pylint tests

test-nb: lint unittest

unittest:
pytest tests
Loading

0 comments on commit eaf0725

Please sign in to comment.