Skip to content

Document handling of negative FRS amounts - #2489

Merged
juaristi22 merged 1 commit into
mainfrom
fix-596-frs-negative-values-docs
Oct 19, 2026
Merged

juaristi22 merged 1 commit into
mainfrom
fix-596-frs-negative-values-docs

Conversation

@juaristi22

Copy link
Copy Markdown
Collaborator

Fixes #596

Documents the existing treatment of negative FRS tax, benefit and transfer amounts, with a link from the book index. The page cites pinned current and historical import code, distinguishes survey fields from model inputs, and explains why the handling varies by field. It does not assign a universal meaning to -1 or change the optional imputation proposal.

Validation: formatting, diff, source-link and book-navigation checks passed. The HTML build and rendered page checks passed after retrying a sandbox DNS failure with public MyST template assets and web libraries available. Notebooks were not executed. Model tests were not run for this documentation-only change.

Reproducer: n/a: documentation only; no executable code or dependency changes.

axiom: n/a: documentation and changelog only; no policy rules, parameters or data processing change.

@juaristi22 juaristi22 self-assigned this Oct 17, 2026

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right, fine to approve.

@juaristi22, I checked the page's claims against policyengine-uk-data at the pinned commit a43e8c5, and they are accurate. sum_from_positive_fields floors the row sum, not each field (utils/datasets.py:51). sum_positive_variables floors each component. WEEKS_IN_YEAR is 365.25 / 7 (frs.py:50). Council Tax replaces a negative or missing ctannual with the regional band mean. benamt is summed by benefit code with no floor, and ctrebamt is floored at zero. The pinned input_dataframe.py lines are the plain column-to-input loop the page describes.

  1. nit: docs/book/index.md:9-12 adds a "Survey data" section to the book's front page for this one page. The page already reaches the navigation through the assumptions/*.md pattern in myst.yml. A front-page link is fine if you want it found, but a single-link section sits a little oddly between the intro and the demo. This is your call.
  2. nit: the changelog fragment is added. #2482 uses changed for a docs-only change. Either is fine. I mention it only for consistency.
  3. nit: the page pins line ranges in two repos. The pins keep the links stable, which is good. Readers should know they describe that commit, not main. The second paragraph says this already, so no change is needed.

What I checked

  • Read the full diff, the PR body, #596 and the linked openfisca-uk-data discussion.
  • Fetched datasets/frs.py and utils/datasets.py at a43e8c5 and read every cited line range. Read data/input_dataframe.py:376-409 at e1601db.
  • No law to check: this changes documentation only.
  • Hosted CI: 5 checks pass and 4 are skipped, as usual for a docs-only PR. I did not build the docs locally.
  • The Reproducer and axiom lines are n/a with reasons, and the Fix evidence check passes.
  • No overlap with the other open PRs I checked.

🤖 Generated with Claude Code

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, per my review above. The nits can follow.

@juaristi22
juaristi22 added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit c8ffbd4 Oct 19, 2026
9 checks passed
@juaristi22
juaristi22 deleted the fix-596-frs-negative-values-docs branch October 19, 2026 13:11
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.

Document treatment of -1 in FRS tax/benefit amount columns

2 participants