feat: model core, launcher, reproduction check and the first two skills

The core in modell/kjerne/ is an unmodified copy of sim.py, diagnose.py and
forlop.py from den-dynamiske-rettsstaten @2badc25, pinned by sha256.
kjor.py is the single entry point; kontroll.py reproduces the note's 22 data
files and printed results. Skills: diagnose and forlop (Norwegian).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-11 13:53:32 +01:00
commit 464ad38b49
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
51 changed files with 11207 additions and 0 deletions

55
pyproject.toml Normal file
View file

@ -0,0 +1,55 @@
# Not an installable distribution: no [project] table and no build backend.
# Development environment (pip 25.1 or newer reads PEP 735 dependency groups):
# python3 -m venv .venv && .venv/bin/pip install --group dev
# The plugin itself needs only the Python standard library; numpy and scipy are installed
# at the user's request by `modell/kjor.py miljo --opprett` (pins in modell/requirements.txt).
[dependency-groups]
dev = [
"numpy==2.5.4",
"scipy==1.18.1",
"pytest==9.2.0",
"ruff==0.17.4",
"mypy==2.4.1",
]
[tool.ruff]
target-version = "py39" # kjor.py and kontroll.py must run on Python 3.9
line-length = 120
extend-exclude = ["modell/kjerne"] # unmodified copy of the note's code: never linted or reformatted
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"T201", # a command-line tool that talks to the user with print()
"S603", # subprocess is always called with a fixed argument list, never through a shell
"INP001", # modell/ and tests/ are folders of scripts, not packages
"N818", # exception names are Norwegian (Bruksfeil already ends in "feil", error)
"D401", # docstrings are Norwegian; the imperative-mood check only knows English verbs
]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # pytest uses assert
"PLR2004", # exit codes and counts are compared as literals in tests
"D103", # test names describe the behaviour under test; a docstring would repeat them
]
[tool.mypy]
strict = true
files = ["modell", "tests"]
mypy_path = "modell"
exclude = ['^modell/kjerne/', '^\.venv/']
# mypy 2.x cannot target Python 3.9 (it requires 3.10 or newer); Python 3.9 compatibility of
# kjor.py and kontroll.py is checked by ruff (target-version) and by a test that runs them on 3.9.
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["modell"]
addopts = "-m 'not treg'"
markers = [
"treg: runs sim.py in full (about 1-2 minutes); deselected by default, run with -m treg",
]