Skip to content

Commit

Permalink
Merge pull request #54 from PolicyEngine/53_household_example_broken
Browse files Browse the repository at this point in the history
Fix simulation to allow a dict for dataset
  • Loading branch information
nikhilwoodruff authored Dec 6, 2024
2 parents b7cbaeb + e3638dd commit eb0818e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
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.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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions policyengine/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit eb0818e

Please sign in to comment.