Skip to content

Commit

Permalink
fix step duration
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Jan 8, 2025
1 parent de7c73c commit d5e9098
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/worker/jobs/step_run_mock_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def __init__(self, run_id, realtime, timescale, external_clock, start_datetime,
StepRunBase.__init__(self, run_id, realtime, timescale, external_clock, start_datetime, end_datetime, skip_site_init=True, skip_stop_db_writes=True)
self.options.warmup_is_first_step = True
self.options.timestep_duration = timedelta(minutes=1)
self.simulation_step_duration = 1
self.run.sim_time = self.options.start_datetime

def get_sim_time(self) -> datetime.datetime:
Expand All @@ -25,9 +26,9 @@ def initialize_simulation(self):

@message
def set_simulation_step_duration(self, simulation_step_duration):
self.options.timestep_duration = timedelta(minutes=simulation_step_duration)
self.simulation_step_duration = simulation_step_duration

@message
def advance(self):
sleep(self.options.timestep_duration)
sleep(self.simulation_step_duration)
self.run.sim_time = self.run.sim_time + self.options.timestep_duration

0 comments on commit d5e9098

Please sign in to comment.