Skip to content

Commit 3842960

Browse files
authored
Merge pull request #1077 from MPAS-Dev/develop
Merge develop into main for v1.13.0 release
2 parents 32a8a46 + 05c946d commit 3842960

File tree

199 files changed

+11035
-1408
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+11035
-1408
lines changed

.github/pull_request_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Please add a description of what is accomplished in the PR here at the top:
44
-->
55

66
<!--
7-
Below are a few things we ask you or your reviewers to kindly check.
7+
Below are a few things we ask you or your reviewers to kindly check.
88
***Remove checks that are not relevant by deleting the line(s) below.***
99
-->
1010
Checklist
1111
* [ ] User's Guide has been updated
1212
* [ ] If this PR adds a new analysis task, it has also been added to the user's guide
1313
* [ ] Developer's Guide has been updated
1414
* [ ] API documentation in the Developer's Guide (`api.rst`) has any new or modified class, method and/or functions listed
15-
* [ ] Documentation has been [built locally](https://mpas-dev.github.io/MPAS-Analysis/latest/users_guide/quick_start.html#generating-documentation) and changes look as expected
15+
* [ ] Documentation has been [built locally](https://mpas-dev.github.io/MPAS-Analysis/develop/users_guide/quick_start.html#generating-documentation) and changes look as expected
1616
* [ ] `Testing` comment in the PR documents testing used to verify the changes
1717

1818
<!--

.github/workflows/build_workflow.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
shell: bash -l {0}
2828
strategy:
2929
matrix:
30-
python-version: ["3.10", "3.11", "3.12"]
30+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
31+
fail-fast: false
3132
steps:
3233
- id: skip_check
3334
uses: fkirc/skip-duplicate-actions@master
@@ -45,10 +46,10 @@ jobs:
4546
# Increase this value to reset cache if conda-dev-spec.template has not changed in the workflow
4647
CACHE_NUMBER: 0
4748
with:
48-
path: ~/conda_pkgs_dir
49+
path: ~/conda_pkgs_dir_py${{ matrix.python-version }}
4950
key:
5051
${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{
51-
hashFiles('dev-spec.txt,setup.py') }}
52+
hashFiles('dev-spec.txt,pyproject.toml') }}
5253

5354
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
5455
name: Set up Conda Environment
@@ -58,7 +59,7 @@ jobs:
5859
miniforge-version: latest
5960
channels: conda-forge
6061
channel-priority: strict
61-
auto-update-conda: true
62+
auto-update-conda: false
6263
python-version: ${{ matrix.python-version }}
6364

6465
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}

.github/workflows/docs_workflow.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
release:
1010
types: [published]
1111

12+
env:
13+
PYTHON_VERSION: "3.13"
14+
1215
jobs:
1316
publish-docs:
1417
runs-on: ubuntu-latest
@@ -40,15 +43,15 @@ jobs:
4043
miniforge-version: latest
4144
channels: conda-forge
4245
channel-priority: strict
43-
auto-update-conda: true
44-
python-version: ${{ matrix.python-version }}
46+
auto-update-conda: false
47+
python-version: ${{ env.PYTHON_VERSION }}
4548

4649
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
4750
name: Install mpas_analysis
4851
run: |
4952
git config --global url."https://github.com/".insteadOf "[email protected]:"
5053
conda create -n mpas_analysis_dev --file dev-spec.txt \
51-
python=${{ matrix.python-version }}
54+
python=${{ env.PYTHON_VERSION }}
5255
conda activate mpas_analysis_dev
5356
python -m pip install -vv --no-deps --no-build-isolation -e .
5457

