Skip to content

Commit

Permalink
Private school rerun (#971)
Browse files Browse the repository at this point in the history
* Adjust private school factor upwards to 0.85 (from 0.77)

* Versioning
  • Loading branch information
nikhilwoodruff authored Oct 21, 2024
1 parent f1ffe6a commit 87d2b8d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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(
{
Expand All @@ -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 = (
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="PolicyEngine-UK",
version="2.7.0",
version="2.8.0",
author="PolicyEngine",
author_email="nikhil@policyengine.org",
classifiers=[
Expand Down

0 comments on commit 87d2b8d

Please sign in to comment.