From 0c13839bb917b39371ae32052600c123ba201716 Mon Sep 17 00:00:00 2001 From: Thomas Guillet Date: Mon, 5 Feb 2024 16:08:38 +0100 Subject: [PATCH] Explicit previous constraint variable name --- openfisca_core/simulations/simulation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openfisca_core/simulations/simulation.py b/openfisca_core/simulations/simulation.py index e876b48ac..2966b9b16 100644 --- a/openfisca_core/simulations/simulation.py +++ b/openfisca_core/simulations/simulation.py @@ -403,9 +403,9 @@ def _check_for_cycle(self, variable: str, period): "Circular definition detected on formula {}@{}".format(variable, period) ) - spiral = len(previous_periods) >= self.max_spiral_loops + too_many_spirals = len(previous_periods) >= self.max_spiral_loops too_backward = (previous_periods[0].date - period.date).in_months() > self.max_spiral_lookback_months if previous_periods and self.max_spiral_lookback_months > 0 else False - if spiral or too_backward: + if too_many_spirals or too_backward: self.invalidate_spiral_variables(variable) message = "Quasicircular definition detected on formula {}@{} involving {}".format( variable, period, self.tracer.stack