diff --git a/CHANGELOG.md b/CHANGELOG.md index 582e1f7f..dda5a5fe 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). +## [3.11.0] - 2024-10-24 11:04:12 + +### Fixed + +- Bug causing subsample to not work in some situations. + ## [3.10.0] - 2024-10-17 15:59:10 ### Added @@ -882,6 +888,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[3.11.0]: https://github.com/PolicyEngine/policyengine-core/compare/3.10.0...3.11.0 [3.10.0]: https://github.com/PolicyEngine/policyengine-core/compare/3.9.0...3.10.0 [3.9.0]: https://github.com/PolicyEngine/policyengine-core/compare/3.8.2...3.9.0 [3.8.2]: https://github.com/PolicyEngine/policyengine-core/compare/3.8.1...3.8.2 diff --git a/changelog.yaml b/changelog.yaml index 2307c4e6..93956630 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -711,3 +711,8 @@ - Shallow copy GroupEntities and PopulationEntity when cloning TaxBenefitSystem object date: 2024-10-17 15:59:10 +- bump: minor + changes: + fixed: + - Bug causing subsample to not work in some situations. + date: 2024-10-24 11:04:12 diff --git a/policyengine_core/simulations/simulation.py b/policyengine_core/simulations/simulation.py index 482c90e4..a18312c2 100644 --- a/policyengine_core/simulations/simulation.py +++ b/policyengine_core/simulations/simulation.py @@ -1549,6 +1549,14 @@ def subsample( # Update the dataset and rebuild the simulation self.dataset = Dataset.from_dataframe(df, self.dataset.time_period) self.build_from_dataset() + + # Ensure the baseline branch has the new data. + if "baseline" in self.branches: + baseline_tax_benefit_system = self.branches[ + "baseline" + ].tax_benefit_system + self.branches["baseline"] = self.clone() + self.branches["tax_benefit_system"] = baseline_tax_benefit_system return self diff --git a/setup.py b/setup.py index ed780641..dc58e7c2 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ setup( name="policyengine-core", - version="3.10.0", + version="3.11.0", author="PolicyEngine", author_email="hello@policyengine.org", classifiers=[