policyengine-uk 2.49.1__py3-none-any.whl → 2.49.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of policyengine-uk might be problematic. Click here for more details.

@@ -70,12 +70,6 @@ class Simulation(CoreSimulation):
70
70
  if reform is not None:
71
71
  scenario = Scenario.from_reform(reform)
72
72
 
73
- # Apply parametric reforms here
74
-
75
- if scenario is not None:
76
- if scenario.parameter_changes is not None:
77
- self.apply_parameter_changes(scenario.parameter_changes)
78
-
79
73
  self.branch_name = "default"
80
74
  self.invalidated_caches = set()
81
75
  self.debug: bool = False
@@ -136,6 +130,8 @@ class Simulation(CoreSimulation):
136
130
  self.baseline = self.clone()
137
131
 
138
132
  if scenario is not None:
133
+ if scenario.parameter_changes is not None:
134
+ self.apply_parameter_changes(scenario.parameter_changes)
139
135
  if scenario.simulation_modifier is not None:
140
136
  scenario.simulation_modifier(self)
141
137
 
@@ -1,33 +1,33 @@
1
1
  reforms:
2
- - name: Raise basic rate by 1pp
3
- expected_impact: 8.1
4
- parameters:
5
- gov.hmrc.income_tax.rates.uk[0].rate: 0.21
6
- - name: Raise higher rate by 1pp
7
- expected_impact: 5.0
8
- parameters:
9
- gov.hmrc.income_tax.rates.uk[1].rate: 0.42
10
- - name: Raise personal allowance by ~800GBP/year
11
- expected_impact: 0.7
12
- parameters:
13
- gov.hmrc.income_tax.allowances.personal_allowance.amount: 13000
14
- - name: Raise child benefit by 25GBP/week per additional child
15
- expected_impact: -1.3
16
- parameters:
17
- gov.hmrc.child_benefit.amount.additional: 25
18
- - name: Reduce Universal Credit taper rate to 20%
19
- expected_impact: -33.4
20
- parameters:
21
- gov.dwp.universal_credit.means_test.reduction_rate: 0.2
22
- - name: Raise Class 1 main employee NICs rate to 10%
23
- expected_impact: 12.5
24
- parameters:
25
- gov.hmrc.national_insurance.class_1.rates.employee.main: 0.1
26
- - name: Raise VAT standard rate by 2pp
27
- expected_impact: 21.1
28
- parameters:
29
- gov.hmrc.vat.standard_rate: 0.22
30
- - name: Raise additional rate by 3pp
31
- expected_impact: 5.2
32
- parameters:
33
- gov.hmrc.income_tax.rates.uk[2].rate: 0.48
2
+ - name: Raise basic rate by 1pp
3
+ expected_impact: 8.1
4
+ parameters:
5
+ gov.hmrc.income_tax.rates.uk[0].rate: 0.21
6
+ - name: Raise higher rate by 1pp
7
+ expected_impact: 5.0
8
+ parameters:
9
+ gov.hmrc.income_tax.rates.uk[1].rate: 0.42
10
+ - name: Raise personal allowance by ~800GBP/year
11
+ expected_impact: 0.7
12
+ parameters:
13
+ gov.hmrc.income_tax.allowances.personal_allowance.amount: 13000
14
+ - name: Raise child benefit by 25GBP/week per additional child
15
+ expected_impact: -1.3
16
+ parameters:
17
+ gov.hmrc.child_benefit.amount.additional: 25
18
+ - name: Reduce Universal Credit taper rate to 20%
19
+ expected_impact: -33.3
20
+ parameters:
21
+ gov.dwp.universal_credit.means_test.reduction_rate: 0.2
22
+ - name: Raise Class 1 main employee NICs rate to 10%
23
+ expected_impact: 12.5
24
+ parameters:
25
+ gov.hmrc.national_insurance.class_1.rates.employee.main: 0.1
26
+ - name: Raise VAT standard rate by 2pp
27
+ expected_impact: 21.1
28
+ parameters:
29
+ gov.hmrc.vat.standard_rate: 0.22
30
+ - name: Raise additional rate by 3pp
31
+ expected_impact: 5.2
32
+ parameters:
33
+ gov.hmrc.income_tax.rates.uk[2].rate: 0.48
@@ -1,26 +1,3 @@
1
- - name: Lone parent, two children
2
- period: 2021
3
- absolute_error_margin: 1_000 # Temporarily for now
4
- input:
5
- people:
6
- p1:
7
- age: 26
8
- income_support_reported: true
9
- working_tax_credit_reported: true
10
- child_tax_credit_reported: true
11
- c1:
12
- age: 4
13
- c2:
14
- age: 4
15
- benunits:
16
- b1:
17
- members: [p1, c1, c2]
18
- would_claim_child_benefit: true
19
- output:
20
- child_tax_credit: 6205
21
- child_benefit: 35 * 52
22
- income_support_eligible: true
23
- income_support: 81 * 52
24
1
  - name: Lone parent, two children, earnings
