Skip to content

Add references to the law of policy objects (GEP 11) - #167

Draft
MImmesberger wants to merge 5 commits into
mainfrom
claude/project-thread-y388yx
Draft

MImmesberger wants to merge 5 commits into
mainfrom
claude/project-thread-y388yx

Conversation

@MImmesberger

@MImmesberger MImmesberger commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

What problem do you want to solve?

Implements the TTSIM part of GEP 11 (ttsim-dev/gettsim#1264). TTSIM knows where references to the law are stored but not how to interpret them; the country package supplies the interpretation.

  • ttsim.tt.legal_references: extracts references from the Reference: section of policy and param function docstrings (a single reference inline, several as a - list), from the reference key of parameters (string or list), and from the reference of a RoundingSpec. none (<reason>) becomes a NoLegalReference.
  • legal_references properties on ColumnFunction, ParamFunction, ParamObject and RoundingSpec. The reference field of param objects now also accepts a list.
  • LegalReferenceParser protocol (parse_reference, parse_query, matches), passed via main(legal_references_parser=...) like unit_system.
  • Main targets legal_references.by_path (each path mapped to its parsed references, rounding references merged in; malformed references raise with the path) and legal_references.by_query (input legal_references_query, a string or a tuple of strings).

Todo

  • Pick an appropriate title.
  • Document PR in CHANGES.md.

Extract references from the Reference: section of policy function docstrings, the
reference key of parameters, and RoundingSpecs. Add the legal_references_parser hook
supplied by the country package and the main targets legal_references.by_path and
legal_references.by_query.
@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant