Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
382006a
update black and create separate file for colab header
AgnieszkaZaba Jan 27, 2026
4cb3863
run new black
AgnieszkaZaba Jan 27, 2026
5443b72
update check-badges file
AgnieszkaZaba Jan 27, 2026
02fdfee
rerun notebook
AgnieszkaZaba Jan 27, 2026
f8cb797
rename check
AgnieszkaZaba Jan 27, 2026
59b3e8c
change name and entry
AgnieszkaZaba Jan 27, 2026
83ed023
add missing docstrings
AgnieszkaZaba Jan 27, 2026
9c89651
Merge branch 'main' into badges-hook
AgnieszkaZaba Feb 7, 2026
ceb3e53
tests updates, cleanup, remove duplicated logic or unused parameters
AgnieszkaZaba Feb 7, 2026
31ac8be
reformat hook name
AgnieszkaZaba Feb 7, 2026
9f8e04a
reformat hook name in pyproject.toml
AgnieszkaZaba Feb 8, 2026
6260ff8
update docstrings
AgnieszkaZaba Feb 15, 2026
c66ba05
remove wrong ValueError when missing repo-examples or repo in header;…
AgnieszkaZaba Feb 17, 2026
b2f0a46
return notebook path in error messages
AgnieszkaZaba Feb 17, 2026
dc88fde
fix too long line
AgnieszkaZaba Feb 21, 2026
b409b47
start simple documentation for pre-commit hooks; start error codes fo…
AgnieszkaZaba Feb 22, 2026
2c5166f
all check functions should yield error dformatted as in utils, remove…
AgnieszkaZaba Feb 22, 2026
d2530f3
all test_functions take same two argumants, make it consistent accros…
AgnieszkaZaba Feb 22, 2026
4c42f72
rename hooks to contain check at the beginning for clarity
AgnieszkaZaba Feb 22, 2026
de3c3ad
fix renaming hooks
AgnieszkaZaba Feb 22, 2026
e18779a
renaming vars, use error codes
AgnieszkaZaba Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
- run: pip install .
- run: pip install pylint
- run: pylint --unsafe-load-any-extension=y --disable=fixme $(git ls-files '*.py')
- run: |
pip install .
pip install pylint
pylint --unsafe-load-any-extension=y --disable=fixme $(git ls-files '*.py')

precommit:
runs-on: ubuntu-latest
Expand Down
27 changes: 14 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ repos:
- id: end-of-file-fixer
- id: debug-statements

# - repo: https://github.com/christopher-hacker/enforce-notebook-run-order
# rev: 2.1.1
# hooks:
# - id: enforce-notebook-run-order
- repo: https://github.com/christopher-hacker/enforce-notebook-run-order
rev: 2.1.1
hooks:
- id: enforce-notebook-run-order
exclude: tests/examples/bad.ipynb

- repo: local
hooks:
Expand All @@ -29,9 +30,9 @@ repos:
types: [jupyter]
exclude: tests/examples/bad.ipynb

- id: check-badges
name: check badges
entry: check_badges
- id: check-notebook-open-atmos-structure
name: check notebook has open-atmos structure
entry: check_notebook_open_atmos_structure
additional_dependencies:
- nbformat
- pytest
Expand All @@ -41,18 +42,18 @@ repos:
types: [jupyter]
exclude: tests/examples/bad.ipynb

- id: notebooks-output
name: notebooks output
entry: notebooks_output
- id: check-notebook-output
name: check notebook output
entry: check_notebook_output
additional_dependencies:
- nbformat
language: python
types: [jupyter]
exclude: tests/examples/bad.ipynb

- id: notebooks-using-jupyter-utils
name: notebooks using open-atmos-jupyter-utils
entry: notebooks_using_jupyter_utils
- id: check-notebooks-using-jupyter-utils
name: check notebooks using open-atmos-jupyter-utils
entry: check_notebook_using_jupyter_utils
additional_dependencies:
- nbformat
language: python
Expand Down
20 changes: 10 additions & 10 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
stages: [pre-commit]
types: [jupyter]

- id: check-badges
name: check badges
description: check badges in Jupyter Notebook
entry: check_badges
- id: check-notebook-open-atmos-structure
name: check notebook has open-atmos structure
entry: check_notebook_open_atmos_structure
description: check notebook has open-atmos structure
language: python
stages: [pre-commit]
types: [jupyter]

- id: notebooks-output
name: notebooks output
- id: check-notebook-output
name: check notebook output
description: check if notebooks are executed and without errors and warnings
entry: notebooks_output
entry: check_notebook_output
language: python
stages: [pre-commit]
types: [jupyter]

- id: notebooks-using-jupyter-utils
name: notebooks using open-atmos-jupyter-utils
- id: check-notebook-using-jupyter-utils
name: check notebook using open-atmos-jupyter-utils
description: check if notebook use show_anim() and show_plot() methods from open-atmos-jupyter-utils
entry: notebooks_using_jupyter_utils
entry: check_notebook_using_jupyter_utils
language: python
stages: [pre-commit]
types: [jupyter]
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,74 @@
# devops_tests
pytest test routines asserting for GitHub issue-linked TO-DO labelling in the code, README link consistency and some Jupyter notebook sanity checks

## Pre-commit hooks:
### `check_notebook_open_atmos_structure`
Check Jupyter notebooks structure default for `open-atmos` projects.
Required:
- three badges in the first cell:

[![preview notebook](https://img.shields.io/static/v1?label=render%20on&logo=github&color=87ce3e&message=GitHub)](https://github.com/open-atmos/devops_tests/blob/main/tests/examples/good.ipynb)
[![launch on mybinder.org](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/devops_tests.git/main?urlpath=lab/tree/tests/examples/good.ipynb)
[![launch on Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/devops_tests/blob/main/tests/examples/good.ipynb)

- markdown type of the second cell
- Colab-header in the third cell
```
import os, sys
os.environ['NUMBA_THREADING_LAYER'] = 'workqueue' # PySDM & PyMPDATA don't work with TBB; OpenMP has extra dependencies on macOS
if 'google.colab' in sys.modules:
!pip --quiet install open-atmos-jupyter-utils
from open_atmos_jupyter_utils import pip_install_on_colab
pip_install_on_colab('devops_tests-examples', 'devops_tests')
```

## 0xx -> Execution Problems

These errors relate to notebook execution state and structural integrity.

- **NB000** – Missing execution count
- **NB001** – Empty execution
- **NB002** – Cell contains execution error
- **NB003** – Insufficient number of cells (minimum required not met)
- **NB004** – Invalid or missing required content in first cell

---

## 1xx -> Badge Problems

These errors relate to required badges in the first notebook cell.

- **NB100** - Incorrect GitHub preview badge
- **NB101** – Incorrect MyBinder badge
- **NB102** – Incorrect Colab badge

---

## 2xx -> Markdown Problems

These errors relate to required markdown structure in the second notebook cell.

- **NB200** – Required markdown cell missing
- **NB201** – Invalid markdown structure
- **NB202** – Required markdown section missing

---

## 3xx -> Colab Header Problems

These errors relate to the required Colab setup header.

- **NB300** – Header missing
- **NB301** – Header version mismatch
- **NB302** – Invalid header content
- **NB303** – Header in incorrect position

---

## 4xx -> `open-atmos-jupyter-utils` Problems

These errors relate to the usage of `show_anim()` and `show_plot()`
functions from `open-atmos-jupyter-utils` package required when matplotlib is used.

- **NB400** - show_plot not used
- **NB401** - show_anim not used
Loading
Loading