Skip to content

Commit

Permalink
Merge pull request #933 from MPAS-Dev/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
xylar authored Dec 1, 2022
2 parents bccde34 + 314acea commit 3b7f962
Show file tree
Hide file tree
Showing 71 changed files with 3,447 additions and 953 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# User defined config files
/config.*
!/config.default
/*.cfg

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ used those components.

## Documentation

[https://mpas-dev.github.io/MPAS-Analysis/stable/](https://mpas-dev.github.io/MPAS-Analysis/stable/)
[https://mpas-dev.github.io/MPAS-Analysis/latest/](https://mpas-dev.github.io/MPAS-Analysis/latest/)

## Installation for users

Expand Down Expand Up @@ -116,7 +116,7 @@ for more details.

## Running the analysis

1. Create and empty config file (say `config.myrun`), copy `config.example`,
1. Create and empty config file (say `myrun.cfg`), copy `example.cfg`,
or copy one of the example files in the `configs` directory (if using a
git repo) or download one from the
[example configs directory](https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop/configs).
Expand All @@ -125,9 +125,9 @@ for more details.
from GitHub:
[default.cfg](https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop/mpas_analysis/default.cfg).
3. If you installed the `mpas-analysis` package, run:
`mpas_analysis config.myrun`. This will read the configuration
`mpas_analysis myrun.cfg`. This will read the configuration
first from `mpas_analysis/default.cfg` and then replace that
configuraiton with any changes from from `config.myrun`
configuraiton with any changes from from `myrun.cfg`
4. If you want to run a subset of the analysis, you can either set the
`generate` option under `[output]` in your config file or use the
`--generate` flag on the command line. See the comments in
Expand Down Expand Up @@ -290,16 +290,15 @@ to be generated and is set up properly.

## Generating Documentation

Create a development environment as described above in "Installation for
developers". Then run:
To generate the `sphinx` documentation, run:
```
conda config --add channels conda-forge
conda remove -y --all -n mpas-analysis-docs
conda env create -f docs/environment.yml
conda install -y -n mpas-analysis-docs mock pillow sphinx sphinx_rtd_theme
conda activate mpas-analysis-docs
pip install .
rm -rf build dist mpas_analysis.egg-info
cd docs
make clean
make html
```
The results can be viewed in your web browser by opening:
```
_build/html/index.html
```
91 changes: 56 additions & 35 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,61 @@ jobs:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- bash: |
set -e
eval "$(conda shell.bash hook)"
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --yes --quiet --name build python=$PYTHON_VERSION conda conda-build
displayName: Create Anaconda build environment
conda install --yes "conda<22.11.0" conda-build mamba boa
displayName: Update conda base environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda build -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe"
conda activate
# workaround based on recent failures
rm /usr/share/miniconda/pkgs/cache/*.json
conda mambabuild -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe"
displayName: Build MPAS-Analysis
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda create --yes --quiet --name test -c ${CONDA_PREFIX}/conda-bld/ \
conda activate
mamba create --yes --quiet --name mpas -c ${CONDA_PREFIX}/conda-bld/ \
python=$PYTHON_VERSION mpas-analysis pytest
displayName: Create Anaconda test environment
displayName: Create Anaconda mpas environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate test
conda activate mpas
pytest --pyargs mpas_analysis
displayName: pytest
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda create --yes --quiet --name docs -c ${CONDA_PREFIX}/conda-bld/ \
conda activate
mamba create --yes --quiet --name docs -c ${CONDA_PREFIX}/conda-bld/ \
python=$PYTHON_VERSION mpas-analysis sphinx mock sphinx_rtd_theme \
tabulate m2r2 "mistune<2"
condition: eq(variables['python.version'], '3.9')
condition: eq(variables['python.version'], '3.10')
displayName: Create Anaconda docs environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate docs
Expand Down Expand Up @@ -128,7 +137,7 @@ jobs:
fi
popd || exit 1
fi
condition: eq(variables['python.version'], '3.9')
condition: eq(variables['python.version'], '3.10')
displayName: build and deploy docs
- job:
Expand All @@ -137,38 +146,45 @@ jobs:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- bash: |
set -e
eval "$(conda shell.bash hook)"
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --yes --quiet --name build python=$PYTHON_VERSION conda conda-build
displayName: Create Anaconda build environment
conda install --yes python=$PYTHON_VERSION "conda<22.11.0" conda-build mamba boa
displayName: Update conda base environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda build -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe"
conda activate
# workaround based on recent failures
rm /usr/share/miniconda/pkgs/cache/*.json
conda mambabuild -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe"
displayName: Build MPAS-Analysis
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda create --yes --quiet --name test -c ${CONDA_PREFIX}/conda-bld/ \
conda activate
mamba create --yes --quiet --name mpas -c ${CONDA_PREFIX}/conda-bld/ \
python=$PYTHON_VERSION mpas-analysis pytest
conda activate test
conda activate mpas
pip install git+https://github.com/pydata/xarray.git
displayName: Create Anaconda test environment
displayName: Create Anaconda mpas environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate test
conda activate mpas
pytest --pyargs mpas_analysis
displayName: pytest
Expand All @@ -178,12 +194,12 @@ jobs:
vmImage: 'macOS-latest'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
Expand All @@ -193,26 +209,31 @@ jobs:
displayName: Fix permissions

- bash: |
set -e
eval "$(conda shell.bash hook)"
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --yes --quiet --name build python=$PYTHON_VERSION conda conda-build
displayName: Create Anaconda build environment
conda install --yes "conda<22.11.0" conda-build mamba boa
displayName: Update conda base environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda build -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe"
conda activate
conda mambabuild -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe"
displayName: Build MPAS-Analysis
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate build
conda create --yes --quiet --name test -c ${CONDA_PREFIX}/conda-bld/ \
conda activate
mamba create --yes --quiet --name mpas -c ${CONDA_PREFIX}/conda-bld/ \
python=$PYTHON_VERSION mpas-analysis pytest
displayName: Create Anaconda test environment
displayName: Create Anaconda mpas environment
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate test
conda activate mpas
pytest --pyargs mpas_analysis
displayName: pytest
2 changes: 1 addition & 1 deletion ci/python3.8.yaml → ci/python3.11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pin_run_as_build:
min_pin: x.x
max_pin: x.x
python:
- 3.8.* *_cpython
- 3.11.* *_cpython
3 changes: 2 additions & 1 deletion ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "MPAS-Analysis" %}
{% set version = "1.7.2" %}
{% set version = "1.8.0" %}

package:
name: {{ name|lower }}
Expand Down Expand Up @@ -27,6 +27,7 @@ requirements:
- cartopy_offlinedata
- cmocean
- dask
- esmf >=8.0.0,<8.3.0
- esmf=*=nompi_*
- f90nml
- geometric_features >=0.5.0
Expand Down
1 change: 1 addition & 0 deletions dev-spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cartopy >=0.18.0
cartopy_offlinedata
cmocean
dask
esmf >=8.0.0,<8.3.0
esmf=*=nompi_*
f90nml
geometric_features>=0.5.0
Expand Down
20 changes: 4 additions & 16 deletions docs/developers_guide/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ Ocean tasks

ComputeAnomalySubtask

.. currentmodule:: mpas_analysis.ocean.plot_climatology_map_subtask

.. autosummary::
:toctree: generated/

PlotClimatologyMapSubtask
PlotClimatologyMapSubtask.set_plot_info

.. currentmodule:: mpas_analysis.ocean.plot_depth_integrated_time_series_subtask

.. autosummary::
Expand Down Expand Up @@ -126,14 +118,6 @@ Sea ice tasks
TimeSeriesSeaIce
ClimatologyMapIcebergConc

.. currentmodule:: mpas_analysis.sea_ice.plot_climatology_map_subtask

.. autosummary::
:toctree: generated/

PlotClimatologyMapSubtask
PlotClimatologyMapSubtask.set_plot_info


Shared modules
==============
Expand Down Expand Up @@ -267,6 +251,10 @@ Plotting
ticks.plot_xtick_format
add_inset

PlotClimatologyMapSubtask
PlotClimatologyMapSubtask.set_plot_info



Projection
----------
Expand Down
6 changes: 6 additions & 0 deletions docs/users_guide/analysis_tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ Analysis Tasks
tasks/geojsonTransects
tasks/oceanRegionalProfiles
tasks/regionalTSDiagrams
tasks/oceanHistogram

tasks/climatologyMapSeaIceConcNH
tasks/climatologyMapSeaIceThickNH
tasks/climatologyMapSeaIceConcSH
tasks/climatologyMapSeaIceThickSH
tasks/timeSeriesSeaIceAreaVol

tasks/climatologyMapSeaIceProductionNH
tasks/climatologyMapSeaIceMeltingNH
tasks/climatologyMapSeaIceProductionSH
tasks/climatologyMapSeaIceMeltingSH

tasks/climatologyMapIcebergConcSH
4 changes: 2 additions & 2 deletions docs/users_guide/config/output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ Finally, we note that the ``generate`` option in the configuration file can
be overridden by specifying the ``--generate`` option on the command line::

mpas_analysis --generate=all_publicObs,no_index,no_climatologyMapSST \
config.my_run
my_run.cfg

This example would override whatever ``generate`` option was specified in
``config.my_run`` with a directive to generate only tasks that support the
``my_run.cfg`` with a directive to generate only tasks that support the
publicly available observations, skipping those using climate indices (e.g.
El Ni |n~| o 3.4) and also skipping ``climatologyMapSST``.

Expand Down
12 changes: 6 additions & 6 deletions docs/users_guide/config/regions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ web page.
Region Groups
-------------

Currently, seven analysis tasks (:ref:`task_climatologyMapAntarcticMelt`,
Currently, eight analysis tasks (:ref:`task_climatologyMapAntarcticMelt`,
:ref:`task_hovmollerOceanRegions`, :ref:`task_oceanRegionalProfiles`,
:ref:`task_regionalTSDiagrams`, :ref:`task_streamfunctionMOC`,
:ref:`task_timeSeriesAntarcticMelt`, and :ref:`task_timeSeriesOceanRegions`)
use masks that define regions in an MPAS mesh as part of their analysis. Most
of these region group are defined in
:ref:`task_oceanHistogram`, :ref:`task_timeSeriesAntarcticMelt`, and
:ref:`task_timeSeriesOceanRegions`) use masks that define regions in an MPAS
mesh as part of their analysis. Most of these region group are defined in
:py:func:`geometric_features.aggregation.get_aggregator_by_name()`.
Several tasks (:ref:`task_hovmollerOceanRegions`,
Several tasks (:ref:`task_hovmollerOceanRegions`, :ref:`task_oceanHistogram`,
:ref:`task_oceanRegionalProfiles`, :ref:`task_regionalTSDiagrams`, and
:ref:`task_timeSeriesOceanRegions`) can use any of the defined region groups.
Currently, available region groups are: ``Antarctic Regions``,
Currently, available region groups are: ``Artic Ocean Regions``, ``Antarctic Regions``,
``Ocean Basins``, ``Ice Shelves``, and ``Ocean Subbasins``.

The option ``regionMaskSubdirectory`` in the ``[diagnostics]`` section specifies
Expand Down
4 changes: 2 additions & 2 deletions docs/users_guide/config/runs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Once the analysis has been run on the control run, a comparison is made by
uncommenting ``controlRunConfigFile`` and specifying the path to the
configuration file use in this analysis, e.g.::

controlRunConfigFile = config.control_run
controlRunConfigFile = control_run.cfg

If analysis has already been run on the "main" run in a "main vs ref"
comparison, some time can be saved in performing the comparison
Expand Down Expand Up @@ -101,6 +101,6 @@ Specify the path to the configuration file use in "main" analysis by
uncommenting the option and providing a relative or absolute path to the
config file::

mainRunConfigFile = config.main_run
mainRunConfigFile = main_run.cfg


Loading

0 comments on commit 3b7f962

Please sign in to comment.