diff --git a/.github/test_outcome_allowlist.toml b/.github/test_outcome_allowlist.toml index e3b947e134..a1bdda7f7f 100644 --- a/.github/test_outcome_allowlist.toml +++ b/.github/test_outcome_allowlist.toml @@ -52,6 +52,13 @@ reason = '\.github' modes = ["wheel"] why = "Tests of the CI scripts in .github skip themselves in an installed wheel, which does not contain .github; they run against the source tree on every PR." +[[allow]] +nodeid = "policyengine_uk/tests/code_health/test_docs_toc.py" +outcome = "collect-skipped" +reason = 'myst\.yml' +modes = ["wheel"] +why = "The installed wheel holds neither myst.yml nor the docs, so the documentation table of contents test skips itself there; it runs against the source tree on every PR." + [[allow]] nodeid = "policyengine_uk/tests/*" outcome = "skipped" diff --git a/changelog.d/2803.fixed.md b/changelog.d/2803.fixed.md new file mode 100644 index 0000000000..aa809a26c0 --- /dev/null +++ b/changelog.d/2803.fixed.md @@ -0,0 +1 @@ +The documentation site now publishes nine programme and validation notebooks it left out, among them Housing Benefit and the childcare entitlements, and lists the gambling duties page. Links on three pages reach their targets, and the model baseline page pins its parameter links to a commit so each line anchor stays on the value it cites. Twelve parameter labels now spell LBTT, LTT, LHA and TV in capitals. The residential SDLT lease rent rates take the unit /1, and the programme registry names HMRC as the agency for Scottish income tax. The childcare examples now state the birth dates and school status behind their amounts, the student loan page describes each plan from the regulations and says Plan 5 carries no liability before 6 April 2026, and the Housing Benefit page gives the 1 July 2026 abolition date with its exceptions. diff --git a/docs/book/assumptions/takeup-analysis-plan.md b/docs/book/assumptions/takeup-analysis-plan.md index 519da82353..d4fccc4b28 100644 --- a/docs/book/assumptions/takeup-analysis-plan.md +++ b/docs/book/assumptions/takeup-analysis-plan.md @@ -136,7 +136,7 @@ For each programme above, the analysis should produce: Most published reference rates change roughly annually (HMRC's tax credit take-up rates stop at 2017 to 2018). The analysis should be repeatable, ideally as a notebook under -[`docs/book/validation/`](../validation/) so future builds can re-run +[`docs/book/validation/`](https://github.com/PolicyEngine/policyengine-uk/tree/main/docs/book/validation) so future builds can re-run it and update the gaps table. A notebook needs its own `file:` entry under Validation in `myst.yml` to appear in the docs, since only Markdown pages are picked up by folder. diff --git a/docs/book/policy/model-baseline.md b/docs/book/policy/model-baseline.md index b1d2e35b90..0c2aada0e5 100644 --- a/docs/book/policy/model-baseline.md +++ b/docs/book/policy/model-baseline.md @@ -20,25 +20,25 @@ The government increased the [employer National Insurance rate from 13.8% to 15% ### Universal Credit rebalancing -Parliament passed legislation to implement Universal Credit rebalancing reforms, with the [rebalancing switch activated in fiscal year 2025-26](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/active.yaml#L3). The reforms include [graduated standard allowance uplifts](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/standard_allowance_uplift.yaml) above inflation: 2.3% in 2026-27, 3.1% in 2027-28, 4.0% in 2028-29, and 4.8% in 2029-30. A [new health element of £217.26](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/new_claimant_health_element.yaml#L3) applies to most new claimants in fiscal year 2026-27, while existing health-element claimants keep the combined value of their standard allowance and health element at least in line with CPI. +Parliament passed legislation to implement Universal Credit rebalancing reforms, with the [rebalancing switch activated in fiscal year 2025-26](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/active.yaml#L3). The reforms include [graduated standard allowance uplifts](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/standard_allowance_uplift.yaml) above inflation: 2.3% in 2026-27, 3.1% in 2027-28, 4.0% in 2028-29, and 4.8% in 2029-30. A [new health element of £217.26](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/new_claimant_health_element.yaml#L3) applies to most new claimants in fiscal year 2026-27, while existing health-element claimants keep the combined value of their standard allowance and health element at least in line with CPI. ### Benefit uprating -Annual benefit uprating applied 4.1% increases to state pensions and 1.7% to working-age benefits, implemented through the [standard uprating mechanism](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/benefit_uprating_cpi.yaml). +Annual benefit uprating applied 4.1% increases to state pensions and 1.7% to working-age benefits, implemented through the [standard uprating mechanism](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/benefit_uprating_cpi.yaml). ## 2024 reforms ### Autumn Statement 2023 -The government announced further National Insurance cuts, reducing the [employee main rate from 10% to 8%](https://github.com/PolicyEngine/policyengine-uk/blob/e1601dbe4feb15e71d0d59b7a57f9d860741c068/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/rates/employee/main.yaml) and the [self-employed Class 4 rate from 9% to 6%](https://github.com/PolicyEngine/policyengine-uk/blob/e1601dbe4feb15e71d0d59b7a57f9d860741c068/policyengine_uk/parameters/gov/hmrc/national_insurance/class_4/rates/main.yaml) in fiscal year 2024-25. [Class 2 National Insurance contributions were abolished](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/national_insurance/class_2/flat_rate.yaml#L51-L56) for self-employed people, with the flat rate set to £0 in fiscal year 2024-25. +The government announced further National Insurance cuts, reducing the [employee main rate from 10% to 8%](https://github.com/PolicyEngine/policyengine-uk/blob/e1601dbe4feb15e71d0d59b7a57f9d860741c068/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/rates/employee/main.yaml) and the [self-employed Class 4 rate from 9% to 6%](https://github.com/PolicyEngine/policyengine-uk/blob/e1601dbe4feb15e71d0d59b7a57f9d860741c068/policyengine_uk/parameters/gov/hmrc/national_insurance/class_4/rates/main.yaml) in fiscal year 2024-25. [Class 2 National Insurance contributions were abolished](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/national_insurance/class_2/flat_rate.yaml#L51-L56) for self-employed people, with the flat rate set to £0 in fiscal year 2024-25. ### Capital gains tax changes (Autumn Budget 2024) -The government increased capital gains tax rates from 10%/20% to [18% for basic rate taxpayers](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/basic_rate.yaml#L4) and [24% for higher rate taxpayers](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/higher_rate.yaml#L4) for disposals from 30 October 2024 (Finance Act 2025 s. 7), part-way through 2024-25; the model day-weights that year between the two schedules and applies the new rates in full from 2025-26. Gains qualifying for Business Asset Disposal Relief or Investors' Relief (`capital_gains_badr`) are charged at a [separate rate](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/badr/rate.yaml) that rises from 10% to 14% in fiscal year 2025-26 and 18% from 2026-27, up to a [£1 million lifetime limit](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/badr/lifetime_limit.yaml). Carried interest (`capital_gains_carried_interest`) is charged at a [flat 32%](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/carried_interest/higher_rate.yaml) from fiscal year 2025-26 (Finance Act 2025 s. 12); its move into income tax from 2026-27 is not modelled. +The government increased capital gains tax rates from 10%/20% to [18% for basic rate taxpayers](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/basic_rate.yaml#L9) and [24% for higher rate taxpayers](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/higher_rate.yaml#L9) for disposals from 30 October 2024 (Finance Act 2025 s. 7), part-way through 2024-25; the model day-weights that year between the two schedules and applies the new rates in full from 2025-26. Gains qualifying for Business Asset Disposal Relief or Investors' Relief (`capital_gains_badr`) are charged at a [separate rate](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/badr/rate.yaml) that rises from 10% to 14% in fiscal year 2025-26 and 18% from 2026-27, up to a [£1 million lifetime limit](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/badr/lifetime_limit.yaml). Carried interest (`capital_gains_carried_interest`) is charged at a [flat 32%](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/carried_interest/higher_rate.yaml) from fiscal year 2025-26 (Finance Act 2025 s. 12); its move into income tax from 2026-27 is not modelled. ### Spring Budget 2024 -The government increased the [child benefit high income tax charge threshold from £50,000 to £60,000](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/income_tax/charges/CB_HITC/phase_out_start.yaml#L4) in fiscal year 2024-25. The [higher rate of capital gains tax on residential property](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/residential_property/higher_rate.yaml) fell from 28% to 24% for disposals from 6 April 2024 (Finance (No. 2) Act 2024 s. 6); the basic rate stayed at 18%, and neither changed on 30 October 2024. These rates apply to the `capital_gains_residential_property` component of a person's gains. +The government increased the [child benefit high income tax charge threshold from £50,000 to £60,000](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/income_tax/charges/CB_HITC/phase_out_start.yaml#L4) in fiscal year 2024-25. The [higher rate of capital gains tax on residential property](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/residential_property/higher_rate.yaml) fell from 28% to 24% for disposals from 6 April 2024 (Finance (No. 2) Act 2024 s. 6); the basic rate stayed at 18%, and neither changed on 30 October 2024. These rates apply to the `capital_gains_residential_property` component of a person's gains. ### Autumn Statement 2023 (Employee NI cut) @@ -48,7 +48,7 @@ An initial National Insurance cut reduced the [employee main rate from 12% to 10 ### Autumn Statement 2022 -The government reduced the [additional rate income tax threshold from £150,000 to £125,140](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml#L74-L78), taking effect in fiscal year 2023-24. The government also began reducing the [capital gains tax annual exempt amount from £12,300 to £6,000](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/annual_exempt_amount.yaml#L6-L10) in fiscal year 2023-24, with a further reduction to [£3,000 in fiscal year 2024-25](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/cgt/annual_exempt_amount.yaml#L11-L15). +The government reduced the [additional rate income tax threshold from £150,000 to £125,140](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml#L98-L99), taking effect in fiscal year 2023-24. The government also began reducing the [capital gains tax annual exempt amount from £12,300 to £6,000](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/annual_exempt_amount.yaml#L18-L19) in fiscal year 2023-24, with a further reduction to [£3,000 in fiscal year 2024-25](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/cgt/annual_exempt_amount.yaml#L23-L24). ## 2022 reforms @@ -62,39 +62,39 @@ The Health and Social Care Levy Act 2021 raised the [employee main rate from 12% ### Mini-Budget 2022 (September) -The government announced increases to [stamp duty nil rate thresholds](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/stamp_duty/residential/purchase/main/subsequent.yaml), raising the main threshold from £125,000 to £250,000 and the first-time buyer threshold to £425,000. +The government announced increases to [stamp duty nil rate thresholds](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/stamp_duty/residential/purchase/main/subsequent.yaml), raising the main threshold from £125,000 to £250,000 and the first-time buyer threshold to £425,000. ### Cost of living support -The government announced cost of living payments: [£650 for means-tested benefit recipients](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/treasury/cost_of_living_support/means_tested_households/amount.yaml#L4), [£300 for pensioners](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/treasury/cost_of_living_support/pensioners/amount.yaml#L4), and [£150 for disability benefit recipients](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/treasury/cost_of_living_support/disabled/amount.yaml#L4), implemented through dedicated [payment calculation variables](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/variables/gov/treasury/cost_of_living_support/cost_of_living_support_payment.py). +The government announced cost of living payments: [£650 for means-tested benefit recipients](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/treasury/cost_of_living_support/means_tested_households/amount.yaml#L3), [£300 for pensioners](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/treasury/cost_of_living_support/pensioners/amount.yaml#L3), and [£150 for disability benefit recipients](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/treasury/cost_of_living_support/disabled/amount.yaml#L3), implemented through dedicated [payment calculation variables](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/variables/gov/treasury/cost_of_living_support/cost_of_living_support_payment.py). ### Energy Price Guarantee -Following the energy crisis, the government introduced an [Energy Price Guarantee capping typical household bills at £2,500](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/ofgem/energy_price_guarantee.yaml) in fiscal year 2022-23. +Following the energy crisis, the government introduced an [Energy Price Guarantee capping typical household bills at £2,500](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/ofgem/energy_price_guarantee.yaml) in fiscal year 2022-23. ## 2021 reforms ### Autumn Budget 2021 -The government reduced the [Universal Credit taper rate from 63% to 55%](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/reduction_rate.yaml#L5) and increased [work allowances by £500 annually](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/work_allowance/without_housing.yaml#L9) in fiscal year 2021-22. +The government reduced the [Universal Credit taper rate from 63% to 55%](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/reduction_rate.yaml#L5) and increased [work allowances by £500 annually](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/work_allowance.yaml#L39) in fiscal year 2021-22. ### End of COVID-19 support -The government ended the [Universal Credit £20 weekly uplift](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/standard_allowance/amount.yaml) in fiscal year 2021-22, with rates reducing from the elevated 2020-21 levels. +The government ended the [Universal Credit £20 weekly uplift](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/standard_allowance/amount.yaml) in fiscal year 2021-22, with rates reducing from the elevated 2020-21 levels. ### Stamp duty holiday extension -The government extended the stamp duty holiday with [phased withdrawal of the nil rate increases](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/stamp_duty/residential/purchase/main/subsequent.yaml#L20-L22) during fiscal year 2021-22. +The government extended the stamp duty holiday with [phased withdrawal of the nil rate increases](https://www.legislation.gov.uk/ukpga/2021/26/section/87/enacted) during fiscal year 2021-22. ## 2020 reforms ### Summer Economic Update (July 2020) -The government introduced a [stamp duty holiday with nil rates up to £500,000](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/hmrc/stamp_duty/residential/purchase/main/subsequent.yaml#L9-L15) in fiscal year 2020-21 to support the housing market. +The government introduced a [stamp duty holiday with nil rates up to £500,000](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/hmrc/stamp_duty/residential/purchase/main/subsequent.yaml#L26) in fiscal year 2020-21 to support the housing market. ### COVID-19 response (March 2020) -Emergency measures included a [£20 weekly increase to Universal Credit standard allowances](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/parameters/gov/dwp/universal_credit/standard_allowance/amount.yaml#L6) and other working-age benefits in fiscal year 2020-21. +Emergency measures included a [£20 weekly increase to Universal Credit standard allowances](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/parameters/gov/dwp/universal_credit/standard_allowance/amount.yaml#L8) and other working-age benefits in fiscal year 2020-21. ## Current baseline (2025) @@ -116,7 +116,7 @@ The model does not include several announced reforms and tax policies that are e ``` Notable exclusions: -- **PIP reform announced in Autumn Statement 2023**: The government announced reforms to Personal Independence Payment assessments and eligibility criteria, phasing out 25% of claimants between 2025-29. These reforms are [defined as a scenario](https://github.com/PolicyEngine/policyengine-uk/blob/master/policyengine_uk/scenarios/pip_reform.py) but not included in the baseline model +- **PIP reform announced in Autumn Statement 2023**: The government announced reforms to Personal Independence Payment assessments and eligibility criteria, phasing out 25% of claimants between 2025-29. These reforms are [defined as a scenario](https://github.com/PolicyEngine/policyengine-uk/blob/2da212abcf2086337fc088a4a1236f4ae7b6af63/policyengine_uk/scenarios/pip_reform.py) but not included in the baseline model - **Non-domiciled taxation changes**: Remittance basis abolition and four-year exemption regime from fiscal year 2025-26 are not modelled - **Non-UK resident stamp duty surcharge**: 2% additional rate from fiscal year 2021-22 is not modelled - **Some devolved tax policies**: Beyond property transaction taxes, other devolved policies may have limited coverage diff --git a/docs/book/programs/gov/dfe/extended-childcare-entitlement.ipynb b/docs/book/programs/gov/dfe/extended-childcare-entitlement.ipynb index 8dbaaf1859..ceb9f98fdc 100644 --- a/docs/book/programs/gov/dfe/extended-childcare-entitlement.ipynb +++ b/docs/book/programs/gov/dfe/extended-childcare-entitlement.ipynb @@ -33,11 +33,11 @@ "Non-working partners may qualify if they receive: **incapacity benefit**, **severe disablement allowance**, **carer's allowance**, **limited capability for work benefit**, or **contribution-based employment and support allowance**.\n", "\n", "#### Income requirements\n", - "Minimum earnings thresholds (per **3 months**) vary by age:\n", + "Minimum earnings thresholds (per **3 months**, 2024-25 rates) vary by age:\n", "\n", "| Age group | Minimum earnings | Weekly equivalent |\n", "|-----------|-----------------|-------------------|\n", - "| **21+** | **£2,380** | **£183** |\n", + "| **21+** | **£2,379** | **£183** |\n", "| **18-20** | **£1,788** | **£137** |\n", "| **Under 18/Apprentices** | **£1,331** | **£102** |\n", "\n", @@ -104,8 +104,8 @@ "|-----------|-------------------|---------------|----------------------|-------------------|\n", "| 22 | £2,500 | False | True | True |\n", "| 19 | £1,500 | False | False | False |\n", - "| 35 | £10,000 | True | True | False |\n", - "| 18 | £1,400 | False | True | True |\n", + "| 35 | £30,000 | True | True | False |\n", + "| 18 | £1,400 | False | False | False |\n", "\n", "### 4. Overall eligibility determination\n", "Managed by [`extended_childcare_entitlement_eligible.py`](https://github.com/PolicyEngine/policyengine-uk/tree/20ed1a9d77a3307b3e2bc4a0986ec606ab7fead9/policyengine_uk/variables/gov/dfe/extended_childcare_entitlement):\n", @@ -136,12 +136,14 @@ "\n", "The annual model evaluates parameters at January and does not prorate the April or September expansions within a calendar year.\n", "\n", - "Example table (2024-25 rates, 30 hours used, no targeted hours):\n", + "Example table for 2024-25, for a child in England in a working family that uses 30 hours a week and gets no targeted hours. The model's year has three terms, beginning on 1 April 2024, 1 September 2024 and 1 January 2025. Each row gives the child's age on 6 October 2024 and the birth dates that produce its amount. Neither child starts reception before September 2025, and each reaches its age band before 1 April 2024, so each gets hours in all three terms.\n", "\n", - "| Child age | Total weekly hours | Universal weekly hours | Funding rate | Annual working parent entitlement |\n", - "|-----------|-------------------|------------------------|-------------|-------------------|\n", - "| 2 | 15 | 0 | £8.28 | £4,719.6 |\n", - "| 3 | 30 | 15 | £5.88 | £3,351.6 |" + "| Child age | Born | School | Total weekly hours | Universal weekly hours | Funding rate | Annual working parent entitlement |\n", + "|-----------|------|--------|-------------------|------------------------|-------------|-------------------|\n", + "| 2 | 1 January to 31 March 2022 | Starts reception in September 2026 | 15 | 0 | £8.28 | £4,719.60 |\n", + "| 3 | 7 October 2020 to 31 March 2021 | Starts reception in September 2025 | 30 | 15 | £5.88 | £3,351.60 |\n", + "\n", + "A child who reaches the minimum age later in the year, or who starts reception during it, gets fewer funded terms. A 2-year-old born on 1 April 2022 gets working parent hours from September only, £3,146.40. A 3-year-old born on 1 April 2021 gets universal hours from September only: its universal entitlement falls to £2,234.40, and the summer term's 30 hours all count as working parent hours at the age-2 rate, so this column rises to £5,380.80." ] } ], diff --git a/docs/book/programs/gov/dfe/universal-childcare-entitlement.ipynb b/docs/book/programs/gov/dfe/universal-childcare-entitlement.ipynb index aece155ad7..cd0d7829f8 100644 --- a/docs/book/programs/gov/dfe/universal-childcare-entitlement.ipynb +++ b/docs/book/programs/gov/dfe/universal-childcare-entitlement.ipynb @@ -71,14 +71,16 @@ " * Apply appropriate funding rate based on age\n", " * Calculate total annual value\n", "\n", - "Example table:\n", + "Example table for 2024-25, for a child in England. The model's year has three terms, beginning on 1 April 2024, 1 September 2024 and 1 January 2025. Each row gives the child's age on 6 October 2024 and the birth dates that produce its amount. The children aged 3 and 4 turned 3 before 1 April 2024 and start reception in September 2025, so they get universal hours in all three terms. A child who turns 3 later in the year, or who starts reception during it, gets fewer terms: a 3-year-old born on 1 April 2021 gets £2,234.40, and a 4-year-old born on 31 August 2020, who starts reception in September 2024, gets £1,117.20 for the summer term.\n", + "\n", + "| Child age | Born | School | Is eligible | Weekly hours | Funding rate | Number of weeks | Annual entitlement |\n", + "|-----------|------|--------|------------|--------------|--------------|-----------------|-------------------|\n", + "| 2 | 1 January to 6 October 2022 | Not yet in reception | False | 0 | £8.28 | 38 | £0 |\n", + "| 3 | 7 October 2020 to 31 March 2021 | Starts reception in September 2025 | True | 15 | £5.88 | 38 | £3,351.60 |\n", + "| 4 | 1 September to 6 October 2020 | Starts reception in September 2025 | True | 15 | £5.88 | 38 | £3,351.60 |\n", + "| 5 | 7 October 2018 to 6 October 2019 | Compulsory school age | False | 0 | £5.88 | 38 | £0 |\n", "\n", - "| Child age | Is eligible | Weekly hours | Funding rate | Number of weeks | Annual entitlement |\n", - "|-----------|------------|--------------|--------------|-----------------|-------------------|\n", - "| 2 | False | 0 | £11.22 | 38 | £0 |\n", - "| 3 | True | 15 | £5.88 | 38 | £3,351.6 |\n", - "| 4 | True | 15 | £5.88 | 38 | £3,351.6 |\n", - "| 5 | False | 0 | £5.88 | 38 | £0 |" + "A 2-year-old born from 7 October to 31 December 2021 turns 3 before 1 January 2025, so it gets universal hours in the spring term: £1,117.20." ] } ], diff --git a/docs/book/programs/gov/dwp/disability-legacy-benefits.md b/docs/book/programs/gov/dwp/disability-legacy-benefits.md index dc63b96fca..b1ee65b3f0 100644 --- a/docs/book/programs/gov/dwp/disability-legacy-benefits.md +++ b/docs/book/programs/gov/dwp/disability-legacy-benefits.md @@ -1,7 +1,7 @@ # DLA and Severe Disablement Allowance PolicyEngine UK models two **legacy** DWP disability benefits alongside -the current PIP (covered in [its own page](./PIP.ipynb)): +the current PIP (see [PIP point system](./pip-points-plan.md)): - **Disability Living Allowance (DLA)** — closed to new working-age claims in April 2013 but still paid to existing recipients and to diff --git a/docs/book/programs/gov/dwp/housing-benefit.ipynb b/docs/book/programs/gov/dwp/housing-benefit.ipynb index 90c8415910..0096ccb5de 100644 --- a/docs/book/programs/gov/dwp/housing-benefit.ipynb +++ b/docs/book/programs/gov/dwp/housing-benefit.ipynb @@ -24,11 +24,19 @@ "- **Pension age**: the claimant and any partner have reached the qualifying age for State Pension Credit (State Pension age), or the family is a mixed-age couple that keeps the pension-age route: one entitled to Pension Credit or pension-age Housing Benefit on 14 May 2019 and ever since ([SI 2019/37 art. 4](https://www.legislation.gov.uk/uksi/2019/37/article/4)), or any mixed-age couple not reported on Universal Credit before 15 May 2019 (`meets_pension_credit_age_conditions`). New Housing Benefit claims are open to them ([SI 2014/1230 reg. 6A(4) and (5)](https://www.legislation.gov.uk/uksi/2014/1230/regulation/6A)), and Universal Credit is not, so neither a previous claim nor `would_claim_uc` matters.\n", "- **Continuing award**: any other benunit was **already claiming** Housing Benefit (proxied by a positive `housing_benefit_reported`) and is **not claiming Universal Credit**. Working-age families, and mixed-age couples without the saving, cannot make new claims; they claim the Universal Credit housing element instead.\n", "\n", - "The pension-age test counts the same benunit members as Universal Credit's working-age test, and the continuing-award route requires not claiming Universal Credit, so no benunit receives both. Working-age awards outside specified or temporary accommodation ended on 1 July 2026 in Great Britain ([SI 2025/1148 art. 7](https://www.legislation.gov.uk/uksi/2025/1148/article/7)); PolicyEngine does not yet model that. Claims for specified or temporary accommodation, which remain open at any age, are not modelled.\n", + "The pension-age test counts the same benunit members as Universal Credit's working-age test, and the continuing-award route requires not claiming Universal Credit, so no benunit receives both.\n", + "\n", + "Parliament abolished Housing Benefit in Welfare Reform Act 2012 s. 33(1)(d). Under [SI 2025/1148 art. 7](https://www.legislation.gov.uk/uksi/2025/1148/article/7), the abolition takes effect on 1 July 2026 for each award that hasn't already ended under SI 2014/1230 reg. 7(2), 8(2A) or 46(1)(a) and isn't due to end after a two week run-on (art. 7(1) and (3)), with these exceptions:\n", + "\n", + "- For a claimant whom the Universal Credit Regulations 2013 reg. 19(1)(b) or (c) (prisoners and others) bar from Universal Credit immediately before 1 July 2026, the award ends on the day after the bar last applies (art. 7(2)).\n", + "- The award continues where the claimant's circumstances fall within [SI 2014/1230 reg. 6A(2) to (5)](https://www.legislation.gov.uk/uksi/2014/1230/regulation/6A): specified or temporary accommodation; a single claimant who has reached the qualifying age for State Pension Credit, or a couple or polygamous marriage in which every member has; a claim that reg. 6A(3) allows when a Universal Credit claimant reaches that age; or a mixed-age couple whose older member claims and keeps a saving under SI 2019/37 art. 4(1) (art. 7(4)(a)).\n", + "- The award continues where, immediately before 1 July 2026, the claimant has an income-related Employment and Support Allowance award that [art. 3A(2)](https://www.legislation.gov.uk/uksi/2025/1148/article/3A) saves: at that time someone acts for the claimant as an appointee under reg. 57 of the Universal Credit, Personal Independence Payment, Jobseeker's Allowance and Employment and Support Allowance (Claims and Payments) Regulations 2013, or in the six months ending on that day the Secretary of State determined that the claimant would likely need one (art. 7(4)(b)).\n", + "\n", + "PolicyEngine does not yet model the 1 July 2026 end date: no rule in the model ends a working-age family's continuing award on that date. It also doesn't model claims for specified or temporary accommodation, which reg. 6A(2) keeps open at any age.\n", "\n", "**Guarantee Credit passport.** If the claimant or partner is in receipt of a guarantee credit (`in_receipt_of_guarantee_credit`: the benunit is eligible for Pension Credit, claims it, and its guarantee credit is positive, so the Pension Credit paid includes a guarantee credit), the whole of their capital and income is disregarded ([SI 2006/214 reg. 26](https://www.legislation.gov.uk/uksi/2006/214/regulation/26); Northern Ireland: [SR 2006/406 reg. 24](https://www.legislation.gov.uk/nisr/2006/406/regulation/24)). `housing_benefit_assessable_capital`, `housing_benefit_tariff_income` and `housing_benefit_applicable_income` are then zero, so the capital limit cannot bite and no income is tapered. A guarantee credit computed for a family that does not claim Pension Credit (`would_claim_pc`), or that PolicyEngine does not treat as eligible for it (`is_pension_credit_eligible`), does not count. The passport applies within the pension-age regulations (`housing_benefit_pension_age_regulations_apply`). `is_pension_credit_eligible` retains mixed-age couples covered by the [SI 2019/37 art. 4](https://www.legislation.gov.uk/uksi/2019/37/article/4) saving through `meets_pension_credit_age_conditions`; these couples keep the passport when they receive Guarantee Credit. When Pension Credit is frozen, receipt follows the baseline award, including its Guarantee Credit component. Savings Credit alone follows the separate assessment in [reg. 27](https://www.legislation.gov.uk/uksi/2006/214/regulation/27), including its capital limit, and does not give this passport.\n", "\n", - "Take-up is handled per benefit unit by `would_claim_housing_benefit`. In data-built simulations, including the Enhanced FRS, its default is true only for families reporting positive Housing Benefit (d1455, following the CTR survey ruling d1390). In hand-entered household calculations, it is true when the family reports Housing Benefit or its `claims_all_entitled_benefits` flag is true. That flag tests seven reported benefits within the family; it does not test Pension Credit, Child Benefit or Council Tax Reduction. Dataset and situation inputs can override the take-up flag directly." + "`would_claim_housing_benefit` decides take-up for each benefit unit. In simulations built from data, including the Enhanced FRS, it defaults to true only for families that report Housing Benefit, the same rule `would_claim_council_tax_reduction` applies to Council Tax Reduction ([#1831](https://github.com/PolicyEngine/policyengine-uk/pull/1831)). In hand-entered household calculations, it is true when the family reports Housing Benefit or its `claims_all_entitled_benefits` flag is true. That flag tests seven reported benefits within the family; it does not test Pension Credit, Child Benefit or Council Tax Reduction. Dataset and situation inputs can override the take-up flag directly." ] }, { diff --git a/docs/book/programs/gov/dwp/pension-credit.ipynb b/docs/book/programs/gov/dwp/pension-credit.ipynb index 92b9625acb..f8efbeb855 100644 --- a/docs/book/programs/gov/dwp/pension-credit.ipynb +++ b/docs/book/programs/gov/dwp/pension-credit.ipynb @@ -48,6 +48,12 @@ "execution_count": 1, "id": "dbb3de6d", "metadata": { + "execution": { + "iopub.execute_input": "2026-11-02T18:34:40.770456Z", + "iopub.status.busy": "2026-11-02T18:34:40.770249Z", + "iopub.status.idle": "2026-11-02T18:34:44.892794Z", + "shell.execute_reply": "2026-11-02T18:34:44.891742Z" + }, "scrolled": true, "tags": [ "hide-input" @@ -93,38 +99,30 @@ "
\n", "0?[0]:[]);if(o.enter().append(\"g\").classed(f.containerClassName,!0).style(\"cursor\",\"pointer\"),o.exit().each((function(){n.select(this).selectAll(\"g.\"+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll(\"g.\"+f.headerGroupClassName).data(r,p);l.enter().append(\"g\").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,\"g\",f.dropdownButtonGroupClassName,(function(t){t.style(\"pointer-events\",\"all\")})),c=0;c 90&&i.log(\"Long binary search...\"),h-1},e.sorterAsc=function(t,e){return t-e},e.sorterDes=function(t,e){return e-t},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===o;r--);for(var i,a=n[r]-n[0]||1,s=a/(r||1)/1e4,l=[],u=0;u<=r;u++){var c=n[u],f=c-i;void 0===i?(l.push(c),i=c):f>s&&(a=Math.min(a,f),l.push(c),i=c)}return{vals:l,minDiff:a}},e.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},e.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;il?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var p=h(u);p;){if((u+=p+r)>f)return;p=h(u)}for(p=h(f);p;){if(u>(f-=p+r))return;p=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},81697:function(t,e,r){\"use strict\";var n=r(92770),i=r(84267),a=r(25075),o=r(21081),s=r(22399).defaultLine,l=r(73627).isArrayOrTypedArray,u=a(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=a(t);return e.length?e:u}function h(t){return n(t)?t:1}t.exports={formatColor:function(t,e,r){var n,i,s,p,d,v=t.color,g=l(v),y=l(e),m=o.extractOpts(t),x=[];if(n=void 0!==m.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:f,s=y?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||y)for(var b=0;b
/i;e.BR_TAG_ALL=/
/gi;var _=/(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i,w=/(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i,T=/(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i,k=/(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&L(n)}var M=/(^|;)\\s*color:/;e.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:[\"br\"],i=t.split(m),a=[],o=\"\",s=0,l=0;l
\"+l;e.text=u}(t,o,r,u):\"log\"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c=\"string\"==typeof o&&o.charAt(0);if(\"never\"===a&&(a=\"\"),n&&\"L\"!==c&&(o=\"L3\",c=\"L\"),u||\"L\"===c)e.text=bt(Math.pow(10,l),t,a,n);else if(i(o)||\"D\"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;\"power\"===p||mt(p)&&xt(f)?(e.text=0===f?1:1===f?\"10\":\"10\"+(f>1?\"\":P)+h+\"\",e.fontSize*=1.25):(\"e\"===p||\"E\"===p)&&h>2?e.text=\"1\"+p+(f>0?\"+\":P)+h:(e.text=bt(Math.pow(10,l),t,\"\",\"fakehover\"),\"D1\"===o&&\"y\"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if(\"D\"!==c)throw\"unrecognized dtick \"+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if(\"D1\"===t.dtick){var d=String(e.text).charAt(0);\"0\"!==d&&\"1\"!==d||(\"y\"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,v):\"category\"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=\"\"),e.text=String(r)}(t,o):\"multicategory\"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?\"\":String(i[1]),o=void 0===i[0]?\"\":String(i[0]);r?e.text=o+\" - \"+a:(e.text=a,e.text2=o)}(t,o,r):Dt(t)?function(t,e,r,n,i){if(\"radians\"!==t.thetaunit||r)e.text=bt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text=\"0\";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=bt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text=\"π\":e.text=o[0]+\"π\":e.text=[\"\",o[0],\"\",\"⁄\",\"\",o[1],\"\",\"π\"].join(\"\"),l&&(e.text=P+e.text)}}}}(t,o,r,u,v):function(t,e,r,n,i){\"never\"===i?i=\"\":\"all\"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i=\"hide\"),e.text=bt(e.x,t,i,n)}(t,o,0,u,v),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(o.text)){var g=t.labelalias[o.text];\"string\"==typeof g&&(o.text=g)}if(\"boundaries\"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+\" - \"+q.hoverLabelText(t,i,r);var a=\"log\"===t.type&&n<=0,o=q.tickText(t,t.c2l(a?-n:n),\"hover\").text;return a?0===n?\"0\":P+o:o};var yt=[\"f\",\"p\",\"n\",\"μ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\"];function mt(t){return\"SI\"===t||\"B\"===t}function xt(t){return t>14||t<-15}function bt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||\"B\",u=e._tickexponent,c=q.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:\"none\"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:\"none\"===e.showexponent?e.range.map(e.r2d):[0,t||1]};vt(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if(\"none\"===l&&(u=0),(t=Math.abs(t))
\")):x=h.textLabel;var L={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};d.appendArrayPointValue(L,w,T),t._module.eventData&&(L=w._module.eventData(L,h,w,{},T));var C={points:[L]};if(e.fullSceneLayout.hovermode){var P=[];d.loneHover({trace:w,x:(.5+.5*m[0]/m[3])*s,y:(.5-.5*m[1]/m[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:x,name:c.name,color:d.castHoverOption(w,T,\"bgcolor\")||c.color,borderColor:d.castHoverOption(w,T,\"bordercolor\"),fontFamily:d.castHoverOption(w,T,\"font.family\"),fontSize:d.castHoverOption(w,T,\"font.size\"),fontColor:d.castHoverOption(w,T,\"font.color\"),nameLength:d.castHoverOption(w,T,\"namelength\"),textAlign:d.castHoverOption(w,T,\"align\"),hovertemplate:f.castOption(w,T,\"hovertemplate\"),hovertemplateLabels:f.extendFlat({},L,k),eventData:[L]},{container:n,gd:r,inOut_bbox:P}),L.bbox=P[0]}h.distance<5&&(h.buttons||_)?r.emit(\"plotly_click\",C):r.emit(\"plotly_hover\",C),this.oldEventData=C}else d.loneUnhover(n),this.oldEventData&&r.emit(\"plotly_unhover\",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error(\"Catastrophic and unrecoverable WebGL error. Context lost.\")};requestAnimationFrame(e)};var A=[\"xaxis\",\"yaxis\",\"zaxis\"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=A[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+\"calendar\"],c=e[\"_\"+o+\"length\"];if(f.isArrayOrTypedArray(l))for(var h,p=0;p<(c||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var d=0;d
\");b.text(T).attr(\"data-unformatted\",T).call(f.convertToTspans,t),_=c.bBox(b.node())}b.attr(\"transform\",a(-3,8-_.height)),x.insert(\"rect\",\".static-attribution\").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:\"rgba(255, 255, 255, 0.75)\"});var k=1;_.width+6>w&&(k=w/(_.width+6));var A=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];x.attr(\"transform\",a(A[0],A[1])+o(k))}},e.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[p],n=0;n
\")}(e,r,n,i):v.getValue(s.text,r),v.coerceString(m,o)}(C,n,i,T,M);w=function(t,e){var r=v.getValue(t.textposition,e);return v.coerceEnumerated(x,r)}(O,i);var z=\"stack\"===g.mode||\"relative\"===g.mode,R=n[i],F=!z||R._outmost;if(D&&\"none\"!==w&&(!R.isBlank&&s!==u&&f!==p||\"auto\"!==w&&\"inside\"!==w)){var B=C.font,N=d.getBarColor(n[i],O),j=d.getInsideTextFont(O,i,B,N),U=d.getOutsideTextFont(O,i,B),V=r.datum();I?\"log\"===T.type&&V.s0<=0&&(s=T.range[0]