Skip to content

Commit 7cf5e20

Browse files
committed
updated batch comparison documentation
1 parent 8a92703 commit 7cf5e20

10 files changed

Lines changed: 39 additions & 21 deletions

Changelog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
version 1.3.1 (pre-release)
22
===============================
33
* Added evaluation support for Helium Augmented and GrandSlam flights (ignoring ascent phase in evaluation)
4+
* Added new wind interpolation methods, selectable via `config_earth.forecast['wind_interpolation']`
5+
* Added batch comparison script `python -m evaluation.compare_batches <A> <B>`
6+
* Fixed blank GFS hodograph in `plot_windmap` - `plotWind2` was indexing the full netCDF arrays with cropped-region indices, landing in the wrong geographic cell
7+
48

59
version 1.3
610
===============================

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = 'Tristan Schuler'
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = '1.3.0'
26+
release = '1.3.1'
2727

2828
# The suffix of source filenames.
2929
#source_suffix = '.rst'

docs/source/evaluation/batchComparison.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ and overview bar + scatter plots for every metric. This builds on
2020
error, so **negative Δ means improvement** (and is colored green).
2121

2222

23-
Quick start
24-
-----------
23+
Running a comparison
24+
--------------------
2525

2626
.. code-block:: bash
2727
@@ -43,8 +43,8 @@ Self-comparison (``compare_batches X X``) is allowed and useful as a
4343
sanity check — every delta should be zero.
4444

4545

46-
Output structure
47-
----------------
46+
Comparison output folder
47+
------------------------
4848

4949
Each comparison writes a self-contained folder next to ``batches/``:
5050

@@ -67,9 +67,23 @@ relative path so the folder is portable.
6767
HTML report
6868
-----------
6969

70+
The example below is the per-launch detail table from the linear_neighbors → linear_full
71+
comparison, filtered to the Sandia launches. Each metric occupies three sub-cells
72+
(``A | B | Δ``), and Δ cells are colored only when the change clears both the
73+
absolute and percent thresholds — green for improvement, red for regression,
74+
gray for "within noise". Metrics that don't depend on wind interpolation
75+
(time-to-float, temp MAE, ascent rate, etc.) stay at "+0.0 (+0.0%)" across the
76+
board, which is itself a useful sanity check.
77+
78+
|cmp_html|
79+
80+
.. |cmp_html| image:: ../../../img/compare_html_sandia_table.png
81+
:width: 100%
82+
:alt: Per-launch deltas table from compare.html, filtered to Sandia launches
83+
7084
The report opens with a **summary** block — 5–7 lines covering the headline
7185
metrics (landing distance, landing time error, float altitude error) to
72-
see whether the change helped or hurt.
86+
see whether the change helped or hurt.
7387

7488
Below the summary:
7589

evaluation/compare_batches.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"abs_floor": 1000.0, "fmt": ".0f",
7878
}
7979

80-
# Headlines shown in the stdout/HTML TL;DR block (in order).
80+
# Headlines shown in the stdout/HTML Summary block (in order).
8181
PRIMARY_METRIC_KEYS = [
8282
"landing_distance_km",
8383
"time_to_ground_diff_min",
@@ -386,10 +386,10 @@ def compute_aggregates(rows: list[dict], available_metrics: list[dict]) -> list[
386386
return out
387387

388388

389-
# ── TL;DR ─────────────────────────────────────────────────────────────────────
389+
# ── Summary ─────────────────────────────────────────────────────────────────────
390390

391391

392-
def build_tldr_lines(rows: list[dict], available_metrics: list[dict]) -> list[str]:
392+
def build_summary_lines(rows: list[dict], available_metrics: list[dict]) -> list[str]:
393393
"""Build short headline strings: one per primary metric per forecast type."""
394394
keys_by = {m["key"]: m for m in available_metrics}
395395
forecasts = sorted({r["forecast_type"] for r in rows})
@@ -494,11 +494,11 @@ def main(argv=None) -> int:
494494
reforecast_section, out_dir,
495495
)
496496

497-
# TL;DR.
498-
tldr = build_tldr_lines(per_launch, available_metrics)
497+
# Summary.
498+
summary_lines = build_summary_lines(per_launch, available_metrics)
499499
print()
500-
print("TL;DR:")
501-
for line in tldr:
500+
print("Summary:")
501+
for line in summary_lines:
502502
print(line)
503503
print()
504504

@@ -511,7 +511,7 @@ def main(argv=None) -> int:
511511
reforecast_section=reforecast_section,
512512
asymmetries=asym, missing=missing,
513513
available_metrics=available_metrics,
514-
tldr_lines=tldr, plot_files=plot_files,
514+
summary_lines=summary_lines, plot_files=plot_files,
515515
)
516516
print(f" Wrote: {html_path}")
517517
return 0

