Scripts and SLURM jobs¶
The scripts/ directory holds the command-line entry points that the notebooks
call and the SLURM jobs run. This page is an inventory; for how they fit together
see the workflow overview and the
SLURM reference.
Processing scripts (scripts/)¶
These are plain Python entry points, each a thin wrapper around a module in
src/rainfall_rescue_sqlite/. A single SLURM array task typically runs one of
these for its shard.
Script |
Stage |
Purpose |
|---|---|---|
|
Ingestion |
Rainfall Rescue CSV → Parquet |
|
Ingestion |
Ensemble JSON → Parquet |
|
Ingestion |
Sharded ensemble ingest and merge |
|
Matching |
Build the normalised comparison vectors |
|
Matching |
Sharded matching and merge |
|
Matching |
Baseline similarity scoring |
|
Matching |
Copy RR metadata onto matched records |
|
QC1 |
Monthly-total check, sharded, and merge |
|
QC2 |
Build the daily-consensus table |
|
QC2 |
Regional neighbour statistics |
|
QC2 |
Train and score the secondary ML check |
|
Export |
Merge duplicates → SEF |
|
Analysis |
Parse SEF → analysis Parquet |
|
Analysis |
Consensus-rainfall animation stages |
|
Analysis |
SEF-rainfall animation stages |
SLURM jobs (scripts/slurm/)¶
Each pipeline has a submit_*.sh driver that sources config.sh and submits the
.sbatch files below with the right dependencies.
Driver |
|
Shape |
|---|---|---|
|
|
array + merge |
|
|
build + array + merge |
|
|
array + merge |
|
|
array + merge |
|
|
array + merge |
|
|
train + score |
|
|
array |
|
|
array |
|
|
4-stage |
|
|
4-stage |
config.sh is the single source of truth for paths, shard counts, parameters and
resources; see the SLURM reference.
Diagnostic scripts (scripts/diagnostics/)¶
These build the maps and figures the notebooks embed. Most have a build_figure
function the notebooks import, and a __main__ block so they can be run from the
command line to write a standalone image or self-contained interactive HTML.
Script |
Produces |
|---|---|
|
One-page per-transcription diagnostic (image, consensus table, monthly comparison, map) |
|
Static UK map of consensus rainfall for a date |
|
Interactive (Plotly) version of the daily map |
|
Interactive map coloured by QC1 flag |
|
Interactive map of any regional statistic |
|
Interactive map coloured by the secondary-QC flag |
|
Matching-health map: exact matches per RR station |
|
Distribution of rank-1 exact-agreement counts |
For example:
python scripts/diagnostics/plot_daily_rainfall_map.py 1931-10-15 \
--output daily_map.webp