Skip to content

Commit 34f76bd

Browse files
authored
Resolve docs warnings (#1367)
* lexer ipython2 -> ipython3 to address these warnings: uxarray/docs/getting-started/quick-overview.ipynb:20002: WARNING: Pygments lexer name 'ipython2' is not known also removed `|` from end of heading * navbar_footer_text unsupported maybe from Furo? WARNING: unsupported theme option 'navbar_footer_text' given * Suppress unknown MIME type warning otherwise we get a lot of these from the HoloViews plots For example: uxarray/docs/getting-started/quick-overview.ipynb:150002: WARNING: skipping unknown output mime type: application/vnd.holoviews_load.v0+json [mystnb.unknown_mime_type] [mystnb.unknown_mime_type] * Resolve not included in toctree docs/contributing.rst: WARNING: document isn't included in any toctree docs/examples/template.ipynb: WARNING: document isn't included in any toctree docs/user-guide/custom-grid.ipynb: WARNING: document isn't included in any toctree docs/user-guide/spatial-hashing.ipynb: WARNING: document isn't included in any toctree docs/user-guide/template.ipynb: WARNING: document isn't included in any toctree * api.rst for example: docs/api.rst:180: WARNING: Title underline too short. * contributing.rst uxarray/docs/contributing.rst:518: WARNING: Bullet list ends without a blank line; unexpected unindent. [docutils] docs/contributing.rst:544: WARNING: Bullet list ends without a blank line; unexpect uxarray/docs/contributing.rst:70: WARNING: Failed to create a cross reference. A title or caption not found: 'examples' [ref.ref] uxarray/docs/contributing.rst:604: WARNING: undefined label: 'index' [ref.ref] * Fix warnings in docstrings mainly bullet list issue * Add title (h1) to gradients nb uxarray/docs/user-guide/gradients.ipynb.rst:10002: WARNING: Document headings start at H2, not H1 [myst.header] * Switch to tip as it was, they were just not showing up docs/user-guide/data-structures.ipynb.rst:280008: WARNING: Unknown directive type: 'info' [myst.directive_unknown] docs/user-guide/data-structures.ipynb.rst:370008: WARNING: Unknown directive type: 'info' [myst.directive_unknown] https://myst-parser.readthedocs.io/en/stable/syntax/admonitions.html#admonition-types * this one too * Add holoviews mime note * sp * Fix part 7 heading * Fix the open docstring examples * Fix other non-consec heading increases
1 parent 62bea34 commit 34f76bd

File tree

16 files changed

+84
-62
lines changed

16 files changed

+84
-62
lines changed

docs/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Constructors
177177
UxDataArray.from_healpix
178178

179179
Grid Accessor
180-
~~~~~~~~~~~
180+
~~~~~~~~~~~~~
181181

182182
.. autosummary::
183183
:toctree: generated/
@@ -200,7 +200,7 @@ Constructors
200200
UxDataset.from_healpix
201201

202202
Grid Accessor
203-
~~~~~~~~~~~
203+
~~~~~~~~~~~~~
204204

205205
.. autosummary::
206206
:toctree: generated/

docs/conf.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ def __getattr__(cls, name):
6161
"sphinx_copybutton",
6262
]
6363

64+
suppress_warnings = [
65+
# mystnb doesn't recognize MIME type 'application/vnd.holoviews_load.v0+json'
66+
# from the holoviews plots and otherwise spams the build with warnings
67+
"mystnb.unknown_mime_type",
68+
]
6469

6570
# nbsphinx_execute = "never"
6671
# jupyter_execute_notebooks = "off"
@@ -137,7 +142,15 @@ def __getattr__(cls, name):
137142
# List of patterns, relative to source directory, that match files and
138143
# directories to ignore when looking for source files.
139144
# This pattern also affects html_static_path and html_extra_path.
140-
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
145+
exclude_patterns = [
146+
"_build",
147+
"**.ipynb_checkpoints",
148+
# Not included (yet)
149+
"examples/template.ipynb",
150+
"user-guide/custom-grid.ipynb",
151+
"user-guide/spatial-hashing.ipynb",
152+
"user-guide/template.ipynb",
153+
]
141154

142155
# The name of the Pygments (syntax highlighting) style to use.
143156
pygments_style = "sphinx"
@@ -173,7 +186,7 @@ def __getattr__(cls, name):
173186
"use_repository_button": True,
174187
"use_issues_button": True,
175188
"home_page_in_toc": False,
176-
"navbar_footer_text": "",
189+
# "navbar_footer_text": "",
177190
# "extra_footer": "<p></p>",
178191
"logo": {
179192
"image_light": "_static/images/logos/uxarray_logo_h_dark.svg",

docs/contributing.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ Some important UXarray resources are as follows:
6969

7070
* `UXarray documentation <https://uxarray.readthedocs.io/>`_
7171
houses significant documentation such as :ref:`quickstart`, :ref:`installation`,
72-
:ref:`contributing` (i.e. this document), :ref:`examples`, :ref:`tutorials`,
73-
and :ref:`api`.
72+
:ref:`contributing` (i.e. this document),
73+
examples (:ref:`gallery` or :ref:`userguide`),
74+
:ref:`tutorials`, and :ref:`api`.
7475

7576
* `UXarray Milestones <https://github.com/UXARRAY/uxarray/milestones>`_ and
7677
`UXarray Roadmap <https://github.com/orgs/UXARRAY/projects/2/views/17>`_ shows
@@ -515,24 +516,24 @@ as follows:
515516
into your Conda environment for UXarray development).
516517

