From ac12e3c4e431c92eabf90e227dfcec003ecd275c Mon Sep 17 00:00:00 2001 From: mgrover1 Date: Wed, 3 Jan 2024 15:53:08 -0600 Subject: [PATCH] FIX: Fix the failing build of the gallery --- doc/environment.yml | 2 +- doc/source/conf.py | 17 ++++++++++------- examples/retrieve/plot_convective_stratiform.py | 4 ++-- examples/retrieve/plot_feature_detection.py | 9 ++++----- examples/retrieve/plot_hydrometeor.py | 4 ++-- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/doc/environment.yml b/doc/environment.yml index b17e6d6c8a..c9ff12e75f 100644 --- a/doc/environment.yml +++ b/doc/environment.yml @@ -15,7 +15,7 @@ dependencies: - cartopy - cvxopt - xarray - - sphinx + - sphinx<7.2 - ipython - pandoc - pkg-config diff --git a/doc/source/conf.py b/doc/source/conf.py index 0a6380bfb6..1977c7c5e5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -49,7 +49,6 @@ "sphinx.ext.napoleon", "sphinx_copybutton", "sphinx_gallery.gen_gallery", - "sphinx_gallery.load_style", "sphinx_design", "nbsphinx", "myst_nb", @@ -57,10 +56,11 @@ ] exclude_patterns = ["_build", "**.ipynb_checkpoints"] - -# only include examples if the BUILD_PYART_EXAMPLES env. variable is set -extensions.append("sphinx_gallery.gen_gallery") -sphinx_gallery_conf = {"examples_dirs": "../../examples", "gallery_dirs": "examples"} +sphinx_gallery_conf = { + "examples_dirs": "../../examples", + "gallery_dirs": "examples", + "abort_on_example_error": True, +} # Configuration options for plot_directive. See: @@ -124,7 +124,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -203,7 +203,7 @@ post_auto_excerpt = 2 # Don't execute the jupyter notebooks -jupyter_execute_notebooks = "off" +nb_execution_mode = "off" # Extra variables that will be available to the templates. Used to create the # links to the Github repository sources and issues @@ -263,6 +263,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) +# Make MyST generate anchors for headings +myst_heading_anchors = 2 + # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "python": ("https://docs.python.org/3/", None), diff --git a/examples/retrieve/plot_convective_stratiform.py b/examples/retrieve/plot_convective_stratiform.py index 2d905ee208..306c4d3c8c 100644 --- a/examples/retrieve/plot_convective_stratiform.py +++ b/examples/retrieve/plot_convective_stratiform.py @@ -21,7 +21,7 @@ ###################################### # How the algorithm works -# ---------- +# ----------------------- # This first section describes how the convective-stratiform algorithm works (see references for full details). This # algorithm is a feature detection algorithm and classifies fields as "convective" or "stratiform". The algorithm is # designed to detect features in a reflectivity field but can also detect features in fields such as rain rate or @@ -446,7 +446,7 @@ ###################################### # Summary of recommendations and best practices -# ---------- +# --------------------------------------------- # * Tune your parameters to your specific purpose # * Use a rescaled field if possible (i.e. linear reflectivity, rain or snow rate) # * Keep ``estimate_flag=True`` to see uncertainty in classification diff --git a/examples/retrieve/plot_feature_detection.py b/examples/retrieve/plot_feature_detection.py index 5122ce6928..b12aa6f97c 100644 --- a/examples/retrieve/plot_feature_detection.py +++ b/examples/retrieve/plot_feature_detection.py @@ -23,7 +23,7 @@ ###################################### # How the algorithm works -# ---------- +# ----------------------- # The feature detection algorithm works by identifying features that exceed the background value by an amount that # varies with the background value. The algorithm is heavily customizable and is designed to work with a variety of # datasets. Here, we show several examples of how to use the algorithm with different types of radar data. @@ -33,7 +33,7 @@ ###################################### # Part 1: Warm-season convective-stratiform classification -# ---------- +# -------------------------------------------------------- # **Classification of summer convective example** # # Our first example classifies echo from a summer convective event. @@ -397,8 +397,7 @@ ###################################### # Part 2: Cool-season feature detection -# ---------- -###################################### +# ------------------------------------- # **Winter storm example** # # In this example, we will show how to algorithm can be used to detect features (snow bands) in winter storms. Here, we @@ -778,7 +777,7 @@ def quick_image_mute(field, muted_ref): plt.show() ###################################### # Summary of recommendations and best practices -# ---------- +# --------------------------------------------- # * Tune your parameters to your specific purpose # * Use a rescaled field if possible (i.e. linear reflectivity, rain or snow rate) # * Keep ``estimate_flag=True`` to see uncertainty in classification diff --git a/examples/retrieve/plot_hydrometeor.py b/examples/retrieve/plot_hydrometeor.py index e4447cf9de..43702ca962 100644 --- a/examples/retrieve/plot_hydrometeor.py +++ b/examples/retrieve/plot_hydrometeor.py @@ -1,7 +1,7 @@ """ -========================================= +============================================= Calculate and Plot hydrometeor classification -========================================= +============================================= Calculates a hydrometeor classification and displays the results """