Skip to content

Commit

Permalink
ckp: fix flake8 assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
speglich committed Apr 18, 2022
1 parent ac9e40a commit 90c0b7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pyrevolve/pyrevolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def op_capo(self):

@property
def next_op_capo(self):
_op_capo = (self.scheduler.capo +1) * self.block_size
_op_capo = (self.scheduler.capo + 1) * self.block_size
return _op_capo if _op_capo < self.op_timesteps else self.op_timesteps

def apply_forward(self):
Expand Down Expand Up @@ -455,7 +455,8 @@ def reload_scheduler(self, uf=1, ub=1, up=1):
self.up = up
self.arch = Architecture(self.storage_list)
self.scheduler = HRevolve(
self.n_checkpoints, self.cp_timesteps, self.arch, self.uf, self.ub, self.up
self.n_checkpoints, self.cp_timesteps, self.arch, self.uf, self.ub,
self.up
)
else:
raise ValueError(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_multilevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_forward_nt(nt, mwd, mrd, dwd, drd, uf, ub, singlefile, block_size):
)
st_list = [npStorage, dkStorage]
rev = MultiLevelRevolver(cp, f, b, nt, storage_list=st_list, uf=uf, ub=ub,
block_size=block_size)
block_size=block_size)
assert f.counter == 0
rev.apply_forward()
assert f.counter == nt
Expand Down Expand Up @@ -60,7 +60,7 @@ def test_reverse_nt(nt, mwd, mrd, dwd, drd, uf, ub, singlefile, block_size):
)
st_list = [npStorage, dkStorage]
rev = MultiLevelRevolver(cp, f, b, nt, storage_list=st_list, uf=uf, ub=ub,
block_size=block_size)
block_size=block_size)

rev.apply_forward()
assert f.counter == nt
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_num_loads_and_saves(nt, mwd, mrd, dwd, drd, uf, ub, singlefile, block_s
)
st_list = [npStorage, dkStorage]
rev = MultiLevelRevolver(cp, f, b, nt, storage_list=st_list, uf=uf, ub=ub,
block_size=block_size)
block_size=block_size)

rev.apply_forward()
assert cp.load_counter == 0
Expand Down

0 comments on commit 90c0b7f

Please sign in to comment.