Skip to content

Commit 9f50685

Browse files
authored
Merge pull request #1326 from PolicyEngine/move-baseline-creation
Baseline simulation created before simulation modifier is applied
2 parents 041fd88 + 4b0de3c commit 9f50685

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: minor
2+
changes:
3+
fixed:
4+
- Baseline simulation created before simulation modifier is applied.

policyengine_uk/simulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ def __init__(
125125
self.move_values("capital_gains", "capital_gains_before_response")
126126
self.move_values("employment_income", "employment_income_before_lsr")
127127

128-
if scenario is not None:
129-
if scenario.simulation_modifier is not None:
130-
scenario.simulation_modifier(self)
131-
132128
if scenario is not None:
133129
self.baseline = Simulation(
134130
scenario=None,
@@ -139,6 +135,10 @@ def __init__(
139135
else:
140136
self.baseline = self.clone()
141137

138+
if scenario is not None:
139+
if scenario.simulation_modifier is not None:
140+
scenario.simulation_modifier(self)
141+
142142
self.calculated_periods = []
143143

144144
def reset_calculations(self):

0 commit comments

Comments
 (0)