feat(kode): bring the ownership comparison in line with clarifications 62-69
eierskap.py: the residual value and the sale at the final year, the levies, the private owners' cash flow and the settlement over the draws, the present value with rho_D without the debt flows, the required return before tax, and equal values in the ranking. Also the median of the petroleum cash flow in 2025 kroner, the state's cash flow next to M6, the shares shown next to each verdict, and the sources' figures for M5 (i). Made-up numbers only: 424 tests pass, 7 documented misses. The project's code and the independent reader's code agree to within one krone on 1 500 made-up paths. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
946adad62c
commit
d607128ec6
12 changed files with 718 additions and 112 deletions
|
|
@ -6,6 +6,7 @@ here says anything about the hypothesis.
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
|
@ -150,3 +151,18 @@ def test_m5_samlet() -> None:
|
|||
assert miljo.m5(Dom.BETINGELSER, Dom.BETINGELSER) is Dom.HOLDER_IKKE
|
||||
assert miljo.m5(Dom.HOLDER, Dom.HOLDER_IKKE) is Dom.HOLDER_IKKE
|
||||
assert miljo.m5(Dom.HOLDER, Dom.HOLDER, kostnadsfort=False) is Dom.HOLDER_IKKE
|
||||
|
||||
|
||||
def test_tabellen_for_m5_er_den_i_spesifikasjonen() -> None:
|
||||
"""Clarification 68: the fixed figures in the code are the table of the specification.
|
||||
|
||||
Only the numbers are compared. M5 is not decided here.
|
||||
"""
|
||||
tekst = (Path(__file__).parents[1] / "modell" / "spesifikasjon.md").read_text("utf-8")
|
||||
assert len(miljo.KILDEVERDIER_M5) == 3
|
||||
for k in miljo.KILDEVERDIER_M5:
|
||||
(rad,) = [linje for linje in tekst.splitlines() if linje.startswith(f" | {k.kilde} (")]
|
||||
celler = [celle.strip() for celle in rad.strip().strip("|").split("|")]
|
||||
tall = [float(celle.replace(",", ".")) for celle in celler[1:5]]
|
||||
assert tall == [k.kjernekraft, k.vind, k.vann, k.vind_hoyeste]
|
||||
assert celler[5].split(", ") == list(k.poster)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue