Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
29d2405
Add notebook CI tests with pytest-nbmake and HelloWorld.ipynb
Sharkyii Apr 3, 2026
fd789f2
Add notebook timeout and selective CI execution
Sharkyii Apr 15, 2026
677a4c9
Merge branch 'main' into add-notebook-ci-nbmake
Sharkyii Apr 15, 2026
82df71c
Fix notebook CI by creating danra.datastore.zarr fixture, Add docs/no…
Sharkyii Apr 15, 2026
ca9b827
Fix trailing whitespace in workflow file
Sharkyii Apr 15, 2026
52e3df1
Merge branch 'main' of github.com:mllam/neural-lam into pr/Sharkyii/577
sadamov Apr 20, 2026
dd97010
Update pyproject.toml
Sharkyii Apr 22, 2026
f9847b2
Update pyproject.toml
Sharkyii Apr 22, 2026
5a9171f
Update .github/workflows/install-and-test.yml
Sharkyii Apr 22, 2026
cbc118a
Merge branch 'main' into add-notebook-ci-nbmake
sadamov Apr 23, 2026
32c8d81
fix checkpoint loading and notebook graph viz for PyTorch 2.6
Sharkyii Apr 25, 2026
f90d952
Merge branch 'main' into add-notebook-ci-nbmake
Sharkyii Apr 25, 2026
f1a0f7c
fixing pre-commit error
Sharkyii Apr 25, 2026
5c198ae
fix precommit
Sharkyii Apr 25, 2026
e03201b
Merge branch 'main' into add-notebook-ci-nbmake
Sharkyii May 8, 2026
4a24927
Fix graph LAM GNN kwarg handling
gitcommit90 Jun 27, 2026
2e1fd48
Merge branch 'main' into add-notebook-ci-nbmake
Sharkyii Jul 1, 2026
4810ec6
fix: 2 pytest.ini_options fixed
Sharkyii Jul 1, 2026
e26419e
fix: remove dupliactes and import error
Sharkyii Jul 1, 2026
dafc20f
fix: added an explicit skip for skipping notebooks regardless of pyth…
Sharkyii Jul 1, 2026
640b795
refactor: add build_predictor helper for explicit GNN kwargs (#686)
gitcommit90 Jul 1, 2026
718deaf
Merge branch 'main' into fix/issue-686-gnn-kwargs
sadamov Jul 13, 2026
756f330
Merge branch 'main' into add-notebook-ci-nbmake
sadamov Jul 15, 2026
96d574f
Fix merge-artifact regressions blocking #577
sadamov Jul 15, 2026
ffe3b0b
Notebook: uv-only install, matplotlib graph preview, version bumps
sadamov Jul 15, 2026
847c46b
Merge #688 to unblock graph_lam training in the notebook
sadamov Jul 15, 2026
652fe6f
Notebook: robust training/eval + 3D graph preview
sadamov Jul 15, 2026
6e46979
reran full notebook
sadamov Jul 15, 2026
89165a8
removed plotly render
sadamov Jul 15, 2026
3414a20
CI: dedicated path-filtered notebook workflow + fail loudly on train …
sadamov Jul 15, 2026
67d131e
precommits
sadamov Jul 15, 2026
30e1722
Merge pull request #1 from sadamov/fix/577-merge-artifacts
Sharkyii Jul 16, 2026
bd80f42
Merge branch 'main' into add-notebook-ci-nbmake
Sharkyii Jul 16, 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: 5 additions & 2 deletions .github/workflows/install-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ jobs:
restore-keys: |
${{ runner.os }}-meps-reduced-example-data-v0.3.0

- name: Run tests
- name: Run tests (excluding notebooks)
run: |
pytest -vv -s --doctest-modules
pytest -vv -s --doctest-modules --ignore=docs/notebooks

# Notebooks run in their own path-filtered, CPU-only workflow
# (.github/workflows/notebook-tests.yml).

- name: Upload test figures
uses: actions/upload-artifact@v4
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/notebook-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Runs the docs/notebooks/ tutorials end-to-end with nbmake so that API drift
# in neural_lam breaks the notebook loudly instead of letting it rot. CPU-only.
# Scoped to PRs that touch code the notebooks depend on (plus every push to
# main and manual dispatch), so unrelated PRs don't pay the ~3 min cost.
name: Notebook tests

on:
push:
branches: [main]
pull_request:
paths:
- "neural_lam/**"
- "docs/notebooks/**"
- "tests/datastore_examples/**"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/notebook-tests.yml"
workflow_dispatch:

jobs:
notebooks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: 3.13

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install with uv
run: |
uv sync --extra cpu --group dev --locked
echo "$PWD/.venv/bin" >> $GITHUB_PATH

- name: Run notebook tests
run: |
pytest -vv -s --nbmake --nbmake-timeout=600 docs/notebooks/
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ repos:
hooks:
- id: codespell
description: Check for spelling errors
# codespell reads [tool.codespell] from pyproject.toml via tomllib,
# which is unavailable on Python <3.11 unless `tomli` is installed;
# on such runners the config silently fails to load. Pass --skip
# explicitly so it doesn't depend on that.
args:
- --skip=requirements/*,docs/notebooks/hello_world_danra.ipynb

- repo: https://github.com/psf/black
rev: 25.11.0
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased](https://github.com/mllam/neural-lam/compare/v0.6.0...HEAD)

### Added
- Add `hello_world_danra.ipynb` end-to-end tutorial notebook for training on DANRA, with a dedicated path-filtered CI workflow that runs it end-to-end via `nbmake` [\#577](https://github.com/mllam/neural-lam/pull/577) @Sharkyii

- Add `--num_sanity_val_steps` CLI argument to control sanity validation steps before training (#694)

- Add `--train_steps_to_log` CLI option to log training loss for individual unroll steps, and deduplicate common prediction and loss computation steps across loops [\#674](https://github.com/mllam/neural-lam/issues/674) @GiGiKoneti
Expand Down Expand Up @@ -48,6 +50,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- `train_model.main` now re-raises on error (`@logger.catch(reraise=True)`) instead of logging and exiting 0, so training/eval failures surface to callers and CI (e.g. the notebook `nbmake` run) rather than passing silently [\#577](https://github.com/mllam/neural-lam/pull/577)

- Allow `graph_lam` training and checkpoint reloads to accept the full set of
GNN type CLI options without passing hierarchical-only options to unsupported
constructors via a shared `build_predictor` helper ([#686](https://github.com/mllam/neural-lam/issues/686)).

- Fix `RuntimeError` in `HiLAMParallel` forward pass on hierarchical graphs by offsetting edge indices into the global mesh node index space ([#679](https://github.com/mllam/neural-lam/issues/679))

- Fix `IndexError` in HiLAM forward pass by offsetting grid nodes in `zero_index_g2m`/`zero_index_m2g` by the total mesh-node count across all levels ([#642](https://github.com/mllam/neural-lam/issues/642)) @Sir-Sloth-The-Lazy
Expand Down
23 changes: 23 additions & 0 deletions docs/notebooks/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Standard library
import subprocess
import sys
from pathlib import Path

# Third-party
import pytest


@pytest.fixture(scope="session", autouse=True)
def setup_danra_datastore():
"""Create the DANRA zarr datastore required by hello_world_danra.ipynb."""
datastore_config = Path(
"tests/datastore_examples/mdp/danra_100m_winds/danra.datastore.yaml"
)
zarr_output = datastore_config.parent / "danra.datastore.zarr"

# Only create if it doesn't exist
if not zarr_output.exists():
subprocess.run(
[sys.executable, "-m", "mllam_data_prep", str(datastore_config)],
check=True,
)
42 changes: 35 additions & 7 deletions docs/notebooks/create_reduced_meps_dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [],
"source": [
"# Standard library\n",
Expand All @@ -36,7 +40,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [],
"source": [
"# Load existing grid\n",
Expand All @@ -61,7 +69,11 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [],
"source": [
"# Outer 10 grid points are border\n",
Expand Down Expand Up @@ -91,7 +103,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [],
"source": [
"# Load surface_geopotential.npy, index only values from the reduced grid, and save to new file\n",
Expand Down Expand Up @@ -124,7 +140,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [],
"source": [
"num_vars = 8\n",
Expand Down Expand Up @@ -162,7 +182,11 @@
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [
{
"name": "stdout",
Expand All @@ -188,7 +212,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"skip-execution"
]
},
"outputs": [],
"source": [
"for sample in ['train', 'test', 'val']:\n",
Expand Down
Loading
Loading