517518
* Test scripts themselves are not intended to use ``pytest`` through implementation.
518-
Instead, ``pytest`` should be used only for running test scripts as follows::
519+
Instead, ``pytest`` should be used only for running test scripts as follows::
519520

520521
$ pytest test/<test_script_name>.py
521522

522-
, or::
523+
, or::
523524

524525
$ python -m pytest test/<test_script_name>.py
525526

526-
, the latter of which will also add the current directory to ``sys.path``.
527+
, the latter of which will also add the current directory to ``sys.path``.
527528

528-
Not using ``pytest`` for implementation allows the unit tests to be also run
529-
by using (a number of benefits/conveniences coming from using ``pytest`` can be
530-
seen `here <https://docs.pytest.org/en/7.1.x/how-to/unittest.html#how-to-use-unittest-based-tests-with-pytest>`_
531-
though)::
529+
Not using ``pytest`` for implementation allows the unit tests to be also run
530+
by using (a number of benefits/conveniences coming from using ``pytest`` can be
531+
seen `here <https://docs.pytest.org/en/7.1.x/how-to/unittest.html#how-to-use-unittest-based-tests-with-pytest>`_
532+
though)::
532533

533534
$ python -m unittest test/<test_script_name>.py
534535

535-
Also, all of the test scripts can be run at once with the following command::
536+
Also, all of the test scripts can be run at once with the following command::
536537

537538
$ pytest test
538539

@@ -541,7 +542,7 @@ Also, all of the test scripts can be run at once with the following command::
541542
the test scripts.
542543

543544
* Reference results (i.e. expected output or ground truth for not all but the most cases)
544-
should not be magic values (i.e. they need to be justified and/or documented).
545+
should not be magic values (i.e. they need to be justified and/or documented).
545546

546547
* Recommended, but not mandatory, implementation approach is as follows:
547548

@@ -602,7 +603,7 @@ The docstrings must contain:
602603
~~~~~~~~~~~~~~~~~~~~~~
603604

604605
As we mentioned a few times throughout this guide, UXarray has a static `documentation
605-
<https://uxarray.readthedocs.io/>`_ :ref:`index` page that is being generated automatically from the
606+
<https://uxarray.readthedocs.io/>`_ page that is being generated automatically from the
606607
repository's code structure. However, there needs to be some manual additions to the
607608
proper documentation index file(s) for the automation to work.
608609

docs/gallery.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
.. currentmodule:: uxarray
22

3-
.. _examples:
4-
5-
.. math::
3+
.. _gallery:
64

75
Gallery
86
=======

docs/getting-started/quick-overview.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"collapsed": false
5353
},
5454
"source": [
55-
"## Opening a Dataset|"
55+
"## Opening a Dataset"
5656
]
5757
},
5858
{
@@ -322,7 +322,7 @@
322322
"mimetype": "text/x-python",
323323
"name": "python",
324324
"nbconvert_exporter": "python",
325-
"pygments_lexer": "ipython2",
325+
"pygments_lexer": "ipython3",
326326
"version": "2.7.6"
327327
}
328328
},

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ around the `UGRID <http://ugrid-conventions.github.io/ugrid-conventions/>`_ conv
112112
GitHub Discussions <https://github.com/UXARRAY/uxarray/discussions>
113113
GitHub Issues <https://github.com/UXARRAY/uxarray/issues>
114114
UGRID Conventions <https://ugrid-conventions.github.io/ugrid-conventions/>
115+
contributing
115116

116117
.. raw:: html
117118

docs/user-guide/advanced-plotting.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"mimetype": "text/x-python",
4949
"name": "python",
5050
"nbconvert_exporter": "python",
51-
"pygments_lexer": "ipython2",
51+
"pygments_lexer": "ipython3",
5252
"version": "2.7.6"
5353
}
5454
},

docs/user-guide/area_calc.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@
18431843
"cell_type": "markdown",
18441844
"metadata": {},
18451845
"source": [
1846-
"# 7. Demonstrate the Need for Area Correction During Zonal Averaging Calculations Etc.\n",
1846+
"## 7. Demonstrate the Need for Area Correction During Zonal Averaging Calculations Etc.\n",
18471847
"\n",
18481848
"When performing zonal averaging, it is common practice to calculate the intersection of faces with lines of constant latitude and longitude. \n",
18491849
"\n",

docs/user-guide/data-structures.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
"\n",
411411
"The `UxDataset` class is used for pairing one or more data variables with an unstructured grid. It operates similarly to a `xarrary.Dataset`, with the addition of unstructured-grid specific functionality and is linked to an instance of a `Grid`.\n",
412412
"\n",
413-
"```{info}\n",
413+
"```{tip}\n",
414414
"More information about `xarray.Dataset` can be found [here](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html).\n",
415415
"```\n"
416416
]
@@ -544,7 +544,7 @@
544544
"\n",
545545
"While a `UxDataset` represents one or more data variables linked to some unstructured grid, a `UxDataArray` represent a single data variable. Alternatively, one can think of a `UxDataset` as a collection of one or more `UxDataArray` instances.\n",
546546
"\n",
547-
"```{info}\n",
547+
"```{tip}\n",
548548
"More information about `xarray.DataArray` can be found [here](https://docs.xarray.dev/en/stable/generated/xarray.DataArray.html).\n",
549549
"```\n",
550550
"\n",

docs/user-guide/gradients.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"id": "c51bdab8875e6859",
66
"metadata": {},
77
"source": [
8+
"# Gradients\n",
9+
"\n",
810
"## Gradients\n",
911
"\n",
1012
"This user-guide notebook showcases how to compute the gradient of a data variable."

0 commit comments

Comments
 (0)