policyengine-uk 2.54.1__py3-none-any.whl → 2.55.0__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.
- policyengine_uk/data/economic_assumptions.py +9 -2
- policyengine_uk/simulation.py +12 -8
- policyengine_uk/variables/gov/dwp/additional_state_pension.py +4 -2
- policyengine_uk/variables/gov/dwp/basic_state_pension.py +4 -2
- policyengine_uk/variables/household/post_tax_income.py +12 -0
- {policyengine_uk-2.54.1.dist-info → policyengine_uk-2.55.0.dist-info}/METADATA +1 -1
- {policyengine_uk-2.54.1.dist-info → policyengine_uk-2.55.0.dist-info}/RECORD +9 -8
- {policyengine_uk-2.54.1.dist-info → policyengine_uk-2.55.0.dist-info}/WHEEL +0 -0
- {policyengine_uk-2.54.1.dist-info → policyengine_uk-2.55.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -9,6 +9,7 @@ import logging
|
|
|
9
9
|
|
|
10
10
|
def extend_single_year_dataset(
|
|
11
11
|
dataset: UKSingleYearDataset,
|
|
12
|
+
tax_benefit_system_parameters: ParameterNode,
|
|
12
13
|
end_year: int = 2030,
|
|
13
14
|
) -> UKMultiYearDataset:
|
|
14
15
|
# Extend years and uprate
|
|
@@ -19,11 +20,15 @@ def extend_single_year_dataset(
|
|
|
19
20
|
next_year.time_period = str(year)
|
|
20
21
|
datasets.append(next_year)
|
|
21
22
|
multi_year_dataset = UKMultiYearDataset(datasets=datasets)
|
|
22
|
-
return apply_uprating(
|
|
23
|
+
return apply_uprating(
|
|
24
|
+
multi_year_dataset,
|
|
25
|
+
tax_benefit_system_parameters=tax_benefit_system_parameters,
|
|
26
|
+
)
|
|
23
27
|
|
|
24
28
|
|
|
25
29
|
def apply_uprating(
|
|
26
30
|
dataset: UKMultiYearDataset,
|
|
31
|
+
tax_benefit_system_parameters: ParameterNode = None,
|
|
27
32
|
):
|
|
28
33
|
from policyengine_uk.system import system
|
|
29
34
|
|
|
@@ -38,7 +43,9 @@ def apply_uprating(
|
|
|
38
43
|
continue # Don't uprate the first year
|
|
39
44
|
current_year = dataset.datasets[year]
|
|
40
45
|
prev_year = dataset.datasets[year - 1]
|
|
41
|
-
apply_single_year_uprating(
|
|
46
|
+
apply_single_year_uprating(
|
|
47
|
+
current_year, prev_year, tax_benefit_system_parameters
|
|
48
|
+
)
|
|
42
49
|
|
|
43
50
|
return dataset
|
|
44
51
|
|
policyengine_uk/simulation.py
CHANGED
|
@@ -84,6 +84,12 @@ class Simulation(CoreSimulation):
|
|
|
84
84
|
|
|
85
85
|
self.branches: Dict[str, Simulation] = {}
|
|
86
86
|
|
|
87
|
+
if scenario is not None:
|
|
88
|
+
if scenario.parameter_changes is not None:
|
|
89
|
+
self.apply_parameter_changes(scenario.parameter_changes)
|
|
90
|
+
if scenario.simulation_modifier is not None:
|
|
91
|
+
scenario.simulation_modifier(self)
|
|
92
|
+
|
|
87
93
|
# Build simulation from appropriate source
|
|
88
94
|
if situation is not None:
|
|
89
95
|
self.build_from_situation(situation)
|
|
@@ -129,12 +135,6 @@ class Simulation(CoreSimulation):
|
|
|
129
135
|
else:
|
|
130
136
|
self.baseline = self.clone()
|
|
131
137
|
|
|
132
|
-
if scenario is not None:
|
|
133
|
-
if scenario.parameter_changes is not None:
|
|
134
|
-
self.apply_parameter_changes(scenario.parameter_changes)
|
|
135
|
-
if scenario.simulation_modifier is not None:
|
|
136
|
-
scenario.simulation_modifier(self)
|
|
137
|
-
|
|
138
138
|
self.calculated_periods = []
|
|
139
139
|
|
|
140
140
|
def reset_calculations(self):
|
|
@@ -321,7 +321,9 @@ class Simulation(CoreSimulation):
|
|
|
321
321
|
dataset = UKSingleYearDataset.from_simulation(
|
|
322
322
|
self, fiscal_year=first_time_period
|
|
323
323
|
)
|
|
324
|
-
multi_year_dataset = extend_single_year_dataset(
|
|
324
|
+
multi_year_dataset = extend_single_year_dataset(
|
|
325
|
+
dataset, self.tax_benefit_system.parameters
|
|
326
|
+
)
|
|
325
327
|
|
|
326
328
|
self.build_from_multi_year_dataset(multi_year_dataset)
|
|
327
329
|
self.dataset = multi_year_dataset
|
|
@@ -335,7 +337,9 @@ class Simulation(CoreSimulation):
|
|
|
335
337
|
dataset: UKSingleYearDataset containing one year of data
|
|
336
338
|
"""
|
|
337
339
|
|
|
338
|
-
dataset = extend_single_year_dataset(
|
|
340
|
+
dataset = extend_single_year_dataset(
|
|
341
|
+
dataset, self.tax_benefit_system.parameters
|
|
342
|
+
)
|
|
339
343
|
self.build_from_multi_year_dataset(dataset)
|
|
340
344
|
self.dataset = dataset
|
|
341
345
|
|
|
@@ -12,8 +12,10 @@ class additional_state_pension(Variable):
|
|
|
12
12
|
simulation = person.simulation
|
|
13
13
|
if simulation.dataset is None:
|
|
14
14
|
return 0
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
try:
|
|
16
|
+
data_year = min(simulation.dataset.years)
|
|
17
|
+
except:
|
|
18
|
+
data_year = period.year
|
|
17
19
|
reported = person("state_pension_reported", data_year) / WEEKS_IN_YEAR
|
|
18
20
|
type = person("state_pension_type", data_year)
|
|
19
21
|
maximum_basic_sp = parameters(
|
|
@@ -12,8 +12,10 @@ class basic_state_pension(Variable):
|
|
|
12
12
|
simulation = person.simulation
|
|
13
13
|
if simulation.dataset is None:
|
|
14
14
|
return 0
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
try:
|
|
16
|
+
data_year = min(simulation.dataset.years)
|
|
17
|
+
except:
|
|
18
|
+
data_year = period.year
|
|
17
19
|
reported = person("state_pension_reported", data_year) / WEEKS_IN_YEAR
|
|
18
20
|
type = person("state_pension_type", period)
|
|
19
21
|
maximum_basic_sp = parameters(
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from policyengine_uk.model_api import *
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class post_tax_income(Variable):
|
|
5
|
+
label = "post-tax income"
|
|
6
|
+
documentation = "The income of a household after taxes have been deducted."
|
|
7
|
+
entity = Household
|
|
8
|
+
definition_period = YEAR
|
|
9
|
+
value_type = float
|
|
10
|
+
unit = GBP
|
|
11
|
+
adds = ["total_income"]
|
|
12
|
+
subtracts = ["income_tax", "national_insurance"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: policyengine-uk
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.55.0
|
|
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,12 +3,12 @@ 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=
|
|
6
|
+
policyengine_uk/simulation.py,sha256=0FRttWoO05aTG7qvsJ5-mALEgxDHFCVRh28kwKP0XUY,21381
|
|
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=fF3Qhm01PCx26pbG_WRKddacNzbgbuEoayV_xMETDgc,144
|
|
10
10
|
policyengine_uk/data/dataset_schema.py,sha256=781beGVnPWJhw2FzcG6he-LtmgxtwS1h6keAz7TPoXI,10036
|
|
11
|
-
policyengine_uk/data/economic_assumptions.py,sha256=
|
|
11
|
+
policyengine_uk/data/economic_assumptions.py,sha256=rb4Utj5bHQhIXfz-eSLvluvyZXECvF_cWtag_sefr0s,6464
|
|
12
12
|
policyengine_uk/data/filter_dataset.py,sha256=DtIixUMRnY-g-acXZIxaZ5217NYYVAMxVgs1Wa3rya0,1622
|
|
13
13
|
policyengine_uk/data/uprating_indices.yaml,sha256=kQtfeGWyqge4dbJhs0iF4kTMqovuegill_Zfs8orJi4,2394
|
|
14
14
|
policyengine_uk/dynamics/labour_supply.py,sha256=MQnlp2OfD2RboqBOxKoLHzVKfZjP04j6Oif1Jswp1-w,12074
|
|
@@ -800,7 +800,7 @@ policyengine_uk/variables/gov/dwp/WTC_severely_disabled_element.py,sha256=2dbYIc
|
|
|
800
800
|
policyengine_uk/variables/gov/dwp/WTC_worker_element.py,sha256=c1Lm5Ke8Gr30gXV2x-HCAwlcMO1aqy989kiZOMm5QlQ,595
|
|
801
801
|
policyengine_uk/variables/gov/dwp/aa_category.py,sha256=mY_cgi6Sq4yROsop0Pix024Go6bMWAeYbN4xT5DrN1U,1032
|
|
802
802
|
policyengine_uk/variables/gov/dwp/access_fund.py,sha256=A5qKLeuwBsvPVrNfQi9grBb-dFSX8XtnE-RB9heCnug,245
|
|
803
|
-
policyengine_uk/variables/gov/dwp/additional_state_pension.py,sha256=
|
|
803
|
+
policyengine_uk/variables/gov/dwp/additional_state_pension.py,sha256=bLhy5BOxj9CQCDAYRidzInI5WsXxQJyB4o5O_M96Ib4,939
|
|
804
804
|
policyengine_uk/variables/gov/dwp/adult_ema.py,sha256=M3VfIALFbILPhaOb6NeY3ffBg4HR-ASBuECvDRQPoVE,247
|
|
805
805
|
policyengine_uk/variables/gov/dwp/afcs.py,sha256=rReaIh1KfrsZUyKRYFElTB_eLAge6zee1Yc5DRoBT7w,228
|
|
806
806
|
policyengine_uk/variables/gov/dwp/afcs_reported.py,sha256=JueDBWlD1hhSedf8q54EdpqFDEgFdMpBwGWwrMTVDNE,293
|
|
@@ -810,7 +810,7 @@ policyengine_uk/variables/gov/dwp/attendance_allowance_reported.py,sha256=6RD4Nq
|
|
|
810
810
|
policyengine_uk/variables/gov/dwp/baseline_ctc_entitlement.py,sha256=Z6aAfyDCvaepEX6PPfTdjQPwGgFnMhP4lpQjZ8P8AkE,445
|
|
811
811
|
policyengine_uk/variables/gov/dwp/baseline_income_support_entitlement.py,sha256=TvcCQjTPbtvrbwWTUhaBPqZSiu93ys6qcoNU7S4kqRU,232
|
|
812
812
|
policyengine_uk/variables/gov/dwp/baseline_wtc_entitlement.py,sha256=0BKhLGQAPlJBR6P7Yk28XFlyrFojCsVsFkJC00FMgkc,436
|
|
813
|
-
policyengine_uk/variables/gov/dwp/basic_state_pension.py,sha256=
|
|
813
|
+
policyengine_uk/variables/gov/dwp/basic_state_pension.py,sha256=VGxBrZt4Adw3ARmaRHbRNPvLn1-ZwgSBZyUwIRWn1Wc,1107
|
|
814
814
|
policyengine_uk/variables/gov/dwp/benefit_cap.py,sha256=x6ad7zFYKX6jaNoXV8xj0Hql5O3HraXKZlFFmxYGuSU,1287
|
|
815
815
|
policyengine_uk/variables/gov/dwp/benefit_cap_reduction.py,sha256=lbRftEtfkQQOt5ojhNnRYlinnDGiqTH9XwAd2fdR7Kg,777
|
|
816
816
|
policyengine_uk/variables/gov/dwp/bsp.py,sha256=D8WzwacEe789RHAIvB5RYQ1NOq9nsoFMNhDPrvb4qM0,221
|
|
@@ -1138,6 +1138,7 @@ policyengine_uk/variables/household/cliff_evaluated.py,sha256=UfQ3GYys2L61PyAMWr
|
|
|
1138
1138
|
policyengine_uk/variables/household/cliff_gap.py,sha256=jZmKoLjJYAojwUEF4cfu4wvfaeN_tMYFhpRYdVk1_Vs,498
|
|
1139
1139
|
policyengine_uk/variables/household/is_on_cliff.py,sha256=MmRHX9pxnzUKGgPw2F_5dSlLv8NjSQOvcH9Z4r6-MQM,392
|
|
1140
1140
|
policyengine_uk/variables/household/marginal_tax_rate.py,sha256=hK41cSc9i4QAnGBLqUViwTiw3BsQPtfsO3jjvRfjhPE,2001
|
|
1141
|
+
policyengine_uk/variables/household/post_tax_income.py,sha256=YP4fL_hHdOK1LXQ9huqfPiCewfQWd0RKpwJgRRLKweY,356
|
|
1141
1142
|
policyengine_uk/variables/household/region.py,sha256=swhjOMUg_crfDi4oEcJY7GoaiNQXfMsyDnJPAmMjp5U,456
|
|
1142
1143
|
policyengine_uk/variables/household/benefits/employment_benefits.py,sha256=Q3vdJv6MOTv4pIQkyOYhrfyztKV7t6kEAqIYssUNZw8,262
|
|
1143
1144
|
policyengine_uk/variables/household/consumption/additional_residential_property_purchased.py,sha256=lUd5VjLB2jysui8RuLEJCC4C4Yx0zDXlpybLUEUHuiU,742
|
|
@@ -1391,7 +1392,7 @@ policyengine_uk/variables/misc/spi_imputed.py,sha256=iPVlBF_TisM0rtKvO-3-PQ2UYCe
|
|
|
1391
1392
|
policyengine_uk/variables/misc/uc_migrated.py,sha256=zFNcUJaO8gwmbL1iY9GKgUt3G6J9yrCraqBV_5dCvlM,306
|
|
1392
1393
|
policyengine_uk/variables/misc/categories/lower_middle_or_higher.py,sha256=C54tHYz2DmOyvQYCC1bF8RJwRZinhAq_e3aYC-9F5fM,157
|
|
1393
1394
|
policyengine_uk/variables/misc/categories/lower_or_higher.py,sha256=81NIbLLabRr9NwjpUZDuV8IV8_mqmp5NM-CZvt55TwE,129
|
|
1394
|
-
policyengine_uk-2.
|
|
1395
|
-
policyengine_uk-2.
|
|
1396
|
-
policyengine_uk-2.
|
|
1397
|
-
policyengine_uk-2.
|
|
1395
|
+
policyengine_uk-2.55.0.dist-info/METADATA,sha256=oTS2B2A-JFdq2FI4T73OVT4wmzA3u1OIvLv1_NyUla0,3995
|
|
1396
|
+
policyengine_uk-2.55.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
1397
|
+
policyengine_uk-2.55.0.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
|
|
1398
|
+
policyengine_uk-2.55.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|