policyengine-uk 2.49.2__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,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
  )
@@ -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.2
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
@@ -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,9 +721,9 @@ 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
726
+ policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_fixed_employer_cost_change.py,sha256=yuHFCAlc4rd2FZaay7Zs356jGXTAqc3LD_DHOvKMQqI,3680
727
727
  policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_capital_incidence.py,sha256=ZONuKFK7zwyE33D9Ymgv8iWxXPZ_I44AM-pO2TlfXZY,1615
728
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
@@ -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.2.dist-info/METADATA,sha256=zhIj6YOm4-Rxv3K_AK79smGzEriNYZDn5eMnj256DiM,3995
1390
- policyengine_uk-2.49.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1391
- policyengine_uk-2.49.2.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
1392
- policyengine_uk-2.49.2.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,,