Skip to content

Commit 5717b70

Browse files
Merge pull request #152 from PolicyEngine/nikhilwoodruff/issue146
Fix SSMG uprating
2 parents b401686 + 523e48d commit 5717b70

3 files changed

Lines changed: 8 additions & 2 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: patch
2+
changes:
3+
fixed:
4+
- SSMG uprating.

policyengine_uk_data/datasets/frs/frs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ def add_market_income(
573573

574574
frs["lump_sum_income"] = person.REDAMT
575575

576+
frs["student_loan_repayments"] = person.SLREPAMT * 52
577+
576578

577579
def sum_from_positive_fields(
578580
table: pd.DataFrame, fields: List[str]

policyengine_uk_data/utils/imputations/capital_gains.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def loss(blend_factor):
126126
lower = row.minimum_total_income
127127
upper = row.maximum_total_income
128128
ti_in_range = (ti >= lower) * (ti < upper)
129-
in_target_range = has_cg * ti_in_range
130-
quantiles = np.random.random(int(in_target_range.sum()))
129+
in_target_range = has_cg * ti_in_range > 0
130+
quantiles = np.random.random(int(in_target_range.values.sum()))
131131
pred_capital_gains = spline(quantiles)
132132
new_cg[in_target_range] = pred_capital_gains
133133

0 commit comments

Comments
 (0)