Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ jobs:
# was then not enough either: on 29 October jobs were cancelled at it
# after every test had passed, with the process still alive 11 and 18
# minutes after pytest's summary (runs 40895005971 and 40917254004).
# The runner most likely runs short of memory, because every case's
# simulation is kept to the end (#2741). 75 minutes matches the Python
# shards, which Result waits for anyway, until the cases are released.
# The runner most likely ran short of memory, because every case's
# simulation was kept to the end (#2741). 75 minutes was set to match
# the Python shards until the cases were released. #2742 released them,
# and the job has since taken about 9 minutes (8.7 to 9.3 in six pull
# request runs on 1 November).
timeout-minutes: 75
steps:
- name: Checkout repo
Expand Down Expand Up @@ -185,7 +187,13 @@ jobs:
# 59m32s and the 60-minute limit then cancelled the job during its
# Codecov upload, which took that pull request out of the queue.
# 75 minutes leaves room for a slow runner and still stops a hung shard.
timeout-minutes: 75
# It stopped leaving room on 1 November: #2765's shards took 63 to 75
# minutes on runners of varying speed (runs 41303444320, 41313872613 and
# 41326415023), and the limit cancelled shards 2/6 and 3/6, then 3/6 at
# 99% with no test failing, while the same tests took 19% longer than a
# run earlier that day. 90 minutes leaves that room again and still
# stops a hung shard.
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions changelog.d/2764.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `trading_allowance_claim_status`, a person input saying whether the input data's self-employment profit already deducts the trading allowance (claimant), deducts actual expenses above it (non-claimant), or is unknown (the default, which keeps the current treatment), so that changes to the allowance, such as the Budget 2026 raise to £3,000, reach the traders who already claim it. Add `gov.simulation.trading_allowance_claimant_expense_share`, which sets claimants' unknown expenses, by default so that a cut adds nothing to their taxable profit (a lower bound).
1 change: 1 addition & 0 deletions changelog.d/2764.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Raise the time limit of the Python test shards from 75 to 90 minutes: on 1 November shards took up to 75 minutes on slower runners and were cancelled with no test failing.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
description: >-
Actual expenses and capital allowances of people the input data mark as
trading allowance claimants (trading_allowance_claim_status), as a share of
the allowance their input profit already deducts; capital allowances
supplied for them count where larger. It sets their ordinary treatment:
what a cut below that allowance adds to their taxable profit, and what they
weigh a supplied current loss against. A value outside 0 to 1 is taken as
the nearer bound. The rules are in policyengine_uk/utils/trading_allowance.py.
# A claimant's expenses and capital allowances are below the allowance they
# claim, or they would deduct them instead, but no survey records them. With
# a share of 1, the default, they equal it, so a cut leaves a claimant's
# taxable profit as reported: the lower bound of its yield. With 0 they have
# none beyond any capital allowances supplied for them, so a claimant with
# no capital allowances and no current loss keeps claiming and a cut adds its
# full amount: the upper bound. 1 is a convention, not an estimate, kept so
# that the model books no yield it cannot support
# (PolicyEngine/policyengine-uk#2764).
values:
2005-04-01: 1
metadata:
unit: /1
period: year
label: Trading allowance claimant expenses as a share of the input allowance
reference:
- title: Income Tax (Trading and Other Income) Act 2005 s. 783AI (partial relief)
href: https://www.legislation.gov.uk/ukpga/2005/5/section/783AI
- title: Income Tax (Trading and Other Income) Act 2005 s. 783AM (election for partial relief)
href: https://www.legislation.gov.uk/ukpga/2005/5/section/783AM
Loading
Loading