MANIFEST.in

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
include mpas_analysis/*.cfg
2+
include mpas_analysis/obs/analysis_input_files
3+
include mpas_analysis/obs/sose_10000km_input_files
4+
include mpas_analysis/obs/observational_datasets.xml
5+
6+
include mpas_analysis/configuration/*.cfg
7+
include mpas_analysis/shared/html/templates/*
8+
include mpas_analysis/shared/plot/ScientificColourMaps7/*/*.xml
9+
include mpas_analysis/shared/plot/SciVisColorColormaps/*.xml
10+
include mpas_analysis/shared/plot/SciVisColorCustom/*.xml
11+
include mpas_analysis/test/test*/*
12+
include mpas_analysis/test/test*/*/*

ci/python3.13.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
channel_sources:
2+
- conda-forge,defaults
3+
pin_run_as_build:
4+
python:
5+
min_pin: x.x
6+
max_pin: x.x
7+
python:
8+
- 3.13.* *_cp313

ci/python3.9.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
channel_sources:
2+
- conda-forge,defaults
3+
pin_run_as_build:
4+
python:
5+
min_pin: x.x
6+
max_pin: x.x
7+
python:
8+
- 3.9.* *_cpython

ci/recipe/meta.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "MPAS-Analysis" %}
2-
{% set version = "1.12.0" %}
2+
{% set version = "1.13.0" %}
33

44
package:
55
name: {{ name|lower }}
@@ -12,29 +12,27 @@ build:
1212
number: 0
1313
script: {{ PYTHON }} -m pip install --no-deps --no-build-isolation -vv .
1414
noarch: python
15-
entry_points:
16-
- mpas_analysis = mpas_analysis.__main__:main
17-
- download_analysis_data = mpas_analysis.download_data:download_analysis_data
1815

1916
requirements:
2017
host:
2118
- python >=3.9
2219
- pip
20+
- setuptools
2321
run:
2422
- python >=3.9
2523
- cartopy >=0.18.0
2624
- cartopy_offlinedata
2725
- cmocean
2826
- dask
29-
- esmf >=8.4.2,<8.7.0
27+
- esmf >=8.4.2,<9.0.0
3028
- esmf=*=mpi_mpich_*
3129
- f90nml
32-
- geometric_features >=1.4.0
30+
- geometric_features >=1.6.1
3331
- gsw
3432
- lxml
3533
- mache >=1.11.0
3634
- matplotlib-base >=3.9.0
37-
- mpas_tools >=0.34.0
35+
- mpas_tools >=0.34.1,<1.0.0
3836
- nco >=4.8.1,!=5.2.6
3937
- netcdf4
4038
- numpy >=2.0,<3.0
@@ -61,6 +59,8 @@ test:
6159
- pip check
6260
- pytest --pyargs mpas_analysis
6361
- mpas_analysis --help
62+
- mpas_analysis --list
63+
- mpas_analysis --plot_colormaps
6464
- download_analysis_data --help
6565

6666
about:

dev-spec.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ cartopy >=0.18.0
77
cartopy_offlinedata
88
cmocean
99
dask
10-
esmf >=8.4.2,<8.7.0
10+
esmf >=8.4.2,<9.0.0
1111
esmf=*=mpi_mpich_*
1212
f90nml
13-
geometric_features>=1.4.0
13+
geometric_features>=1.6.1
1414
gsw
1515
lxml
1616
mache >=1.11.0
1717
matplotlib-base>=3.9.0
18-
mpas_tools>=0.34.1
18+
mpas_tools>=0.34.1,<1.0.0
1919
nco>=4.8.1,!=5.2.6
2020
netcdf4
2121
numpy>=2.0,<3.0

docs/authors.rst

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Contributors
1919
* Greg Streletz
2020
* Adrian Turner
2121
* Luke Van Roekel
22+
* Elizabeth Hunke
2223

2324
For a list of all the contributions:
2425
https://github.com/MPAS-Dev/MPAS-Analysis/graphs/contributors

docs/conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import os
1616
import m2r2
1717
from glob import glob
18-
import mpas_analysis
18+
import mpas_analysis.version
1919
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
2020
if on_rtd:
2121
os.environ['PROJ_LIB'] = '{}/{}/share/proj'.format(
@@ -87,9 +87,9 @@
8787
release = version
8888
else:
8989
# The short X.Y.Z version.
90-
version = mpas_analysis.__version__
90+
version = mpas_analysis.version.__version__
9191
# The full version, including alpha/beta/rc tags.
92-
release = mpas_analysis.__version__
92+
release = mpas_analysis.version.__version__
9393

9494
# The language for content autogenerated by Sphinx. Refer to documentation
9595
# for a list of supported languages.
@@ -187,9 +187,9 @@
187187
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
188188
'xarray': ('http://xarray.pydata.org/en/stable/', None),
189189
'geometric_features':
190-
('http://mpas-dev.github.io/geometric_features/stable/', None),
190+
('http://mpas-dev.github.io/geometric_features/main/', None),
191191
'mpas_tools':
192-
('http://mpas-dev.github.io/MPAS-Tools/stable/', None)}
192+
('http://mpas-dev.github.io/MPAS-Tools/master/', None)}
193193

194194

195195
cwd = os.getcwd()

docs/developers_guide/api.rst

+35
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ Ocean tasks
7373
ClimatologyMapAntarcticMelt
7474
ClimatologyMapSose
7575
ClimatologyMapVel
76+
ClimatologyMapWoa
7677
ClimatologyMapArgoTemperature
7778
ClimatologyMapArgoSalinity
7879
ClimatologyMapWaves
7980
IndexNino34
8081
MeridionalHeatTransport
8182
OceanHistogram
83+
OceanRegionalProfiles
84+
RegionalTSDiagrams
85+
SoseTransects
8286
StreamfunctionMOC
8387
TimeSeriesOHCAnomaly
8488
TimeSeriesTemperatureAnomaly
@@ -87,6 +91,11 @@ Ocean tasks
8791
TimeSeriesAntarcticMelt
8892
TimeSeriesOceanRegions
8993
TimeSeriesTransport
94+
WoaTransects
95+
WoceTransects
96+
97+
Ocean subtasks
98+
--------------
9099

91100
.. currentmodule:: mpas_analysis.ocean.compute_anomaly_subtask
92101

@@ -110,6 +119,19 @@ Ocean tasks
110119
PlotHovmollerSubtask
111120

112121

122+
Ocean utilities
123+
---------------
124+
125+
.. currentmodule:: mpas_analysis.ocean.utility
126+
127+
.. autosummary::
128+
:toctree: generated/
129+
130+
add_standard_regions_and_subset
131+
get_standard_region_names
132+
compute_zmid
133+
134+
113135
Sea ice tasks
114136
-------------
115137

@@ -120,6 +142,19 @@ Sea ice tasks
120142

121143
ClimatologyMapSeaIceConc
122144
ClimatologyMapSeaIceThick
145+
ClimatologyMapSeaIceSnowDepth
146+
ClimatologyMapSeaIceSnowiceFormation
147+
ClimatologyMapSeaIceSnowMelt
148+
ClimatologyMapSeaIcePondArea
149+
ClimatologyMapSeaIceAreaFractionRidge
150+
ClimatologyMapSeaIceVolumeRidge
151+
ClimatologyMapSeaIceAlbedo
152+
ClimatologyMapSeaIceProduction
153+
ClimatologyMapSeaIceMelting
154+
ClimatologyMapSeaIceAreaTendencyThermo
155+
ClimatologyMapSeaIceAreaTendencyTransp
156+
ClimatologyMapSeaIceVolumeTendencyThermo
157+
ClimatologyMapSeaIceVolumeTendencyTransp
123158
TimeSeriesSeaIce
124159
ClimatologyMapIcebergConc
125160

docs/tutorials/dev_add_task.rst

+61-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ analysis task that is as close as possible to the new analysis, and to copy
99
that existing task as a template for the new task. That is the strategy we
1010
will demonstrate here.
1111

12+
.. note::
13+
14+
The changes will not be broadly available until the next MPAS-Analysis
15+
release and to the broader E3SM community after the next
16+
`E3SM-Unified <https://github.com/E3SM-Project/e3sm-unified>`_ release.
17+
1218
To provide a real example, we will show how we copy and modify an analysis
1319
task used to compute the anomaly in ocean heat content
1420
(:py:class:`~mpas_analysis.ocean.ClimatologyMapOHCAnomaly`) to instead compute
@@ -22,6 +28,22 @@ notebooks include hard-coded paths and are otherwise not easily applied to new
2228
simulations without considerable effort. This is the motivation for adapting
2329
the code to MPAS-Analysis.
2430

31+
32+
.. note::
33+
34+
If one just wishes to add a new field that already exists in MPAS-Ocean or
35+
MPAS-Seaice output, only a few of the steps below are necessary:
36+
37+
1. Follow step 1 to set up an ```mpas_dev``` environment.
38+
2. Copy an existing `ocean <https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop/mpas_analysis/ocean>`_
39+
or `sea_ice <https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop/mpas_analysis/sea_ice>`_
40+
python module to a new name and edit it as needed for the new fields.
41+
3. Follow step 6 to add config options
42+
4. Follow step 7 to add the task to the list of tasks known to
43+
MPAS-Analysis
44+
5. Follow step 8 to update Analysis Tasks in the user's guide and
45+
``api.rst`` in the developer's guide to include the new analysis task.
46+
2547
1. Getting started
2648
------------------
2749

@@ -31,6 +53,14 @@ cloning it onto the machine(s) where you will do your development, making
3153
a worktree for the feature you will develop, creating a conda environment for
3254
testing your new MPAS-Analysis development, and running MPAS-Analysis.
3355

56+
.. note::
57+
58+
Make sure you follow the tutorial for developers, not for users, since the
59+
tutorial for users installs the latest release of MPAS-Analysis, which you
60+
cannot modify. Similarly, changes must be tested in your own development
61+
environment (often called ``mpas_dev``) rather than the in a shared
62+
environment like `E3SM-Unified <https://github.com/E3SM-Project/e3sm-unified>`_.
63+
3464
Then, please follow the :ref:`tutorial_understand_a_task`. This will give
3565
you a tour of the :py:class:`~mpas_analysis.ocean.ClimatologyMapOHCAnomaly`
3666
analysis task that we will use as a starting point for developing a new task.
@@ -513,12 +543,12 @@ task to the new name:
513543
cd ../add_climatology_map_bsf
514544
cp mpas_analysis/ocean/climatology_map_ohc_anomaly.py mpas_analysis/ocean/climatology_map_bsf.py
515545
516-
Then, I'll open this new worktree in PyCharm. (You can, of course, use
546+
Then, I'll open this new worktree in VS Code. (You can, of course, use
517547
whatever editor you like.)
518548

519549
.. code-block:: bash
520550
521-
pycharm-community .
551+
code .
522552
523553
I'll create or recreate my ``mpas_dev`` environment as in
524554
:ref:`tutorial_dev_getting_started`, and then make sure to at least do:
@@ -528,6 +558,9 @@ I'll create or recreate my ``mpas_dev`` environment as in
528558
conda activate mpas_dev
529559
python -m pip install --no-deps --no-build-isolation -e .
530560
561+
This last command installs the ``mpas_analysis`` package into the conda
562+
environment.
563+
531564
4.1 ``ClimatologyMapBSF`` class
532565
-------------------------------
533566

@@ -1092,7 +1125,32 @@ A quick way to check if the task has been added correctly is to run:
10921125
You should see the new task in the list of tasks.
10931126

10941127

1095-
8. The full code for posterity
1128+
8. Adding documentation
1129+
-----------------------
1130+
1131+
You need to add the task to the documentation. The easiest way to do this
1132+
is to copy an existing task's documentation (the more similar, the better) in
1133+
the `tasks <https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop/docs/users_guide/tasks>`_
1134+
directory and then modify it.
1135+
1136+
You also need to add the tasks class and public methods to the
1137+
`api.rst <https://github.com/MPAS-Dev/MPAS-Analysis/blob/develop/docs/developers_guide/api.rst>`_
1138+
in the developer's guide. Again, the easiest approach is to copy the section
1139+
for a similar task and modify as needed.
1140+
1141+
With the ``mpas_dev`` environment activated, you can run:
1142+
1143+
.. code-block:: bash
1144+
1145+
cd docs
1146+
make clean html
1147+
1148+
to build the docs locally in the ``_build/html`` subdirectory. When generating
1149+
documentation on HPC machines, you will want to copy the html output to the
1150+
public web space to view it, or if the web portal is being cranky, scp it to
1151+
your local machine.
1152+
1153+
9. The full code for posterity
10961154
------------------------------
10971155

10981156
Since the ``ClimatologyMapBSF`` analysis task is not in MPAS-Analysis yet and

0 commit comments

Comments
 (0)