Skip to content

Commit

Permalink
Merge branch 'main' into eqctier3-b65326c7-9d09-4a23-b75e-8682cf45be64
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Dec 3, 2024
2 parents 3813493 + dccb9f8 commit b6fe54b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -458,7 +458,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 7 additions & 1 deletion scripts/validate-headings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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."

Expand All @@ -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=}"

Expand Down
10 changes: 5 additions & 5 deletions templates/template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"id": "4",
"metadata": {},
"source": [
"## ❓ Quality assessment question(s)\n",
"## ❓ Quality assessment question\n",
"* **In most cases there should be one question listed here in bold**\n",
"* **(In some cases a second related/follow-up question may be included)**"
]
Expand All @@ -74,9 +74,9 @@
"\n",
"```{admonition} These are the key outcomes of this assessment\n",
":class: note\n",
"* Statement 1\n",
"* Statement 2\n",
"* Statement 3\n",
"* Finding 1\n",
"* Finding 2\n",
"* Finding 3\n",
"* etc\n",
"```"
]
Expand Down Expand Up @@ -521,7 +521,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.10"
},
"papermill": {
"default_parameters": {},
Expand Down
14 changes: 8 additions & 6 deletions templates/template_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ There is a new approach to linking the methodology list to the subsections in an

## Assessment title (no icons)

We do not aim to be completely prescriptive about the title, it should be readable and descriptive, but also include some key tags to increase searchability, e.g. *Seasonal forecasts bias assessment for impact models*.
We do not aim to be completely prescriptive about the title, it should be readable and descriptive, but also include some keywords to increase searchability, e.g. *Seasonal forecasts bias assessment for impact models*.

- **Data stream**: Satellite (observations), Insitu (observations), Reanalysis, Seasonal (Forecasts), Climate (projections)
- **Data stream/ECV/variable**: Satellite (observations), Insitu (observations), Reanalysis, Seasonal (Forecasts), Climate (projections)
- **Quality area**: bias, forecast skill, completeness, intercomparison of X and Y, comparison to X, trend assessment, extremes, spatial/temporal resolution, reliability, accuracy, etc.
- **Application area**: impact models, risk assessment, climate monitoring, scientific study of X, X sector, 'region', 'specific C3S application', flood forecasting, etc.

Expand Down Expand Up @@ -56,15 +56,17 @@ A section of text with no heading which appears after the user question and befo

## 📢 Quality assessment statement

Key results and guidance including an answer to the user question - to be visually highlighted and with the section title ‘Quality assessment statement’.
Key results and guidance including an answer to the user question.

```{note}
The blue notification box that contains the quality assessment statement bullet points will not appear in GitHub, but will be rendered when the Jupyter Book page is created.
```

## Figure (no heading or icon)

A key figure should be included if possible, acting as a 'graphical abstract' for the assessment. This could be a figure generated later in the code, or from an external source (if licensing allows reproduction) - in this case the source should be cited in the caption. Images should be dragged and dropped into the markdown cell, which created an 'attachment code', and the external file is no longer needed. If the image file already includes a figure number and the caption then simple syntax can be used (`![](attachment:... ID from drag and drop)`). Otherwise, figure formatting can be used (see the template), where the attachment code from the drag and drop needs to be wrapped in the figure syntax. This approach should also be followed if images not generated by code are included later in the assessment.
A key figure should be included if possible, acting as a 'graphical abstract' for the assessment. This could be a figure generated later in the code, or from an external source (if licensing allows reproduction) - in this case the source should be cited in the caption. Images should be dragged and dropped into the markdown cell, which creates an 'attachment code', and the external file is not needed.

If the image file already includes a figure number and the caption then simple syntax can be used (`![](attachment:... ID from drag and drop)`). Otherwise, figure formatting can be used (see the template), where the attachment code from the drag and drop needs to be wrapped in the figure syntax. This approach should also be followed if images not generated by code are included later in the assessment.

```{note}
The figure formatting will not render in Github, but will work when the Jupyter Book page is built. Also note that the figure numbering is automatic, and applied across the whole Book (each Notebook does not start at 1 - this may be changed in the future).
Expand All @@ -87,6 +89,6 @@ A series of subsections with the same titles as in the listen in the methodology

## ℹ️ If you want to know more

Including a key resources subsection, which can link to suggested further reading, code packages used, and the relevant CDS catalogue entries.
Including a key resources subsection, which can link to suggested further reading, code packages used, and the relevant CDS catalogue entries. Try to link to relevant applications of the data, such as the C3S Climate Atlas, for projections, or the relevant parts of the European State of the Climate report for some ECVs.

Including a references subsection, which is a numbered list of the references used throughout the text. However, the references in the text will link to the external source, rather than the references list at the bottom of the assessment.
Including a references subsection, which is a numbered list of the references used throughout the text. However, the references in the text should link to the external source, rather than the references list at the bottom of the assessment.

0 comments on commit b6fe54b

Please sign in to comment.