Skip to content

Commit 7b6fa46

Browse files
authored
Adopt sphinx design (#5127)
* index panel change wip * syntax changes for panel and dropdown * fixed extlinks warning * minor tweaks * indentations fixes and minor tweaks * updated dependencies * updated dependencies * reinstated theme pin * added todo * removed todos * fixed conflicts * simplified dropdown use * tidy up button options * remove custom icons * add whatsnew * updated lockfiles * min pin to sphinx * unpin sphinx * pin to sphinx 5.3 * sphinx pin test
1 parent 021d6ff commit 7b6fa46

File tree

23 files changed

+287
-291
lines changed

23 files changed

+287
-291
lines changed

docs/gallery_code/meteorology/plot_lagged_ensemble.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
This example demonstrates the loading of a lagged ensemble dataset from the
66
GloSea4 model, which is then used to produce two types of plot:
77
8-
* The first shows the "postage stamp" style image with an array of 14 images,
9-
one for each ensemble member with a shared colorbar. (The missing image in
10-
this example represents ensemble member number 6 which was a failed run)
11-
12-
* The second plot shows the data limited to a region of interest, in this case
13-
a region defined for forecasting ENSO (El Nino-Southern Oscillation), which,
14-
for the purposes of this example, has had the ensemble mean subtracted from
15-
each ensemble member to give an anomaly surface temperature. In practice a
16-
better approach would be to take the climatological mean, calibrated to the
17-
model, from each ensemble member.
8+
* The first shows the "postage stamp" style image with an array of 14 images,
9+
one for each ensemble member with a shared colorbar. (The missing image in
10+
this example represents ensemble member number 6 which was a failed run)
11+
12+
* The second plot shows the data limited to a region of interest, in this case
13+
a region defined for forecasting ENSO (El Nino-Southern Oscillation), which,
14+
for the purposes of this example, has had the ensemble mean subtracted from
15+
each ensemble member to give an anomaly surface temperature. In practice a
16+
better approach would be to take the climatological mean, calibrated to the
17+
model, from each ensemble member.
1818
1919
"""
2020

docs/src/conf.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _dotv(version):
157157
"sphinx.ext.intersphinx",
158158
"sphinx_copybutton",
159159
"sphinx.ext.napoleon",
160-
"sphinx_panels",
160+
"sphinx_design",
161161
"sphinx_gallery.gen_gallery",
162162
"matplotlib.sphinxext.mathmpl",
163163
"matplotlib.sphinxext.plot_directive",
@@ -167,9 +167,7 @@ def _dotv(version):
167167
autolog("Skipping the API docs generation (SKIP_API=1)")
168168
else:
169169
# better api documentation (custom)
170-
extensions.extend(
171-
["custom_class_autodoc", "custom_data_autodoc", "generate_package_rst"]
172-
)
170+
extensions.extend(["custom_data_autodoc", "generate_package_rst"])
173171

174172
# -- panels extension ---------------------------------------------------------
175173
# See https://sphinx-panels.readthedocs.io/en/latest/
@@ -239,11 +237,11 @@ def _dotv(version):
239237
# See https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
240238

241239
extlinks = {
242-
"issue": ("https://github.com/SciTools/iris/issues/%s", "Issue #"),
243-
"pull": ("https://github.com/SciTools/iris/pull/%s", "PR #"),
240+
"issue": ("https://github.com/SciTools/iris/issues/%s", "Issue #%s"),
241+
"pull": ("https://github.com/SciTools/iris/pull/%s", "PR #%s"),
244242
"discussion": (
245243
"https://github.com/SciTools/iris/discussions/%s",
246-
"Discussion #",
244+
"Discussion #%s",
247245
),
248246
}
249247

docs/src/developers_guide/contributing_benchmarks.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ applications.
3838
* Results for a series of commits can be visualised for an intuitive
3939
understanding of when and why changes occurred.
4040

41-
.. image:: asv_example_images/commits.png
42-
:width: 300
41+
.. image:: asv_example_images/commits.png
42+
:width: 300
4343

4444
* Parameterised benchmarks make it easy to visualise:
4545

docs/src/further_topics/ugrid/operations.rst

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ structured formats and non-UGRID mesh formats.
5353
The objects created in this example will be used where possible in the
5454
subsequent example operations on this page.
5555

56-
.. dropdown:: :opticon:`code`
56+
.. dropdown:: :octicon:`code`
57+
:color: light
5758

5859
.. doctest:: ugrid_operations
5960

@@ -145,7 +146,8 @@ Creating a :class:`~iris.cube.Cube` is unchanged; the
145146
:class:`~iris.experimental.ugrid.Mesh` is linked via a
146147
:class:`~iris.experimental.ugrid.MeshCoord` (see :ref:`ugrid MeshCoords`):
147148

148-
.. dropdown:: :opticon:`code`
149+
.. dropdown:: :octicon:`code`
150+
:color: light
149151

150152
.. doctest:: ugrid_operations
151153

@@ -206,7 +208,8 @@ The Iris saving process automatically detects if the :class:`~iris.cube.Cube`
206208
has an associated :class:`~iris.experimental.ugrid.Mesh` and automatically
207209
saves the file in a UGRID-conformant format:
208210

209-
.. dropdown:: :opticon:`code`
211+
.. dropdown:: :octicon:`code`
212+
:color: light
210213

211214
.. doctest:: ugrid_operations
212215

@@ -281,7 +284,8 @@ The :func:`iris.experimental.ugrid.save_mesh` function allows
281284
:class:`~iris.experimental.ugrid.Mesh`\es to be saved to file without
282285
associated :class:`~iris.cube.Cube`\s:
283286

284-
.. dropdown:: :opticon:`code`
287+
.. dropdown:: :octicon:`code`
288+
:color: light
285289

286290
.. doctest:: ugrid_operations
287291

@@ -352,7 +356,8 @@ loading a file remains **optional**. To load UGRID data from a file into the
352356
Iris mesh data model, use the
353357
:const:`iris.experimental.ugrid.PARSE_UGRID_ON_LOAD` context manager:
354358

355-
.. dropdown:: :opticon:`code`
359+
.. dropdown:: :octicon:`code`
360+
:color: light
356361

357362
.. doctest:: ugrid_operations
358363

@@ -372,7 +377,8 @@ All the existing loading functionality still operates on UGRID-compliant
372377
data - :class:`~iris.Constraint`\s, callbacks, :func:`~iris.load_cube`
373378
etcetera:
374379

375-
.. dropdown:: :opticon:`code`
380+
.. dropdown:: :octicon:`code`
381+
:color: light
376382

377383
.. doctest:: ugrid_operations
378384

@@ -415,7 +421,8 @@ The :func:`iris.experimental.ugrid.load_mesh` and
415421
:class:`~iris.experimental.ugrid.Mesh`\es to be loaded from a file without
416422
creating any associated :class:`~iris.cube.Cube`\s:
417423

418-
.. dropdown:: :opticon:`code`
424+
.. dropdown:: :octicon:`code`
425+
:color: light
419426

420427
.. doctest:: ugrid_operations
421428

@@ -469,7 +476,8 @@ be added to API in the near future.
469476
This first example uses GeoVista to plot the ``face_cube`` that we created
470477
earlier:
471478

472-
.. dropdown:: :opticon:`code`
479+
.. dropdown:: :octicon:`code`
480+
:color: light
473481

474482
.. code-block:: python
475483
@@ -539,7 +547,8 @@ earlier:
539547

540548
Here's another example using a global cubed-sphere data set:
541549

542-
.. dropdown:: :opticon:`code`
550+
.. dropdown:: :octicon:`code`
551+
:color: light
543552

544553
.. code-block:: python
545554
@@ -614,7 +623,8 @@ therefore set to return an :class:`~iris.coords.AuxCoord` instead - breaking
614623
the link between :class:`~iris.cube.Cube` and
615624
:class:`~iris.experimental.ugrid.Mesh`:
616625

617-
.. dropdown:: :opticon:`code`
626+
.. dropdown:: :octicon:`code`
627+
:color: light
618628

619629
.. doctest:: ugrid_operations
620630

@@ -657,7 +667,8 @@ mesh, we then reconstruct a :class:`~iris.experimental.ugrid.Mesh` from the
657667
..
658668
Not using doctest here as want to keep GeoVista as optional dependency.
659669
660-
.. dropdown:: :opticon:`code`
670+
.. dropdown:: :octicon:`code`
671+
:color: light
661672

662673
.. code-block:: python
663674
@@ -784,7 +795,8 @@ with the
784795
..
785796
Not using doctest here as want to keep iris-esmf-regrid as optional dependency.
786797
787-
.. dropdown:: :opticon:`code`
798+
.. dropdown:: :octicon:`code`
799+
:color: light
788800

789801
.. code-block:: python
790802
@@ -880,7 +892,8 @@ Since calling a regridder is usually a lot faster than initialising, reusing
880892
regridders can save a lot of time. We can demonstrate the reuse of the
881893
previously initialised regridder:
882894

883-
.. dropdown:: :opticon:`code`
895+
.. dropdown:: :octicon:`code`
896+
:color: light
884897

885898
.. code-block:: python
886899

docs/src/further_topics/ugrid/other_meshes.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ To represent the Voronoi Polygons as faces, the corner coordinates will be used
2727
as the **nodes** when creating the Iris
2828
:class:`~iris.experimental.ugrid.mesh.Mesh`.
2929

30-
.. dropdown:: :opticon:`code`
30+
.. dropdown:: :octicon:`code`
31+
:color: light
3132

3233
.. code-block:: python
3334
@@ -115,7 +116,8 @@ as the **nodes** when creating the Iris
115116
:class:`~iris.experimental.ugrid.mesh.Mesh`.
116117

117118

118-
.. dropdown:: :opticon:`code`
119+
.. dropdown:: :octicon:`code`
120+
:color: light
119121

120122
.. code-block:: python
121123
@@ -253,7 +255,8 @@ To make an unstructured cube, the data must be 'flattened' to convert the given
253255
dimensions into a single mesh dimension. Since Iris cubes don't support a "reshape" or
254256
"flatten" operations, we create a new cube from the flattened data.
255257

256-
.. dropdown:: :opticon:`code`
258+
.. dropdown:: :octicon:`code`
259+
:color: light
257260

258261
.. code-block:: python
259262

0 commit comments

Comments
 (0)