Skip to content

Commit e2bec52

Browse files
committed
Clean up docs and docstrings
Fix various formatting errors causing warnings in docs build.
1 parent 190d942 commit e2bec52

File tree

9 files changed

+53
-27
lines changed

9 files changed

+53
-27
lines changed

conda_package/docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BUILDDIR = _build
1212
# make versioned-html # normal
1313
# make versioned-html WERROR=1 # treat warnings as errors
1414
ifeq ($(WERROR),1)
15-
SPHINXWARNOPTS = -nW --keep-going
15+
SPHINXWARNOPTS = -W --keep-going
1616
else
1717
SPHINXWARNOPTS =
1818
endif

conda_package/docs/api.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _api_reference:
2+
13
#############
24
API reference
35
#############
@@ -375,8 +377,8 @@ Visualization
375377
:toctree: generated/
376378

377379
MpasToXdmf
378-
MpasToXdmf.load()
379-
MpasToXdmf.convert_to_xdmf()
380+
MpasToXdmf.load
381+
MpasToXdmf.convert_to_xdmf
380382
main
381383

382384
.. currentmodule:: mpas_tools.viz.mesh_to_triangles

conda_package/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179

180180
# Example configuration for intersphinx: refer to the Python standard library.
181181
intersphinx_mapping = {
182-
'python': ('https://docs.python.org/', None),
182+
'python': ('https://docs.python.org/3/', None),
183183
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
184184
'xarray': ('http://xarray.pydata.org/en/stable/', None),
185185
'geometric_features':

conda_package/docs/interpolation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.. _mesh_interpolation:
2-
31
.. |---| unicode:: U+2014 .. em dash, trimming surrounding whitespace
42
:trim:
53

4+
.. _mesh_interpolation:
5+
66
*************
77
Interpolation
88
*************

conda_package/docs/mesh_conversion.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,23 @@ Extensibility and Limitations
266266
- For advanced use cases (e.g., custom mask types or additional properties),
267267
see the source code and docstrings for guidance.
268268

269-
See also the API documentation for :py:mod:`mpas_tools.mesh.mask` for further details.
269+
See also the API documentation for :py:mod:`mpas_tools.mesh.mask` for further
270+
details.
270271

271-
See also the API documentation for :py:mod:`mpas_tools.mesh.mask` for further details.
272+
.. code-block::
273+
274+
$ compute_mpas_region_masks --help
275+
usage: compute_mpas_region_masks [-h] -m MESH_FILE_NAME -g GEOJSON_FILE_NAME
276+
-o MASK_FILE_NAME
277+
[-t MASK_TYPES [MASK_TYPES ...]]
278+
[-c CHUNK_SIZE] [--show_progress]
279+
[-s SUBDIVISION]
280+
[--process_count PROCESS_COUNT]
281+
[--multiprocessing_method MULTIPROCESSING_METHOD]
282+
283+
optional arguments:
284+
-h, --help show this help message and exit
285+
-m MESH_FILE_NAME, --mesh_file_name MESH_FILE_NAME
272286
An MPAS mesh file
273287
-g GEOJSON_FILE_NAME, --geojson_file_name GEOJSON_FILE_NAME
274288
An Geojson file containing mask regions

conda_package/docs/mesh_creation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.. _mesh_creation:
2-
31
.. |---| unicode:: U+2014 .. em dash, trimming surrounding whitespace
42
:trim:
53

4+
.. _mesh_creation:
5+
66
*************
77
Mesh Creation
88
*************

conda_package/docs/mpas_to_xdmf.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ The converter can be used via its command-line interface ``mpas_to_xdmf`` or as
2626
a Python library.
2727

2828
.. note::
29-
Special variable keys:
30-
- ``allOnCells``: all variables with dimension ``nCells``
31-
- ``allOnEdges``: all variables with dimension ``nEdges``
32-
- ``allOnVertices``: all variables with dimension ``nVertices``
33-
Extra dimensions (e.g., ``nVertLevels``) can be sliced using the ``-d``
34-
CLI option or the ``extra_dims`` argument in Python.
29+
30+
Special variable keys:
31+
32+
- ``allOnCells``: all variables with dimension ``nCells``
33+
- ``allOnEdges``: all variables with dimension ``nEdges``
34+
- ``allOnVertices``: all variables with dimension ``nVertices``
35+
36+
Extra dimensions (e.g., ``nVertLevels``) can be sliced using the ``-d``
37+
CLI option or the ``extra_dims`` argument in Python.
3538

3639
Command-Line Arguments
3740
----------------------

conda_package/docs/releasing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ Version Bump and Dependency Updates
1717
- ``conda_package/mpas_tools/__init__.py``
1818
- ``conda_package/recipe/meta.yaml``
1919

20-
- Make sure the version follows [semantic versioning](https://semver.org/).
20+
- Make sure the version follows semantic versioning (see
21+
https://semver.org/).
2122
For release candidates, use versions like ``1.3.0rc1`` (no ``v`` prefix).
2223

2324
2. **Check and Update Dependencies**
2425

2526
- Ensure that dependencies and their constraints are up-to-date and
2627
consistent in:
28+
2729
- ``conda_package/recipe/meta.yaml`` (dependencies for the conda-forge
2830
release)
2931
- ``conda_package/pyproject.toml`` (dependencies for PyPI; used as a

conda_package/mpas_tools/viz/mpas_to_xdmf/mpas_to_xdmf.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
Example Usage
1717
-------------
1818
Python:
19+
1920
>>> from mpas_tools.viz.mpas_to_xdmf.mpas_to_xdmf import MpasToXdmf
2021
>>> converter = MpasToXdmf()
2122
>>> converter.load(mesh_filename="mesh.nc", time_series_filenames="output.*.nc",
2223
... variables=["temperature", "salinity"], xtime_var="xtime")
2324
>>> converter.convert_to_xdmf(out_dir="output_dir", extra_dims={"nVertLevels": [0, 1, 2]})
2425
2526
Command line:
27+
2628
$ mpas_to_xdmf -m mesh.nc -t output.*.nc -v temperature salinity -o output_dir -d nVertLevels=0:3
2729
2830
See Also
@@ -92,8 +94,14 @@ def load(
9294
xtime_var=None,
9395
):
9496
"""
95-
Load the MPAS mesh file and optionally combine it with time series
96-
files into a single xarray Dataset.
97+
Load the MPAS mesh file and optional time series.
98+
99+
Special keys for ``variables``:
100+
101+
- ``"allOnCells"`` - all variables with dimension ``"nCells"``
102+
- ``"allOnEdges"`` - all variables with dimension ``"nEdges"``
103+
- ``"allOnVertices"`` - all variables with dimension
104+
``"nVertices"``
97105
98106
Parameters
99107
----------
@@ -103,13 +111,10 @@ def load(
103111
List of NetCDF filenames or a wildcard string for time series
104112
files. If None, only the mesh file is used.
105113
variables : list of str, optional
106-
List of variables to convert. Special keys:
107-
- 'allOnCells': all variables with dimension 'nCells'
108-
- 'allOnEdges': all variables with dimension 'nEdges'
109-
- 'allOnVertices': all variables with dimension 'nVertices'
110-
If None, all variables are included.
114+
List of variables to convert. If None, all variables are included.
111115
xtime_var : str, optional
112-
Name of the variable containing time information (e.g., 'xtime').
116+
Name of the variable containing time information (e.g.,
117+
``"xtime"``).
113118
"""
114119
self.ds_mesh, self.ds = _load_dataset(
115120
mesh_filename=mesh_filename,
@@ -128,8 +133,8 @@ def convert_to_xdmf(self, out_dir, extra_dims=None, quiet=False):
128133
Directory where XDMF and HDF5 files will be saved.
129134
extra_dims : dict, optional
130135
Dictionary mapping extra dimensions to their selected indices.
131-
Example: {'nVertLevels': [0, 1, 2]}
132-
If None, all indices are included.
136+
Example - ``{'nVertLevels': [0, 1, 2]}``. If None, all indices are
137+
included.
133138
quiet : bool, optional
134139
If True, suppress progress output.
135140

0 commit comments

Comments
 (0)