Skip to content

Commit 96bc99a

Browse files
committed
starting fixing mock step job
1 parent 7c4e45d commit 96bc99a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/worker/jobs/step_run_mock_job.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,21 @@ def __init__(self, run_id, realtime, timescale, external_clock, start_datetime,
1313
super().__init__()
1414
self.checkout_run(run_id)
1515
StepRunBase.__init__(self, run_id, realtime, timescale, external_clock, start_datetime, end_datetime, skip_site_init=True, skip_stop_db_writes=True)
16-
self.first_step_warmup = True
17-
self.simulation_step_duration = 1
18-
self.run.sim_time = self.start_datetime
16+
self.options.warmup_is_first_step = True
17+
self.options.timestep_duration = timedelta(minutes=1)
18+
self.run.sim_time = self.options.start_datetime
1919

2020
def step(self):
2121
sleep(self.simulation_step_duration)
2222
self.set_run_time(self.run.sim_time + self.time_per_step())
2323

24-
def time_per_step(self) -> timedelta:
25-
return timedelta(seconds=60)
26-
2724
def get_sim_time(self) -> datetime.datetime:
2825
return self.run.sim_time
2926

3027
@message
3128
def set_simulation_step_duration(self, simulation_step_duration):
32-
self.simulation_step_duration = simulation_step_duration
29+
self.options.timestep_duration = timedelta(minutes=simulation_step_duration)
30+
31+
@message
32+
def advance(self):
33+
self.run.sim_time = self.run.sim_time + 1

0 commit comments

Comments
 (0)