Skip to content

Commit

Permalink
Explicit previous constraint variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
guillett committed Feb 5, 2024
1 parent 335fdd5 commit 50b450a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openfisca_core/simulations/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 50b450a

Please sign in to comment.