25
2
  period: 2021
26
3
  absolute_error_margin: 5
@@ -35,7 +35,11 @@ class baseline_employer_cost(Variable):
35
35
  )
36
36
 
37
37
  # Calculate baseline employer cost
38
- baseline_parameters = parameters(period).baseline
38
+ if person.simulation.baseline is None:
39
+ return 0
40
+ baseline_parameters = (
41
+ person.simulation.baseline.tax_benefit_system.parameters(period)
42
+ )
39
43
  baseline_class_1 = (
40
44
  baseline_parameters.gov.hmrc.national_insurance.class_1
41
45
  )
@@ -42,7 +42,11 @@ class employer_ni_fixed_employer_cost_change(Variable):
42
42
  )
43
43
 
44
44
  # Calculate baseline employer cost
45
- baseline_parameters = parameters(period).baseline
45
+ if person.simulation.baseline is None:
46
+ return 0
47
+ baseline_parameters = (
48
+ person.simulation.baseline.tax_benefit_system.parameters(period)
49
+ )
46
50
  baseline_class_1 = (
47
51
  baseline_parameters.gov.hmrc.national_insurance.class_1
48
52
  )
@@ -36,7 +36,7 @@ class employer_ni_response_capital_incidence(Variable):
36
36
  value = (
37
37
  amount_paid_by_employers
38
38
  * share_of_total_wealth
39
- * capital_incidence
39
+ * emp_ni.capital_incidence
40
40
  )
41
41
 
42
42
  if total_wealth == 0:
@@ -36,7 +36,7 @@ class employer_ni_response_consumer_incidence(Variable):
36
36
  value = (
37
37
  amount_paid_by_employers
38
38
  * share_of_total_consumption
39
- * consumer_incidence
39
+ * emp_ni.consumer_incidence
40
40
  )
41
41
 
42
42
  if total_consumption == 0:
@@ -11,7 +11,7 @@ class is_CTC_eligible(Variable):
11
11
  def formula(benunit, period, parameters):
