diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..a71cd5ed 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Fix bug affecting microsimulation runs in countries which use automatic period adjustments. diff --git a/policyengine_core/simulations/simulation.py b/policyengine_core/simulations/simulation.py index 123a1be8..d0cd74ab 100644 --- a/policyengine_core/simulations/simulation.py +++ b/policyengine_core/simulations/simulation.py @@ -474,12 +474,12 @@ def _calculate( if variable.definition_period == MONTH and period.unit == YEAR: if variable.quantity_type == QuantityType.STOCK: contained_months = period.get_subperiods(MONTH) - return self.calculate(variable_name, contained_months[-1]) + return self._calculate(variable_name, contained_months[-1]) else: return self.calculate_add(variable_name, period) elif variable.definition_period == YEAR and period.unit == MONTH: if variable.quantity_type == QuantityType.STOCK: - return self.calculate(variable_name, period.this_year) + return self._calculate(variable_name, period.this_year) else: return self.calculate_divide(variable_name, period)