tokenfabrikker/pyproject.toml
Kjell Tore Guttormsen a63f66c416
feat(kode): add the levelised equations, the parameter reader and the draws
One pure function per equation for chapters 1 to 3 of the specification
(S1-S21, S36, S43-S47), a strict reader for the frozen parameter file with
checksum, validation and unit conversion, and the 10 000 Monte Carlo draws of
the 87 drawn quantities, stored in data/ and reproducible bit for bit.

Tests: unit tests and edge cases per equation, the reader, the draws, and
known answers from Argonne, NOU 2026: 4, Epoch and NVE with the sources' own
assumptions. Five comparisons miss the 5 % tolerance and are kept as strict
expected failures with the measured deviation. No result for the hypothesis
is computed. ruff ALL and mypy strict pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:08:47 +01:00

59 lines
1.8 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tool configuration only. The pinned versions live in requirements.txt (runtime)
# and requirements-dev.txt (tests and checks); the code is run from src/ without
# being installed.
[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]
addopts = "-ra --strict-markers"
markers = [
"fasit: reproduces a published number with the source's own assumptions",
]
[tool.mypy]
strict = true
mypy_path = "src"
files = ["src", "tests"]
python_version = "3.11"
[tool.ruff]
line-length = 100
target-version = "py311"
src = ["src", "tests"]
# Text files (sources, specification, pre-registration) are never touched by the formatter.
extend-exclude = ["*.md"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Formatter conflicts (ruff's own recommendation).
"COM812",
"ISC001",
# Docstring style: Google convention is selected below; these two contradict it.
"D203",
"D213",
# Argument and variable names follow the symbols of the specification
# (P_u, KF, PUE, L_N, D_avv ...), so that every function can be read against
# its equation. Lower-casing them would break that link.
"N802",
"N803",
"N806",
# One function per equation: an equation with twelve symbols has twelve arguments.
"PLR0913",
# The licence is stated once, in LICENSE; files carry no copyright header.
"CPY001",
]
# The parameter file writes "no unit" and ranges with an en dash; the code must match it.
allowed-confusables = ["–"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101", # assert is what a test is
"PLR2004", # published numbers are compared as literals, with the source next to them
"INP001", # tests are not a package
"D103", # the name of a test says what it tests
"PLR0917", # helpers that mirror a source's table take its columns in order
]