Skip to content

Commit

Permalink
Turn off calc_stable_points warning when irrelevant
Browse files Browse the repository at this point in the history
PerfForesightConsumerType.calc_stable_points was raising a warning in child models when cycles=0 and T_cycle=1, even though the method is inapplicable to them. Now they won't.
  • Loading branch information
mnwhite committed Sep 3, 2024
1 parent 1a34e73 commit 8dfa346
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1854,6 +1854,12 @@ def calc_stable_points(self):
-------
None
"""
# Child classes should not run this method
is_perf_foresight = type(self) is PerfForesightConsumerType
is_ind_shock = type(self) is IndShockConsumerType
if not (is_perf_foresight or is_ind_shock):
return

infinite_horizon = self.cycles == 0
single_period = self.T_cycle = 1
if not infinite_horizon:
Expand Down

0 comments on commit 8dfa346

Please sign in to comment.