evaluation/compare_reporting.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Minimal header (batch IDs, timestamps, git hashes, notes for A and B)
55
- Schema-mismatch warning banner (if any metrics were dropped)
66
- Asymmetries section (only-in-A, only-in-B, failed-in-one)
7-
- TL;DR block (one line per primary metric x forecast type)
7+
- Summary block (one line per primary metric x forecast type)
88
- Aggregate table (Overall, per forecast_type, per campaign)
99
- Win/Loss count table (per metric, per group)
1010
- Per-launch diff table (3 sub-cells per metric: A | B | Δ)
@@ -208,10 +208,10 @@ def info_block(label: str, b: BatchData) -> str:
208208
)
209209

210210

211-
def _build_tldr_section(lines: list[str]) -> str:
211+
def _build_summary_section(lines: list[str]) -> str:
212212
body = _html.escape("\n".join(lines)) if lines else "(no primary metrics available)"
213213
return (
214-
"<div class='section'><h2>TL;DR</h2>"
214+
"<div class='section'><h2>Summary</h2>"
215215
f"<pre style='background:#fff;padding:12px;border:1px solid #ccc;border-radius:4px;"
216216
f"font-size:0.95em;line-height:1.5'>{body}</pre></div>"
217217
)
@@ -377,7 +377,7 @@ def write_compare_html(out_dir: str, batch_a: BatchData, batch_b: BatchData,
377377
per_launch: list[dict], aggregates: list[dict],
378378
reforecast_section: Optional[dict],
379379
asymmetries: dict, missing: dict,
380-
available_metrics: list[dict], tldr_lines: list[str],
380+
available_metrics: list[dict], summary_lines: list[str],
381381
plot_files: dict) -> str:
382382
leading = ["Launch", "Forecast", "Campaign"]
383383
per_launch_header = _build_metric_header(available_metrics, leading)
@@ -456,7 +456,7 @@ def write_compare_html(out_dir: str, batch_a: BatchData, batch_b: BatchData,
456456
&nbsp;&nbsp;<span style='color:#666'>Click any column header to sort ↑↓</span>
457457
</div>
458458
459-
{_build_tldr_section(tldr_lines)}
459+
{_build_summary_section(summary_lines)}
460460
{_build_asymmetries_section(asymmetries)}
461461
462462
<div class='section'>

img/compare_html_sandia_table.png

146 KB
Loading
70.1 KB
Loading
59.8 KB
Loading

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name='EarthSHAB',
6-
version='1.3.0',
6+
version='1.3.1',
77
package_dir={"": "src"},
88
packages=find_packages(where="src"),
99
install_requires=[],

src/EarthSHAB/config_earth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# np.interp fallback when alt is outside the
3838
# profile bounds (avoids spline overshoot above
3939
# the highest pressure level).
40-
wind_interpolation = 'spline_full',
40+
wind_interpolation = 'linear_neighbors',
4141
)
4242

4343
#These parameters are for both downloading new forecasts, and running simulations with downloaded forecasts.

0 commit comments

Comments
 (0)