feat(trekninger): read parameter file 1.1 and store the new draws

The loader knows the new checksum and the units of the new quantities
(g CO2 per kWh, cubic metres per MWh). 10 000 draws of 91 quantities with the
same seed; the four new ones are the last columns. All columns have new
numbers, because the random numbers are laid out row by row. The stream for
yearly events is byte for byte the same; only its description records the new
checksum. Tests for the counts, the new quantities and the checksum in the
pre-registration. README, CHANGELOG and CLAUDE.md updated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-12 23:07:09 +01:00
commit ea26cd4226
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
9 changed files with 100 additions and 25 deletions

View file

@ -49,7 +49,7 @@ def _kvantil(sett: pm.Parametersett, navn: str, q: float) -> float:
def test_oppsettet_folger_parameterfila(
sett: pm.Parametersett, trukket: trekninger.Trekninger
) -> None:
assert trukket.tabell.shape == (10_000, 87)
assert trukket.tabell.shape == (10_000, 91)
assert trukket.kolonner == tuple(s.navn for s in sett.stokastiske())
assert trukket.tabell.dtype == np.float64
assert np.isfinite(trukket.tabell).all()
@ -96,7 +96,7 @@ def test_skriv_og_les(
def test_kommandolinjen(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
assert trekninger.main(["lag", "--mappe", str(tmp_path)]) == 0
assert "10000 trekninger av 87 størrelser" in capsys.readouterr().out
assert "10000 trekninger av 91 størrelser" in capsys.readouterr().out
assert trekninger.main(["kontroll", "--mappe", str(tmp_path)]) == 0
assert capsys.readouterr().out.startswith("identisk")