Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0e13e48
Increase title spacing and restore axes titles
LydiaFrance Oct 29, 2025
0d7efe8
Extract meta info about training and data for the title
LydiaFrance Oct 29, 2025
f5a195a
Refactor to use metadata in plots
LydiaFrance Oct 29, 2025
4800b8c
Include hemisphere type
LydiaFrance Oct 29, 2025
e413ba5
Refactor for complex plot title with metadata
LydiaFrance Oct 29, 2025
d1f33b1
Tests for metadata titles
LydiaFrance Oct 29, 2025
1749e46
Restore the ruff settings
LydiaFrance Oct 29, 2025
22284ed
Change spacing layout of figure
LydiaFrance Oct 30, 2025
a08fb57
Include optional footer with metadata not title
LydiaFrance Oct 30, 2025
18e14ec
Include option for footer
LydiaFrance Oct 30, 2025
075e122
Extra tests to check the textboxes don't overlap
LydiaFrance Oct 30, 2025
13f842f
Fix for mypy and restore ruff settings
LydiaFrance Oct 30, 2025
4faf6d5
Make sure footer is in the config
LydiaFrance Oct 30, 2025
b14e779
Expose n_history_steps for plots
LydiaFrance Oct 30, 2025
023a2ef
Ruff settings
LydiaFrance Nov 22, 2025
2c00b13
return variable names from input data
LydiaFrance Nov 22, 2025
3dcded7
Preventing memory leaks from plotting
LydiaFrance Nov 22, 2025
56ecffe
prevent memory leak and log more errors
LydiaFrance Nov 22, 2025
6c83ddf
Raw input callback file
LydiaFrance Nov 22, 2025
71d448c
Config for raw input plotting
LydiaFrance Nov 22, 2025
699bf18
update init and default yaml for raw input config
LydiaFrance Nov 22, 2025
8629239
Memory and garbage collection for animation
LydiaFrance Nov 22, 2025
170ecb9
Improve saving
LydiaFrance Nov 22, 2025
1965872
Add colour map helper
LydiaFrance Nov 22, 2025
57e888e
Generalise further, plot styles, allow easier local save
LydiaFrance Nov 22, 2025
52f1b04
Refactor layout for single panel plots
LydiaFrance Nov 22, 2025
25506de
work with style and layout object
LydiaFrance Nov 22, 2025
ce01455
file for raw plots
LydiaFrance Nov 22, 2025
ed0179f
Update fixtures for raw plot testing
LydiaFrance Nov 22, 2025
9be6ddc
Tests for api updated
LydiaFrance Nov 22, 2025
afe72fb
Add layout tests for single panel
LydiaFrance Nov 22, 2025
a837b26
Tests for raw plots
LydiaFrance Nov 22, 2025
74e7062
Fix path name
LydiaFrance Nov 22, 2025
d66ac30
Add CLI for plotting raw input data
LydiaFrance Nov 22, 2025
a2cf47a
Fix type checks for mypy
LydiaFrance Nov 22, 2025
545de3d
Fix circular import
LydiaFrance Nov 27, 2025
3122f5f
fix circular import
LydiaFrance Nov 27, 2025
e53a744
Merge branch 'main' into 99-raw-plots
LydiaFrance Nov 27, 2025
ff11b2e
Fix issues for ruff
LydiaFrance Nov 27, 2025
0060475
Fix issues for mypy
LydiaFrance Nov 27, 2025
058491c
Add ffmpeg to github action to test video saving
LydiaFrance Nov 27, 2025
008d001
Change saving locally to base path root
LydiaFrance Nov 27, 2025
6ad10fb
Fix path names
LydiaFrance Nov 27, 2025
b3b1bbe
Option for scientific notation on colourbar
LydiaFrance Nov 27, 2025
e4601be
altering colourbar format for raw plots
LydiaFrance Nov 27, 2025
c44fd65
add scientific notation to variable style
LydiaFrance Nov 27, 2025
e005fe6
add test for scientific notation
LydiaFrance Nov 27, 2025
586a800
Change humidity to scientific notation (other option is more decimals)
LydiaFrance Nov 27, 2025
447db5c
Fix problem with mypy
LydiaFrance Nov 27, 2025
c8d98c3
Fix mypy problem with save dir
LydiaFrance Nov 27, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/test_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
uses: astral-sh/setup-uv@v6
with:
version: "0.8.3"
- name: Install ffmpeg (so matplotlib can call it)
run: |
sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Run pytest
run: uv run --group dev pytest
- name: Run mypy
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
# Run the linter
- id: ruff-check
args: ["--fix", "--show-fixes"]
pass_filenames: false
pass_filenames: true
# Run the formatter
- id: ruff-format
pass_filenames: false
pass_filenames: true
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ Run `uv run zebra train` to train using the datasets specified in the config.

Run `uv run zebra evaluate --checkpoint PATH_TO_A_CHECKPOINT` to evaluate using a checkpoint from a training run.

### Visualisations

Plot raw input variables from the test dataset:

```bash
uv run zebra visualisations plot-raw-inputs --config-name <your local config>.yaml --sample-idx 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe explain what the sample-idx argument is doing? Is it the same as the timestep_index?

```

Create animations of raw inputs over time:

```bash
uv run zebra visualisations animate-raw-inputs --config-name <your local config>.yaml
```

Settings (output directories, styling, animation parameters) are read from `config.evaluate.callbacks.raw_inputs` in your YAML config files. Command-line options can override config values if needed.

## Adding a new model

### Background
Expand Down
2 changes: 2 additions & 0 deletions ice_station_zebra/callbacks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from .ema_weight_averaging_callback import EMAWeightAveragingCallback
from .metric_summary_callback import MetricSummaryCallback
from .plotting_callback import PlottingCallback
from .raw_inputs_callback import RawInputsCallback
from .unconditional_checkpoint import UnconditionalCheckpoint

__all__ = [
"EMAWeightAveragingCallback",
"MetricSummaryCallback",
"PlottingCallback",
"RawInputsCallback",
"UnconditionalCheckpoint",
]
7 changes: 6 additions & 1 deletion ice_station_zebra/callbacks/plotting_callback.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Set matplotlib backend before any plotting imports
import matplotlib as mpl

mpl.use("Agg")

import dataclasses
import logging
from collections.abc import Mapping, Sequence
Expand Down Expand Up @@ -207,7 +212,7 @@ def log_static_plots(
)
except InvalidArrayError as err:
logger.warning("Static plotting skipped due to invalid arrays: %s", err)
except (ValueError, MemoryError, OSError):
except Exception:
logger.exception("Static plotting failed")

def log_video_plots(
Expand Down
Loading
Loading