policyengine-uk 2.55.2__py3-none-any.whl → 2.55.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.

@@ -85,12 +85,12 @@ class Simulation(CoreSimulation):
85
85
 
86
86
  self.branches: Dict[str, Simulation] = {}
87
87
 
88
- if scenario is not None:
89
- if scenario.parameter_changes is not None:
90
- self.apply_parameter_changes(scenario.parameter_changes)
88
+ if scenario is not None and scenario.applied_before_data_load:
91
89
  if scenario.simulation_modifier is not None:
92
90
  scenario.simulation_modifier(self)
93
91
 
92
+ if scenario.parameter_changes is not None:
93
+ self.apply_parameter_changes(scenario.parameter_changes)
94
94
  # Build simulation from appropriate source
95
95
  if situation is not None:
96
96
  self.build_from_situation(situation)
@@ -138,6 +138,12 @@ class Simulation(CoreSimulation):
138
138
 
139
139
  self.calculated_periods = []
140
140
 
141
+ if scenario is not None and not scenario.applied_before_data_load:
142
+ if scenario.simulation_modifier is not None:
143
+ scenario.simulation_modifier(self)
144
+ if scenario.parameter_changes is not None:
145
+ self.apply_parameter_changes(scenario.parameter_changes)
146
+
141
147
  def reset_calculations(self):
142
148
  for variable in self.tax_benefit_system.variables:
143
149
  if variable not in self.input_variables:
@@ -13,6 +13,8 @@ class Scenario(BaseModel):
13
13
  using the + operator.
14
14
  """
15
15
 
16
+ applied_before_data_load: bool = False
17
+
16
18
  parameter_changes: Optional[
17
19
  Dict[
18
20
  str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-uk
3
- Version: 2.55.2
3
+ Version: 2.55.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=qqOTxD9NEQnLUeXPmrr9_n_mAsG_hPaetGni6xxE1m4,21400
6
+ policyengine_uk/simulation.py,sha256=7kNg5uwucAKyJDA-3L51736r0-KqV-H5W23isT-gJwE,21750
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
@@ -706,7 +706,7 @@ policyengine_uk/utils/create_ahc_deflator.py,sha256=7GvhywFiUMSsh0syBd-A2MVBr-HU
706
706
  policyengine_uk/utils/create_triple_lock.py,sha256=-LpKwztjcDaNYd3RpnMiwxAm48RWsvw0NY9wG6gXIYw,952
707
707
  policyengine_uk/utils/dependencies.py,sha256=8Ssi99wD0MFAM6Sw6yEDZyDsny0uSf2qc5K-NKhCD6M,8213
708
708
  policyengine_uk/utils/parameters.py,sha256=OQTzTkHMdwbphCo0mV7_n_FJT0rdwIKNFTsk_lsdETE,1301
709
- policyengine_uk/utils/scenario.py,sha256=07PNZhrAi9eb4EgvtGX1wHrj6GPbwd__8AXwY2WeeW4,8297
709
+ policyengine_uk/utils/scenario.py,sha256=FdFHG10Kl3PBEccTvbh1gIOAwfVYKqRKEwkrVbZBgAs,8341
710
710
  policyengine_uk/utils/solve_private_school_attendance_factor.py,sha256=RIpxsT6OKhLlNCX5ielTRr2ZkPQOfPpg9AbP062iWh4,1555
711
711
  policyengine_uk/utils/water/README.md,sha256=sdBI-JZ-jcRoSUfwNx5wjv5Ig_nM8OPvvjSsSMs_Wh8,443
712
712
  policyengine_uk/utils/water/forecast_water_bills.py,sha256=B4vtfJuR8XfBP-KHGyhRp2Oo7X7buN-lDH6tBIXqE2U,2788
@@ -1392,7 +1392,7 @@ policyengine_uk/variables/misc/spi_imputed.py,sha256=iPVlBF_TisM0rtKvO-3-PQ2UYCe
1392
1392
  policyengine_uk/variables/misc/uc_migrated.py,sha256=zFNcUJaO8gwmbL1iY9GKgUt3G6J9yrCraqBV_5dCvlM,306
1393
1393
  policyengine_uk/variables/misc/categories/lower_middle_or_higher.py,sha256=C54tHYz2DmOyvQYCC1bF8RJwRZinhAq_e3aYC-9F5fM,157
1394
1394
  policyengine_uk/variables/misc/categories/lower_or_higher.py,sha256=81NIbLLabRr9NwjpUZDuV8IV8_mqmp5NM-CZvt55TwE,129
1395
- policyengine_uk-2.55.2.dist-info/METADATA,sha256=4X0gaQhA2RY0XTPPIh7brpPzOHI6D6ErcaaTj5PU2ZE,3995
1396
- policyengine_uk-2.55.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1397
- policyengine_uk-2.55.2.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
1398
- policyengine_uk-2.55.2.dist-info/RECORD,,
1395
+ policyengine_uk-2.55.3.dist-info/METADATA,sha256=QLN3eI9ByQbMHTvAr3I52JT57dq8gUr9ZePXdl82Lr8,3995
1396
+ policyengine_uk-2.55.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1397
+ policyengine_uk-2.55.3.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
1398
+ policyengine_uk-2.55.3.dist-info/RECORD,,