diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cd666ec0..dd5f95c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: check-toml - id: check-merge-conflict - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.7.3 hooks: - id: ruff args: [--fix, --show-fixes] @@ -21,7 +21,7 @@ repos: - id: pretty-format-toml args: [--autofix] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.13.0 hooks: - id: mypy args: [--strict, --ignore-missing-imports] @@ -50,13 +50,13 @@ repos: types: [jupyter] additional_dependencies: [nbformat] - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 0.7.18 hooks: - id: mdformat additional_dependencies: - mdformat-gfm - repo: https://github.com/kynan/nbstripout - rev: 0.7.1 + rev: 0.8.0 hooks: - id: nbstripout args: [--drop-empty-cells, --keep-count, --keep-output, --extra-keys, metadata.kernelspec] diff --git a/Satellite_ECVs/Atmospheric_Composition/satellite_satellite-ozone-v1_climate-monitoring_q01.ipynb b/Satellite_ECVs/Atmospheric_Composition/satellite_satellite-ozone-v1_climate-monitoring_q01.ipynb index 9838e960..fed1bf48 100644 --- a/Satellite_ECVs/Atmospheric_Composition/satellite_satellite-ozone-v1_climate-monitoring_q01.ipynb +++ b/Satellite_ECVs/Atmospheric_Composition/satellite_satellite-ozone-v1_climate-monitoring_q01.ipynb @@ -50,7 +50,7 @@ "source": [ "## 📢 Quality assessment statements\n", "\n", - "```{admonition} These are the key outcomes of this quality assessment\n", + "```{admonition} These are the key outcomes of this assessment\n", ":class: note\n", "* The MERGED-UV v2000 provides a long-term, consistent record of total column ozone concentration and is therefore valuable for providing insight into the evolution of the ozone layer, although data prior to 2004 should be carefully evaluated.\n", "* The MERGED-UV v2000 does not include measurements during the polar night at latitudes higher than 57.5° in both hemispheres and therefore cannot be used to describe the ozone climatology and trends over these regions.\n", @@ -458,7 +458,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.11.10" } }, "nbformat": 4, diff --git a/scripts/validate-headings.py b/scripts/validate-headings.py index b7782e19..491e27e6 100644 --- a/scripts/validate-headings.py +++ b/scripts/validate-headings.py @@ -12,11 +12,14 @@ "## ℹ️ If you want to know more", ) +ADMONITION_TITLE = "These are the key outcomes of this assessment" + def validate_headers(path: Path) -> None: notebook = nbformat.read(path, nbformat.NO_CONVERT) title_count = 0 + admonition_count = 0 headings_count = dict.fromkeys(HEADINGS, 0) for cell in notebook.cells: if cell["cell_type"] != "markdown": @@ -27,7 +30,9 @@ def validate_headers(path: Path) -> None: if line.startswith("# "): title_count += 1 - continue + elif line == f"```{{admonition}} {ADMONITION_TITLE}": + admonition_count += 1 + if not path.name.startswith("template"): assert title_count, f"{path=!s}: The first line is not a title." @@ -39,6 +44,7 @@ def validate_headers(path: Path) -> None: assert not line.startswith("## "), f"{path=!s}: Invalid H2 {line=}" assert title_count == 1, f"{path=!s}: Invalid {title_count=}" + assert admonition_count == 1, f"{path=!s}: Invalid {admonition_count=}" for heading, header_count in headings_count.items(): assert header_count == 1, f"{path=!s}: Invalid {header_count=} of {heading=}"