Skip to content

Commit 081be8f

Browse files
vahid-ahmadiclaudeMaxGhenis
authored
Rename labor to labour in LSR parameters (#1607)
* Rename labor to labour in LSR parameters and variables Use British English spelling throughout the labour supply response module: directory names, file names, parameter labels, descriptions, import paths, and test references. Fixes #853. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove unrelated EASY_ISSUES file * Add deprecation alias for legacy labor_supply_responses paths Mirror the two consumed paths (`income_elasticity` and `substitution_elasticity`) under the renamed `labour_supply_responses` tree back to `gov.simulation.labor_supply_responses.*`, so the legacy policyengine-app PolicyRightSidebar (which hard-codes the old paths) keeps working between this PR landing and the matching app PR rebuilding against the new path. Removes the merge-window breakage that would otherwise hit the LSR sliders. Remove this alias in a follow-up release once consumers (the app PR PolicyEngine/policyengine-app#2829) have migrated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Map legacy LSR parameter changes --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Max Ghenis <mghenis@gmail.com>
1 parent b6c36f5 commit 081be8f

21 files changed

Lines changed: 100 additions & 30 deletions

changelog.d/853.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Rename `labor` to `labour` in LSR parameter and variable paths, labels, and descriptions to use British English spelling. The two consumed paths (`gov.simulation.labor_supply_responses.income_elasticity` and `.substitution_elasticity`) remain available as deprecation aliases for one release so downstream consumers — particularly the legacy `policyengine-app` PolicyRightSidebar — keep working until they migrate.

policyengine_uk/parameters/gov/simulation/labor_supply_responses/income_elasticity.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

policyengine_uk/parameters/gov/simulation/labor_supply_responses/substitution_elasticity.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""Deprecation aliases mirroring the renamed `labour_supply_responses` parameters
2+
under the legacy `labor_supply_responses` path.
3+
4+
`policyengine-app` (legacy) hard-codes
5+
`gov.simulation.labor_supply_responses.{income_elasticity,substitution_elasticity}`
6+
in PolicyRightSidebar.jsx. Without this alias the LSR sliders break the
7+
moment a deployed app rebuilds against this version of policyengine-uk.
8+
The companion app PR (PolicyEngine/policyengine-app#2829) migrates to the
9+
new path; remove this alias once that ships.
10+
"""
11+
12+
from policyengine_core.parameters import ParameterNode
13+
14+
15+
_LEGACY_LSR_PATH = "gov.simulation.labor_supply_responses"
16+
_CANONICAL_LSR_PATH = "gov.simulation.labour_supply_responses"
17+
18+
19+
def canonicalize_lsr_parameter_path(path: str) -> str:
20+
if path == _LEGACY_LSR_PATH:
21+
return _CANONICAL_LSR_PATH
22+
if path.startswith(f"{_LEGACY_LSR_PATH}."):
23+
return path.replace(_LEGACY_LSR_PATH, _CANONICAL_LSR_PATH, 1)
24+
return path
25+
26+
27+
def add_lsr_deprecation_aliases(parameters: ParameterNode) -> ParameterNode:
28+
simulation = parameters.gov.simulation
29+
canonical = simulation.labour_supply_responses
30+
31+
legacy_node = canonical.clone()
32+
legacy_node.name = _LEGACY_LSR_PATH
33+
simulation.add_child("labor_supply_responses", legacy_node)
34+
return parameters

policyengine_uk/parameters/gov/simulation/labor_supply_responses/bounds/README.md renamed to policyengine_uk/parameters/gov/simulation/labour_supply_responses/bounds/README.md

File renamed without changes.

policyengine_uk/parameters/gov/simulation/labor_supply_responses/bounds/effective_wage_rate_change.yaml renamed to policyengine_uk/parameters/gov/simulation/labour_supply_responses/bounds/effective_wage_rate_change.yaml

File renamed without changes.

policyengine_uk/parameters/gov/simulation/labor_supply_responses/bounds/income_change.yaml renamed to policyengine_uk/parameters/gov/simulation/labour_supply_responses/bounds/income_change.yaml

File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description: Percent change in labour supply given a 1% change in disposable income. This applies only to employment income.
2+
values:
3+
2020-01-01: 0
4+
metadata:
5+
unit: /1
6+
label: Income elasticity of labour supply

policyengine_uk/parameters/gov/simulation/labor_supply_responses/obr_elasticities.yaml renamed to policyengine_uk/parameters/gov/simulation/labour_supply_responses/obr_elasticities.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: Use the OBR's progression elasticities for the labor supply responses.
1+
description: Use the OBR's progression elasticities for the labour supply responses.
22
values:
33
2000-01-01: 0
44
metadata:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description: Percent change in labour supply given a 1% change in the effective marginal wage. This applies only to employment income.
2+
values:
3+
2020-01-01: 0
4+
metadata:
5+
unit: /1
6+
label: Substitution elasticity of labour supply

0 commit comments

Comments
 (0)