Skip to content

Commit

Permalink
fix: error messages for validate_for_report
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Jun 13, 2024
1 parent 06f7a2d commit 34c1883
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/csm/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ def status(self) -> None:

def validate_for_report(self, l_epoch: EpochNumber, r_epoch: EpochNumber) -> None:
if not self.is_fulfilled:
raise InvalidState()
raise InvalidState(f'State is not fulfilled. {self.unprocessed_epochs=}')

for epoch in self._processed_epochs:
if l_epoch <= epoch <= r_epoch:
continue
raise InvalidState()
raise InvalidState(f'Processed epoch {epoch} is out of range')

for epoch in sequence(l_epoch, r_epoch):
if epoch not in self._processed_epochs:
raise InvalidState()
raise InvalidState(f'Epoch {epoch} should be processed')

def validate_for_collect(self, l_epoch: EpochNumber, r_epoch: EpochNumber):

Expand Down

0 comments on commit 34c1883

Please sign in to comment.