Skip to content

Commit

Permalink
removing warning for very unlikely scenario (T_sim set by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Jul 26, 2023
1 parent ddaf185 commit dde1e88
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions HARK/simulation/monte_carlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,7 @@ def initialize_sim(self):
-------
None
"""
if not hasattr(self, "T_sim"):
raise Exception(
"To initialize simulation variables it is necessary to first "
+ "set the attribute T_sim to the largest number of observations "
+ "you plan to simulate for each agent including re-births."
)
elif self.T_sim <= 0:
if self.T_sim <= 0:
raise Exception(

Check warning on line 193 in HARK/simulation/monte_carlo.py

View check run for this annotation

Codecov / codecov/patch

HARK/simulation/monte_carlo.py#L193

Added line #L193 was not covered by tests
"T_sim represents the largest number of observations "
+ "that can be simulated for an agent, and must be a positive number."
Expand Down Expand Up @@ -437,14 +431,6 @@ def simulate(self, sim_periods=None):
"It seems that the simulation variables were not initialize before calling "
+ "simulate(). Call initialize_sim() to initialize the variables before calling simulate() again."
)

if not hasattr(self, "T_sim"):
raise Exception(
"This agent type instance must have the attribute T_sim set to a positive integer."
+ "Set T_sim to match the largest dataset you might simulate, and run this agent's"
+ "initalizeSim() method before running simulate() again."
)

if sim_periods is not None and self.T_sim < sim_periods:
raise Exception(

Check warning on line 435 in HARK/simulation/monte_carlo.py

View check run for this annotation

Codecov / codecov/patch

HARK/simulation/monte_carlo.py#L435

Added line #L435 was not covered by tests
"To simulate, sim_periods has to be larger than the maximum data set size "
Expand Down

0 comments on commit dde1e88

Please sign in to comment.