diff --git a/.cirrus.yml b/.cirrus.yml index 777b568095..4fd4f0e5d5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -17,12 +17,12 @@ container: env: # Skip specific tasks by name. Set to a non-empty string to skip. - SKIP_LINT_TASK: "" - SKIP_TEST_MINIMAL_TASK: "" - SKIP_TEST_FULL_TASK: "" - SKIP_GALLERY_TASK: "" - SKIP_DOCTEST_TASK: "" - SKIP_LINKCHECK_TASK: "" + SKIP_LINT_TASK: "Yup" + SKIP_TEST_MINIMAL_TASK: "Yup" + SKIP_TEST_FULL_TASK: "Yup" + SKIP_GALLERY_TASK: "Yup" + SKIP_DOCTEST_TASK: "Yup" + SKIP_DOCCHECK_TASK: "" # Skip task groups by type. Set to a non-empty string to skip. SKIP_ALL_TEST_TASKS: "" SKIP_ALL_DOC_TASKS: "" @@ -185,6 +185,10 @@ gallery_task: env: PY_VER: 3.8 name: "${CIRRUS_OS}: py${PY_VER} doc tests (gallery)" + container: + dockerfile: requirements/ci/Dockerfile + cpu: 2 + memory: 4G << : *IRIS_TEST_DATA_TEMPLATE << : *LINUX_TASK_TEMPLATE tests_script: @@ -206,6 +210,10 @@ doctest_task: MPL_RC_DIR: ${HOME}/.config/matplotlib MPL_RC_FILE: ${HOME}/.config/matplotlib/matplotlibrc name: "${CIRRUS_OS}: py${PY_VER} doc tests" + container: + dockerfile: requirements/ci/Dockerfile + cpu: 2 + memory: 4G << : *IRIS_TEST_DATA_TEMPLATE << : *LINUX_TASK_TEMPLATE tests_script: @@ -220,20 +228,24 @@ doctest_task: # -# Testing Documentation Link Check (Linux) +# Checking documentating. Includes linkcheck and spelling (Linux) # -linkcheck_task: - only_if: ${SKIP_LINKCHECK_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == "" +doccheck_task: + only_if: ${SKIP_DOCCHECK_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == "" << : *CREDITS_TEMPLATE env: PY_VER: 3.8 MPL_RC_DIR: ${HOME}/.config/matplotlib MPL_RC_FILE: ${HOME}/.config/matplotlib/matplotlibrc - name: "${CIRRUS_OS}: py${PY_VER} doc link check" + name: "${CIRRUS_OS}: py${PY_VER} doc check" + container: + dockerfile: requirements/ci/Dockerfile + cpu: 2 + memory: 4G << : *LINUX_TASK_TEMPLATE tests_script: - export CONDA_OVERRIDE_LINUX="$(uname -r | cut -d'+' -f1)" - mkdir -p ${MPL_RC_DIR} - echo "backend : agg" > ${MPL_RC_FILE} - echo "image.cmap : viridis" >> ${MPL_RC_FILE} - - nox --session linkcheck -- --verbose + - nox --session doccheck -- --verbose diff --git a/docs/src/Makefile b/docs/src/Makefile index 2e47057a30..6cbb329e30 100644 --- a/docs/src/Makefile +++ b/docs/src/Makefile @@ -52,7 +52,7 @@ html-noplot: @echo "Build finished. The HTML (no gallery) pages are in $(BUILDDIR)/html" spelling: - $(SPHINXBUILD) -b spelling $(SRCDIR) $(BUILDDIR) + $(SPHINXBUILD) -b spelling $(WARNING_TO_ERROR) $(SRCDIR) $(BUILDDIR) @echo @echo "Build finished. The HTML (no gallery) pages are in $(BUILDDIR)/html" diff --git a/docs/src/conf.py b/docs/src/conf.py index 3f36124b46..7995650402 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -151,8 +151,7 @@ def _dotv(version): "sphinx_copybutton", "sphinx.ext.napoleon", "sphinx_panels", - # TODO: Spelling extension disabled until the dependencies can be included - # "sphinxcontrib.spelling", + "sphinxcontrib.spelling", "sphinx_gallery.gen_gallery", "matplotlib.sphinxext.mathmpl", "matplotlib.sphinxext.plot_directive", @@ -183,6 +182,7 @@ def _dotv(version): # -- spellingextension -------------------------------------------------------- # See https://sphinxcontrib-spelling.readthedocs.io/en/latest/customize.html spelling_lang = "en_GB" +tokenizer_lang = "en_GB" # The lines in this file must only use line feeds (no carriage returns). spelling_word_list_filename = ["spelling_allow.txt"] spelling_show_suggestions = False diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index cdced71fd1..66694f772a 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -75,7 +75,7 @@ the PR is merged, to prevent overwriting developer commits. The auto-updater can still be invoked manually in this situation by going to the `GitHub Actions`_ page for the workflow, and manually running using the "Run Workflow" button. By default, this will also not override developer commits. To force an update, you must -confirm "yes" in the "Run Worflow" prompt. +confirm "yes" in the "Run Workflow" prompt. .. _skipping Cirrus-CI tasks: diff --git a/docs/src/developers_guide/contributing_documentation.rst b/docs/src/developers_guide/contributing_documentation.rst index 167e8937b9..cec78942a6 100644 --- a/docs/src/developers_guide/contributing_documentation.rst +++ b/docs/src/developers_guide/contributing_documentation.rst @@ -51,7 +51,8 @@ This is useful for a final test before committing your changes. .. note:: In order to preserve a clean build for the html, all **warnings** have been promoted to be **errors** to ensure they are addressed. - This **only** applies when ``make html`` is run. + This **only** applies when ``make html`` and ``make spelling`` is + run. .. _cirrus-ci: https://cirrus-ci.com/github/SciTools/iris @@ -90,16 +91,15 @@ adding it to the ``linkcheck_ignore`` array that is defined in the If this fails check the output for the text **broken** and then correct or ignore the url. -.. comment - Finally, the spelling in the documentation can be checked automatically via the - command:: +Finally, the spelling in the documentation can be checked automatically via the +command:: - make spelling + make spelling - The spelling check may pull up many technical abbreviations and acronyms. This - can be managed by using an **allow** list in the form of a file. This file, - or list of files is set in the `conf.py`_ using the string list - ``spelling_word_list_filename``. +The spelling check may pull up many technical abbreviations and acronyms. This +can be managed by using an **allow** list in the form of a file. This file, +or list of files is set in the `conf.py`_ using the string list +``spelling_word_list_filename``. .. note:: In addition to the automated `cirrus-ci`_ build of all the diff --git a/docs/src/developers_guide/contributing_getting_involved.rst b/docs/src/developers_guide/contributing_getting_involved.rst index 0fd873517f..7ce09f0999 100644 --- a/docs/src/developers_guide/contributing_getting_involved.rst +++ b/docs/src/developers_guide/contributing_getting_involved.rst @@ -31,7 +31,7 @@ If you are new to using GitHub we recommend reading the .. note:: For more information on becoming a contributor_ including a link to the Contributors Licence Agreement (CLA) see the `Governance `_ - section of the `SciTools`_ ogranization web site. + section of the `SciTools`_ organisation web site. .. _GitHub getting started: https://docs.github.com/en/github/getting-started-with-github diff --git a/docs/src/developers_guide/contributing_graphics_tests.rst b/docs/src/developers_guide/contributing_graphics_tests.rst index 81ec9c0344..f7b487290d 100644 --- a/docs/src/developers_guide/contributing_graphics_tests.rst +++ b/docs/src/developers_guide/contributing_graphics_tests.rst @@ -22,7 +22,7 @@ Challenges ========== Iris uses many dependencies that provide functionality, an example that -applies here is matplotlib_. For more information on the dependences, see +applies here is matplotlib_. For more information on the dependencies, see :ref:`installing_iris`. When there are updates to the matplotlib_ or a dependency of matplotlib, this may result in a change in the rendered graphical output. This means that there may be no changes to Iris_, but due to an diff --git a/docs/src/spelling_allow.txt b/docs/src/spelling_allow.txt index ed883ac3bf..541d1a9cc3 100644 --- a/docs/src/spelling_allow.txt +++ b/docs/src/spelling_allow.txt @@ -1,92 +1,34 @@ -Admin -Albers -Arakawa -Arg -Args -Autoscale -Biggus -CF -CI -Cartopy -Checklist -Color -Conda -Constraining -DAP -Dask -Debian -Duchon -EO -Eos -Exner -Fieldsfile -Fieldsfiles -FillValue -Gb -GeogCS -Hovmoller -Jul -Jun -Jupyter -Lanczos -Mappables -Matplotlib -Mb -Modeling -Mollweide -NetCDF -Nino -PPfield -PPfields -Perez -Proj -Quickplot -Regrids -Royer -Scitools -Scitools -Sep -Stehfest -Steroegraphic -Subsetting -TestCodeFormat -TestLicenseHeaders -Torvalds -Trans -Trenberth -Tri -URIs -URLs -Ubuntu -Ugrid -Unidata -Vol -Vuuren -Workflow -Yury -Zaytsev -Zorder abf abl +Admin advection aggregator aggregators +Albers alphap ancils +antialiasing antimeridian ap +Arakawa arg +Arg args +Args arithmetic arraylike +artifacts atol auditable +Autoscale aux +backend basemap behaviour betap bhulev biggus +Biggus blev boolean boundpoints @@ -98,42 +40,60 @@ builtin bulev carrée cartesian +Cartopy celsius center centrepoints cf +CF cftime +Checklist chunksizes ci +CI +CIaaS clabel +cls cmap cmpt codebase color +Color colorbar colorbars +colormaps complevel conda +Conda config constraining +Constraining convertor coord coords cs +DAP +Dask datafiles datatype +datefmt datetime datetimes ddof +Debian deepcopy deprecations der +dev dewpoint dict dicts diff +Diffing discontiguities discontiguous +distros +div djf docstring docstrings @@ -142,36 +102,53 @@ dom dropdown dtype dtypes +Duchon dx dy edgecolor endian endianness +EO +Eos equirectangular eta etc +Exner fh fieldsfile +Fieldsfile fieldsfiles +Fieldsfiles fileformat fileformats filename filenames filepath filespec +FillValue +fmt fullname func +Gb +GeogCS geolocations +getattr +getitem +getitem +getslice github +google gregorian grib gribapi gridcell griddata gridlines -hPa hashable +hexdigest hindcast +Hovmoller +hPa hyperlink hyperlinks idiff @@ -190,9 +167,14 @@ io isosurfaces iterable jja +Jul +Jun jupyter +Jupyter +Kubuntu kwarg kwargs +Lanczos landsea lat latlon @@ -207,40 +189,56 @@ lblrec lbmon lbmond lbnrec +lbpack lbrsvd lbtim lbuser lbvc lbyr lbyrd +leverages lh lhs linewidth +linkcheck linted linting +lockfiles lon lons lt mam +Mappables markup matplotlib +Matplotlib matplotlibrc max +Mb mdtol meaned mercator metadata min +mixin +Modeling +Mollweide mpl +mul +namedtuple +Namedtuple nanmask nc ndarray neighbor ness -netCDF netcdf +netCDF +NetCDF netcdftime nimrod +Nino +Nox np nsigma numpy @@ -248,15 +246,21 @@ nx ny online orog +param paramId params parsable pcolormesh pdf +Perez placeholders plugin png +PPfield +PPfields proj +Proj +proxied ps pseudocolor pseudocolour @@ -264,31 +268,40 @@ pseudocoloured py pyplot quickplot -rST +Quickplot rc rd -reST -reStructuredText rebase rebases rebasing +refactored +regardlessly regrid regridded regridder regridders regridding regrids +Regrids +rehosted rel repo repos reprojecting +reST +reStructuredText rh rhs +Royer rst +rST rtol scipy scitools +Scitools +Scitools seekable +Sep setup sines sinh @@ -302,16 +315,21 @@ stashcodes stats std stdout +Stehfest +Steroegraphic str subcube subcubes submodule submodules subsetting +Subsetting sys tanh tb testcases +TestCodeFormat +TestLicenseHeaders tgt th timepoint @@ -319,31 +337,44 @@ timestamp timesteps todo tol +toolkit +Torvalds tos traceback +Trans travis +Trenberth +Tri tripolar tuple tuples txt +Ubuntu udunits ufunc ugrid +Ugrid ukmo un unhandled unicode +Unidata unittest unrotate unrotated uris +URIs url urls +URLs util var versioning vmax vmin +Vol +vs +Vuuren waypoint waypoints whitespace @@ -352,10 +383,14 @@ wildcards windspeeds withnans workflow +Workflow workflows xN xx xxx +Yury +Zaytsev zeroth zlev zonal +Zorder diff --git a/lib/iris/common/metadata.py b/lib/iris/common/metadata.py index f25f58be1e..9c4cd728a6 100644 --- a/lib/iris/common/metadata.py +++ b/lib/iris/common/metadata.py @@ -51,7 +51,7 @@ def hexdigest(item): """ - Calculate a hexidecimal string hash representation of the provided item. + Calculate a hexadecimal string hash representation of the provided item. Calculates a 64-bit non-cryptographic hash of the provided item, using the extremely fast ``xxhash`` hashing algorithm, and returns the hexdigest @@ -66,7 +66,7 @@ def hexdigest(item): The item that requires to have its hexdigest calculated. Returns: - The string hexidecimal representation of the item's 64-bit hash. + The string hexadecimal representation of the item's 64-bit hash. """ # Special case: deal with numpy arrays. diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 6129b35150..80bd12e673 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -398,7 +398,7 @@ def __binary_operator__(self, other, mode_constant): "10 meters" when multiplied by a scalar i.e. "1000" would result in a metadata object of "10000 meters". An alternative approach could be taken to multiply the *unit* by 1000 and the resultant metadata - object would represent "10 kilometers". + object would represent "10 kilometres". """ # Note: this method includes bounds handling code, but it only runs diff --git a/noxfile.py b/noxfile.py index 1373d8ab24..a80c8202ff 100755 --- a/noxfile.py +++ b/noxfile.py @@ -232,6 +232,7 @@ def gallery(session: nox.sessions.Session): """ prepare_venv(session) session.install("--no-deps", "--editable", ".") + session.install("sphinxcontrib-spelling", "pyenchant") session.run( "python", "-m", @@ -253,6 +254,7 @@ def doctest(session: nox.sessions.Session): """ prepare_venv(session) session.install("--no-deps", "--editable", ".") + session.install("sphinxcontrib-spelling", "pyenchant") session.cd("docs") session.run( "make", @@ -268,9 +270,9 @@ def doctest(session: nox.sessions.Session): @nox.session(python=PY_VER, venv_backend="conda") -def linkcheck(session: nox.sessions.Session): +def doccheck(session: nox.sessions.Session): """ - Perform iris doc link check. + Perform iris doc check (links and spelling). Parameters ---------- @@ -280,15 +282,26 @@ def linkcheck(session: nox.sessions.Session): """ prepare_venv(session) session.install("--no-deps", "--editable", ".") + session.install("sphinxcontrib-spelling", "pyenchant") session.cd("docs") + # session.run( + # "make", + # "clean", + # "html", + # external=True, + # ) + # session.run( + # "make", + # "linkcheck", + # external=True, + # ) session.run( - "make", - "clean", - "html", - external=True, + "python", + "-c", + "import enchant; print('-'*30); print(enchant.list_languages()); d = enchant.Dict('en_GB'); print(d.provider.name); print(d.provider.desc); print(d.provider.file); print('-'*30);", ) session.run( "make", - "linkcheck", + "spelling", external=True, ) diff --git a/requirements/ci/Dockerfile b/requirements/ci/Dockerfile new file mode 100644 index 0000000000..38abea59b3 --- /dev/null +++ b/requirements/ci/Dockerfile @@ -0,0 +1,12 @@ +FROM gcc:latest + +LABEL author="scitools" \ + version="0.1" \ + description="Docker image with gcc and enchant" + +# +# install system-level dependencies +# +RUN apt-get update -y \ + && apt-get upgrade -y \ + && apt-get install -y enchant-2 diff --git a/setup.cfg b/setup.cfg index b27e0c53d8..61d8c807c3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -69,12 +69,14 @@ where = lib [options.extras_require] docs = + pyenchant sphinx sphinx-copybutton sphinx-gallery + sphinx-panels sphinx_rtd_theme sphinxcontrib-napoleon - sphinx-panels + sphinxcontrib-spelling test = asv black==21.5b2 @@ -92,4 +94,4 @@ all = pyugrid stratify %(docs)s - %(test)s \ No newline at end of file + %(test)s