From 386cee2420628c739b98656fa9f12393a61763fe Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Thu, 5 Jun 2025 17:49:06 +0100 Subject: [PATCH] Add default input and output periods to simulation constructors Fixes #369 --- changelog_entry.yaml | 4 ++++ policyengine_core/simulations/simulation.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..090109668 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Default input and output periods to Simulation constructor. diff --git a/policyengine_core/simulations/simulation.py b/policyengine_core/simulations/simulation.py index 472ea6367..795642fc5 100644 --- a/policyengine_core/simulations/simulation.py +++ b/policyengine_core/simulations/simulation.py @@ -89,7 +89,15 @@ def __init__( dataset: Union[str, Type[Dataset]] = None, reform: Reform = None, trace: bool = False, + default_input_period: str = None, + default_calculation_period: str = None, ): + self.default_input_period = ( + default_input_period or self.default_input_period + ) + self.default_calculation_period = ( + default_calculation_period or self.default_calculation_period + ) if tax_benefit_system is None: if ( self.default_tax_benefit_system_instance is not None