From 87d2b8d8bfa18a950520ea07fa983f718fb0ab7d Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff <35577657+nikhilwoodruff@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:18:13 +0100 Subject: [PATCH] Private school rerun (#971) * Adjust private school factor upwards to 0.85 (from 0.77) * Versioning --- CHANGELOG.md | 7 +++++++ changelog.yaml | 5 +++++ .../private_school_vat/private_school_factor.yaml | 2 +- .../utils/solve_private_school_attendance_factor.py | 4 +++- setup.py | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d44da30e..669d953c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.0] - 2024-10-21 13:04:20 + +### Fixed + +- Adjusted private school attendance factor to 0.85. + ## [2.7.0] - 2024-10-21 10:09:01 ### Added @@ -1524,6 +1530,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[2.8.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.7.0...2.8.0 [2.7.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.6.0...2.7.0 [2.6.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.5.0...2.6.0 [2.5.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.4.0...2.5.0 diff --git a/changelog.yaml b/changelog.yaml index be3fad4ed..a75158a37 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1279,3 +1279,8 @@ added: - Automatic allocation of post-employee-incidence employee to households (consumers/capital). date: 2024-10-21 10:09:01 +- bump: minor + changes: + fixed: + - Adjusted private school attendance factor to 0.85. + date: 2024-10-21 13:04:20 diff --git a/policyengine_uk/parameters/gov/simulation/private_school_vat/private_school_factor.yaml b/policyengine_uk/parameters/gov/simulation/private_school_vat/private_school_factor.yaml index 5e7c4aea8..945362821 100644 --- a/policyengine_uk/parameters/gov/simulation/private_school_vat/private_school_factor.yaml +++ b/policyengine_uk/parameters/gov/simulation/private_school_vat/private_school_factor.yaml @@ -1,6 +1,6 @@ description: student polulation adjustment factor, tested by Vahid values: - 2010-01-01: 0.77 + 2010-01-01: 0.85 metadata: unit: /1 label: student polulation adjustment factor diff --git a/policyengine_uk/utils/solve_private_school_attendance_factor.py b/policyengine_uk/utils/solve_private_school_attendance_factor.py index 41ce3e644..8f220e3f3 100644 --- a/policyengine_uk/utils/solve_private_school_attendance_factor.py +++ b/policyengine_uk/utils/solve_private_school_attendance_factor.py @@ -1,12 +1,13 @@ from policyengine_uk import Microsimulation from policyengine_core.reforms import Reform +from tqdm import tqdm # Initialize variables to track the best private_school_factor and its result best_factor = None smallest_difference = float("inf") # Loop over values of private_school_factor from 0.7 to 0.8 in steps of 0.01 -for factor in [round(x * 0.01, 2) for x in range(70, 81)]: +for factor in tqdm([round(x * 0.01, 2) for x in range(70, 91)]): # Define the reform with the current private_school_factor value reform = Reform.from_dict( { @@ -22,6 +23,7 @@ # Run the reformed microsimulation reformed = Microsimulation(reform=reform) + reformed.get_holder("attends_private_school").delete_arrays() # Calculate the number of students attending private school in thousands private_school_attendance = ( diff --git a/setup.py b/setup.py index 63ade09df..feb4900f3 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="PolicyEngine-UK", - version="2.7.0", + version="2.8.0", author="PolicyEngine", author_email="nikhil@policyengine.org", classifiers=[