From d96b2db8ab32ce7f138d3e4a254a6ce81ae7ae13 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Thu, 5 Dec 2024 21:44:56 +0000 Subject: [PATCH 1/2] Fix simulation to allow a dict for dataset fixes 53 in the example from index.ipnyb we use dataset as a dict for household cacluations. In the code we were failing to correctly handle this case. This happening, in part, because the type hint was wrong, but since most of the type hints are wrong I'm fixing the bug first and will come back to address the type hints. --- changelog_entry.yaml | 4 ++++ policyengine/simulation.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29..997608d 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Household simulation example broken due to a type error. diff --git a/policyengine/simulation.py b/policyengine/simulation.py index cadca3a..921a966 100644 --- a/policyengine/simulation.py +++ b/policyengine/simulation.py @@ -91,6 +91,10 @@ def __init__( self._initialise_simulations() def _set_dataset(self, dataset: str): + if isinstance(dataset, dict): + self.data = dataset + return + if dataset in DATASETS[self.country]: self.data = DATASETS[self.country][dataset] elif dataset is None: From e3638dd075083c3a044baebdc2bc0840bdddc368 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Fri, 6 Dec 2024 14:02:55 +0000 Subject: [PATCH 2/2] Run make changelog manually --- CHANGELOG.md | 7 +++++++ changelog.yaml | 5 +++++ changelog_entry.yaml | 4 ---- pyproject.toml | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e83314e..9c039e8 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.2.2] - 2024-12-06 14:02:41 + +### Fixed + +- Household simulation example broken due to a type error. + ## [2.2.1] - 2024-12-03 13:16:27 ### Fixed @@ -45,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[2.2.2]: https://github.com/PolicyEngine/policyengine.py/compare/2.2.1...2.2.2 [2.2.1]: https://github.com/PolicyEngine/policyengine.py/compare/2.2.0...2.2.1 [2.2.0]: https://github.com/PolicyEngine/policyengine.py/compare/2.1.0...2.2.0 [2.1.0]: https://github.com/PolicyEngine/policyengine.py/compare/2.0.0...2.1.0 diff --git a/changelog.yaml b/changelog.yaml index 917d302..ffa7e4c 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -31,3 +31,8 @@ fixed: - Formatting in constituency charts. date: 2024-12-03 13:16:27 +- bump: patch + changes: + fixed: + - Household simulation example broken due to a type error. + date: 2024-12-06 14:02:41 diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 997608d..e69de29 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +0,0 @@ -- bump: patch - changes: - fixed: - - Household simulation example broken due to a type error. diff --git a/pyproject.toml b/pyproject.toml index 2c187d9..53b07ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "policyengine" -version = "2.2.1" +version = "2.2.2" description = "A package to conduct policy analysis using PolicyEngine tax-benefit models." readme = "README.md" authors = [