From 77f07a1f5ed87380d06601e71e7e143e62f25490 Mon Sep 17 00:00:00 2001 From: James Clark Date: Wed, 17 Dec 2025 11:55:28 +0000 Subject: [PATCH] Fix doc warnings --- doc/source/conf.py | 23 +++++++++++++++-------- doc/source/documentation/overview.ipynb | 4 ++-- doc/source/install/installation.rst | 4 ++-- pyproject.toml | 4 ++-- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index ed0714b..89bd8e9 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -43,6 +43,7 @@ 'sphinx_copybutton', 'nbsphinx', 'sphinx_rtd_theme', + 'sphinxcontrib.googleanalytics', 'IPython.sphinxext.ipython_console_highlighting'] # Autodoc @@ -72,10 +73,16 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = '0.8.0' -# The full version, including alpha/beta/rc tags. -release = '0.8.0' +try: + from pylag.version import short_version, version as full_version + # The short X.Y version. + version = short_version + # The full version, including alpha/beta/rc tags. + release = full_version +except ImportError: + # Fallback if import fails + version = 'X.Y.Z' + release = 'X.Y.Z' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -107,14 +114,14 @@ # further. For a list of options available for each theme, see the # documentation. # -html_theme_options = { - 'analytics_id': 'G-5045ZREHMB' -} + +# Google analytics +googleanalytics_id = 'G-5045ZREHMB' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/doc/source/documentation/overview.ipynb b/doc/source/documentation/overview.ipynb index e419ccf..8e39758 100644 --- a/doc/source/documentation/overview.ipynb +++ b/doc/source/documentation/overview.ipynb @@ -14,7 +14,7 @@ "\n", "A simplified Unified Modelling Language (UML) Class Diagram for the model is shown in Figure 1. Functions that perform numerically intensive tasks have been implemented in Cython or C++ (dark grey boxes), while those that perform less numerically intensive tasks have been implemented in Python (pale grey boxes). The division is intended to combine the ease of use of Python with the efficiency gains offered by Cython and C++. During compilation, Cython source files are parsed and translated into optimized C++ code, which is them compiled into extension modules that can be loaded at runtime by the Python Interpreter.\n", "\n", - "![Code structure](figures/fig_code_structure_a.png)\n", + "![Code structure figure](figures/fig_code_structure_a.png)\n", "**Figure 1** UML Class Diagram.\n", "\n", "The model currently includes direct support for the [General Ocean Turbulence Model (GOTM)](https://gotm.net/portfolio/), the [Finite Volume Community Ocean Model (FVCOM)](http://fvcom.smast.umassd.edu/fvcom/), the [Regional Ocean Modellling System (ROMS)](https://www.myroms.org/) and data defined on a regular Arakawa A-grid, as is typical of datasets downloaded from public catalogues (e.g. the [CMEMS](https://marine.copernicus.eu/)). Further details on the types of input PyLag accepts are given below. To simplify the diagram, only GOTM and FVCOM are depicted in Figure 1.\n", @@ -122,7 +122,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.11.14" } }, "nbformat": 4, diff --git a/doc/source/install/installation.rst b/doc/source/install/installation.rst index 7b3b547..edf90d1 100644 --- a/doc/source/install/installation.rst +++ b/doc/source/install/installation.rst @@ -28,7 +28,7 @@ With *miniconda3* installed and configured, create a new environment in which to .. code-block:: bash - conda create -n pylag python=3.11 + conda create -n pylag python=3.12 conda activate pylag Conda will automatically prepend ``(pylag) $`` to the prompt, indicating you are now working in the new *pylag* environment. Finally, install *PyLag*: @@ -92,7 +92,7 @@ The new step here is the installation of conda-build and conda-verify. Note we d .. code-block:: bash - conda create -n pylag python=3.11 + conda create -n pylag python=3.12 conda activate pylag And finally, in the PyLag source code directory, build and install *PyLag*. diff --git a/pyproject.toml b/pyproject.toml index 26834ee..4b5bbd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,8 +53,8 @@ Changelog = "https://github.com/pmlmodelling/pylag/blob/master/CHANGELOG.md" [project.optional-dependencies] docs = ["sphinx", "nbsphinx", "sphinx_rtd_theme", "sphinxcontrib-napoleon", - "sphinx-copybutton", "jupyter", "jupyter_client", "ipykernel", - "cmocean", "matplotlib", "cartopy"] + "sphinx-copybutton", "sphinxcontrib.googleanalytics", "jupyter", + "jupyter_client", "ipykernel", "cmocean", "matplotlib", "cartopy"] [tool.setuptools] packages = ["pylag", "pylag.parallel", "pylag.regrid", "pylag.processing", "pylag.tests"]