Repository navigation
Add references to the law of policy objects (GEP 11) - #167
Draft
MImmesberger wants to merge 5 commits into
Draft
MImmesberger wants to merge 5 commits into
MImmesberger wants to merge 5 commits into
Conversation
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 Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theReference:section of policy and param function docstrings (a single reference inline, several as a-list), from thereferencekey of parameters (string or list), and from thereferenceof aRoundingSpec.none (<reason>)becomes aNoLegalReference.legal_referencesproperties onColumnFunction,ParamFunction,ParamObjectandRoundingSpec. Thereferencefield of param objects now also accepts a list.LegalReferenceParserprotocol (parse_reference,parse_query,matches), passed viamain(legal_references_parser=...)likeunit_system.legal_references.by_path(each path mapped to its parsed references, rounding references merged in; malformed references raise with the path) andlegal_references.by_query(inputlegal_references_query, a string or a tuple of strings).Todo