12
12
  already_claiming = (
13
13
  add(benunit, period, ["child_tax_credit_reported"]) > 0
14
- )
14
+ ) & (~add(benunit, period, ["would_claim_uc"]) > 0)
15
15
  return (
16
16
  benunit.any(benunit.members("is_child_for_CTC", period))
17
17
  & already_claiming
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-uk
3
- Version: 2.49.1
3
+ Version: 2.49.3
4
4
  Summary: PolicyEngine tax and benefit system for the UK.
5
5
  Project-URL: Homepage, https://github.com/PolicyEngine/policyengine-uk
6
6
  Project-URL: Repository, https://github.com/PolicyEngine/policyengine-uk
@@ -3,7 +3,7 @@ policyengine_uk/entities.py,sha256=9yUbkUWQr3WydNE-gHhUudG97HGyXIZY3dkgQ6Z3t9A,1
3
3
  policyengine_uk/microsimulation.py,sha256=WskrrDrLGfDYwS1CzFk5rJkQSQlTknLkxFufStKRpxc,3379
4
4
  policyengine_uk/model_api.py,sha256=KdwJCL2HkXVxDpL6fCsCnQ9Sub6Kqp7Hyxlis3MNIx4,241
5
5
  policyengine_uk/modelled_policies.yaml,sha256=TLhvmkuI9ip-Fjq63n66RzDErCkN8K4BzY6XLxLMtFg,463
6
- policyengine_uk/simulation.py,sha256=ATrSdxxJrT8TZogmV0eVQcgB7wxaZz4NBl_ZBtMsk4E,21340
6
+ policyengine_uk/simulation.py,sha256=n8LwAjabGHQLLg6bSWiotcJzrr49wDcvzaq1eOZSbqA,21265
7
7
  policyengine_uk/system.py,sha256=Z-ax_ImUq5k4tycuThczTxQNW5iTE6ikBJIBQdKfIzU,91
8
8
  policyengine_uk/tax_benefit_system.py,sha256=CjX1lERyOm_vlgHQcQO92HZtJiwItLH-MxJveJqk6iM,5165
9
9
  policyengine_uk/data/__init__.py,sha256=J0bZ3WnvPzZ4qfVLYcwOc4lziMUMdbcMqJ3xwjoekbM,101
@@ -543,7 +543,7 @@ policyengine_uk/scenarios/uc_reform.py,sha256=WPYKGBY_V7A0pQPxDM0lOYTR9GoLrF-iEm
543
543
  policyengine_uk/tests/test_parameter_metadata.py,sha256=_2w2dSokAf5Jskye_KIL8eh80N7yIrUszlmqnZtwQws,450
544
544
  policyengine_uk/tests/code_health/test_variables.py,sha256=9Y-KpmzhyRGy9eEqocK9z91NXHX5QIF3mDMNGvegb7Q,1398
545
545
  policyengine_uk/tests/microsimulation/README.md,sha256=1toB1Z06ynlUielTrsAaeo9Vb-c3ZrB3tbbR4E1xUGk,3924
546
- policyengine_uk/tests/microsimulation/reforms_config.yaml,sha256=BO1fAwqbZjw-nt53o4TFdQjjd6Ezb3Bml5nnRLQPvSY,1086
546
+ policyengine_uk/tests/microsimulation/reforms_config.yaml,sha256=Nt3ZsTxNFGqxIVg05spuTMXz2zpcLmzHlwseOthR6Bc,1150
547
547
  policyengine_uk/tests/microsimulation/test_reform_impacts.py,sha256=xM3M2pclEhA9JIFpnuiPMy1fEBFOKcSzroRPk73FPls,2635
548
548
  policyengine_uk/tests/microsimulation/test_validity.py,sha256=_mHgrNu-hKzVd9V2GSg_yPQgJctxRzdQM7lM2bUvqNY,636
549
549
  policyengine_uk/tests/microsimulation/update_reform_impacts.py,sha256=4m5EpPu4SXTE3qOPkx3eIZnlaOzprfm6GmMCXETZuLk,6890
@@ -559,7 +559,7 @@ policyengine_uk/tests/policy/baseline/finance/benefit/care.yaml,sha256=7lnFmydBP
559
559
  policyengine_uk/tests/policy/baseline/finance/benefit/general.yaml,sha256=7Ez1HDiKr5O3ZiuUBW_VpkOxCabyxijeLMCx8Vr7x0U,920
560
560
  policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA.yaml,sha256=ha32cnW3zNcnUYQCGUj2Lg_j7GNKteJvnK6PH6am3QA,481
561
561
  policyengine_uk/tests/policy/baseline/finance/benefit/family/child_benefit.yaml,sha256=1BmGpY9lhAJctMQSBgCwOX-TeW2h1B9_hmMHVLZkURg,959
562
- policyengine_uk/tests/policy/baseline/finance/benefit/family/income_support.yaml,sha256=fzl8g4-TqG9jSyWBY-CL5_L3UeEkF5fjRWvNBSXcGfA,1142
562
+ policyengine_uk/tests/policy/baseline/finance/benefit/family/income_support.yaml,sha256=0SX-onfP3RsQ9-0AojFhZlfsVJyzqkVKyOOHCG9Cerc,603
563
563
  policyengine_uk/tests/policy/baseline/finance/benefit/family/tax_credits.yaml,sha256=4waST6yDOWwnnAw90Yv7wL_vKlKXDy9diH9dz9vACow,2474
564
564
  policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit.yaml,sha256=xz0Ew53OQdleX_CxtP24kfQykgrLY9EglPbEgt708nY,543
565
565
  policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit.yaml,sha256=C3PbDEEpsQ9lHfguTtUagPcq1tNzLkKasMeI2wCkPOQ,455
@@ -721,11 +721,11 @@ policyengine_uk/variables/contrib/policyengine/pre_budget_change_household_net_i
721
721
  policyengine_uk/variables/contrib/policyengine/pre_budget_change_household_tax.py,sha256=ug0AjfDVm_KTymDL2DKOklwVVgW-Ug416yCOrm1YPbU,1184
722
722
  policyengine_uk/variables/contrib/policyengine/pre_budget_change_ons_household_income_decile.py,sha256=JfxVO6B2WYx776lSa-Do-mXSJ5igCzmc2dDzzfQLeXA,1495
723
723
  policyengine_uk/variables/contrib/policyengine/employer_ni/adjusted_employer_cost.py,sha256=ST8qa0iZssevjJEe5c2-3XJfxC6Z6mswsmu2dcaosC8,1479
724
- policyengine_uk/variables/contrib/policyengine/employer_ni/baseline_employer_cost.py,sha256=3dvHkJubJcYkY5HspAWrS7bm81YiySbobUvwnjYF_qk,1849
724
+ policyengine_uk/variables/contrib/policyengine/employer_ni/baseline_employer_cost.py,sha256=Gi2PzfQ0CO4alFvo0Ir1vbMgv94l7vIlCucWVBW63kM,1978
725
725
  policyengine_uk/variables/contrib/policyengine/employer_ni/employer_cost.py,sha256=C71cXMlFA-cI4EUPhQj9O2faaQJgQHxcwMQl27DujCY,666
726
- policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_fixed_employer_cost_change.py,sha256=kPRn_R9oZTkkl7yg6s8XUljhuqQ0fKVxsTIYUy83PhM,3551
727
- policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_capital_incidence.py,sha256=ikb5RQs6yT5GxfEjocB-YXLjdBMfCl0WK1RVrT8N8AE,1608
728
- policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_consumer_incidence.py,sha256=6ZmZ8LTOeCBRljK8t-Cpet1x5y2iS2C_MJFx6ECer8A,1645
726
+ policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_fixed_employer_cost_change.py,sha256=yuHFCAlc4rd2FZaay7Zs356jGXTAqc3LD_DHOvKMQqI,3680
727
+ policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_capital_incidence.py,sha256=ZONuKFK7zwyE33D9Ymgv8iWxXPZ_I44AM-pO2TlfXZY,1615
728
+ policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_consumer_incidence.py,sha256=73FMwSh_sJ3rZ18WWuP85vKcjH3AHCgdcVFOcD3_U9Q,1652
729
729
  policyengine_uk/variables/contrib/ubi_center/carbon_tax.py,sha256=sHmStTjRYK85zKI0GM5yb4ALAV8M1di9gybFvOowp10,940
730
730
  policyengine_uk/variables/contrib/ubi_center/land_value_tax.py,sha256=3eOIwecbuEiwse8Zhq_g-QfPBX9bcyoczhv9Pnu7YjQ,638
731
731
  policyengine_uk/variables/contrib/ubi_center/wealth_tax.py,sha256=lFk_i2VnSBHxK8lYage3t7BlUcVgFgqmQ_aaWvacC6w,441
@@ -842,7 +842,7 @@ policyengine_uk/variables/gov/dwp/income_support_eligible.py,sha256=2slaAZ7De_9J
842
842
  policyengine_uk/variables/gov/dwp/income_support_entitlement.py,sha256=Ct-uEKrdHHKpV5y7vS1WvF8SbS_uaL_7gHovSQ8arsM,501
843
843
  policyengine_uk/variables/gov/dwp/income_support_reported.py,sha256=twdQtU8mtslfy06NnW-RzI-jiNQiTHDKsusc5z0xsow,292
844
844
  policyengine_uk/variables/gov/dwp/is_CTC_child_limit_exempt.py,sha256=_kSBwtMuTLbppTHPR_w2_3TzXUbBMWdh7Khy0xdp91s,1041
845
- policyengine_uk/variables/gov/dwp/is_CTC_eligible.py,sha256=vAbT8-DwUh5YZKVpRMbJay6jeWZvk3NrBsCTMEaH35Q,515
845
+ policyengine_uk/variables/gov/dwp/is_CTC_eligible.py,sha256=eDWw_fj_dAvE8zZ4XStvxUd06D_D9goDMqvnL1ILTvo,565
846
846
  policyengine_uk/variables/gov/dwp/is_SP_age.py,sha256=yiDWUA5FicwN4PSXVQ9CDXwONj96LFtlsGoT22kYH8s,364
847
847
  policyengine_uk/variables/gov/dwp/is_WTC_eligible.py,sha256=Oc0ZyQYK09U4PQv00HZtVhXMxh5MQGs3s4M-VjJvv_g,2020
848
848
  policyengine_uk/variables/gov/dwp/is_benefit_cap_exempt.py,sha256=JbXVGLI3bUpG525xjuamudRB3rPMBnYEeRf_gcbGrVc,733
@@ -1386,7 +1386,7 @@ policyengine_uk/variables/misc/spi_imputed.py,sha256=iPVlBF_TisM0rtKvO-3-PQ2UYCe
1386
1386
  policyengine_uk/variables/misc/uc_migrated.py,sha256=zFNcUJaO8gwmbL1iY9GKgUt3G6J9yrCraqBV_5dCvlM,306
1387
1387
  policyengine_uk/variables/misc/categories/lower_middle_or_higher.py,sha256=C54tHYz2DmOyvQYCC1bF8RJwRZinhAq_e3aYC-9F5fM,157
1388
1388
  policyengine_uk/variables/misc/categories/lower_or_higher.py,sha256=81NIbLLabRr9NwjpUZDuV8IV8_mqmp5NM-CZvt55TwE,129
1389
- policyengine_uk-2.49.1.dist-info/METADATA,sha256=aZJ3VpwE84IrSwNBWHyNqzhI8dr4gBDbNm-KaCqlkmw,3995
1390
- policyengine_uk-2.49.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1391
- policyengine_uk-2.49.1.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
1392
- policyengine_uk-2.49.1.dist-info/RECORD,,
1389
+ policyengine_uk-2.49.3.dist-info/METADATA,sha256=ic93AvTj-8TE_uyD7U4WyOD8nUgWxiHq023K2dZXvNs,3995
1390
+ policyengine_uk-2.49.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1391
+ policyengine_uk-2.49.3.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
1392
+ policyengine_uk-2.49.3.dist-info/RECORD,,