- utbygging.py: when each facility starts and which vintages of IT hardware it gets (S22, S33), with chips as a stock, replacement before new facilities and the export rule. - kraftsystem.py: the fitted price lines and the power and capacity balances year by year (S23, S24, S25, S38). - kontantstrom.py: the yearly cash flows per facility, the additionality rule by iteration, the residual value and the net present value for Norway (S26, S34, S35, S40, S45), for the solutions A, B, B', C and R. - hendelser.py and data/aarshendelser.npy: the stream of random numbers for the export rule, one uniform number per draw and year 2028-2100, from its own seed. - inndata.py: one set of values in the units of the equations. - ligninger.py: one function per equation for chapters 4 to 6. Tested on a made-up set of values only (tests/conftest.py); no result for the hypothesis has been computed. 271 tests pass. Seven are documented misses against a source: the five from before, and the price lines for NO3 and NO4, which miss one of NVE's twelve scenarios by 6.0 and 7.7 per cent. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
61 lines
1.9 KiB
TOML
61 lines
1.9 KiB
TOML
# 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",
|
||
"N815",
|
||
# 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
|
||
"SIM300", # result fields named after symbols (RV, NNV, SE) are not constants
|
||
]
|