From c53827d0c6d85ed3af21d51c2e21065517c0836c Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 17 Jun 2026 18:09:47 +0100 Subject: [PATCH 1/2] Add employment_sector and sic_industry_division input variables Add Person-level input variables describing the employer sector (public/ private) and SIC 2007 industry division of a person's main job, so the model can identify public-sector workers and support industry-level analysis. Populated from FRS mjobsect/sic in policyengine-uk-data. Closes #1784 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../household/income/employment_sector.py | 21 +++++++++++++++++++ .../household/income/sic_industry_division.py | 14 +++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 policyengine_uk/variables/household/income/employment_sector.py create mode 100644 policyengine_uk/variables/household/income/sic_industry_division.py diff --git a/policyengine_uk/variables/household/income/employment_sector.py b/policyengine_uk/variables/household/income/employment_sector.py new file mode 100644 index 000000000..9531f589b --- /dev/null +++ b/policyengine_uk/variables/household/income/employment_sector.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * + + +class EmploymentSector(Enum): + NOT_EMPLOYED = "Not in paid employment" + PRIVATE = "Private sector" + PUBLIC = "Public sector" + + +class employment_sector(Variable): + value_type = Enum + entity = Person + possible_values = EmploymentSector + default_value = EmploymentSector.NOT_EMPLOYED + label = "Employer sector (public or private) of the person's main job" + documentation = ( + "Whether the person's main job is in the public or private sector. " + "Sourced from the FRS `mjobsect` field; NOT_EMPLOYED where the person " + "has no main job." + ) + definition_period = YEAR diff --git a/policyengine_uk/variables/household/income/sic_industry_division.py b/policyengine_uk/variables/household/income/sic_industry_division.py new file mode 100644 index 000000000..ec3425dde --- /dev/null +++ b/policyengine_uk/variables/household/income/sic_industry_division.py @@ -0,0 +1,14 @@ +from policyengine_uk.model_api import * + + +class sic_industry_division(Variable): + value_type = int + entity = Person + label = "Standard Industrial Classification (2007) division of the main job" + documentation = ( + "Two-digit SIC 2007 division of the person's main job (0 if unknown). " + "Sourced from the FRS `sic` field. Division 84 = 'Public administration " + "and defence; compulsory social security'." + ) + default_value = 0 + definition_period = YEAR From 7c8cb2af7e3bd477993d814e5cab6e61b72c3359 Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 17 Jun 2026 18:10:20 +0100 Subject: [PATCH 2/2] Add changelog fragment for employment sector variables (#1785) Co-Authored-By: Claude Opus 4.8 (1M context) --- changelog.d/1785.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1785.md diff --git a/changelog.d/1785.md b/changelog.d/1785.md new file mode 100644 index 000000000..5bdb0d296 --- /dev/null +++ b/changelog.d/1785.md @@ -0,0 +1 @@ +- Add `employment_sector` (public/private) and `sic_industry_division` as Person-level input variables, enabling identification of public-sector workers and industry-level analysis once populated from the FRS.