Skip to content

Commit

Permalink
Add safety check
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Oct 24, 2024
1 parent c765176 commit fa38af6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions policyengine_core/simulations/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,9 +1551,12 @@ def subsample(
self.build_from_dataset()

# Ensure the baseline branch has the new data.
baseline_tax_benefit_system = self.baseline.tax_benefit_system
self.branches["baseline"] = self.clone()
self.branches["tax_benefit_system"] = baseline_tax_benefit_system
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


Expand Down

0 comments on commit fa38af6

Please sign in to comment.