Skip to content

Commit 6c5ad29

Browse files
committed
tidy larger/greater
1 parent 3f1ef20 commit 6c5ad29

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ignite/engine/engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def switch_batch(engine):
905905
raise ValueError("Argument max_iters is invalid. Please, set a correct max_iters positive value")
906906
if (self.state.max_iters is not None) and max_iters <= self.state.iteration:
907907
raise ValueError(
908-
"Argument max_iters should be larger than the current iteration "
908+
"Argument max_iters should be greater than the current iteration "
909909
f"defined in the state: {max_iters} vs {self.state.iteration}. "
910910
"Please, set engine.state.max_iters = None "
911911
"before calling engine.run() in order to restart the training from the beginning."
@@ -979,7 +979,7 @@ def _check_and_set_max_epochs(self, max_epochs: Optional[int] = None) -> None:
979979
raise ValueError("Argument max_epochs is invalid. Please, set a correct max_epochs positive value")
980980
if self.state.max_epochs is not None and max_epochs <= self.state.epoch:
981981
raise ValueError(
982-
"Argument max_epochs should be larger than the current epoch "
982+
"Argument max_epochs should be greater than the current epoch "
983983
f"defined in the state: {max_epochs} vs {self.state.epoch}. "
984984
"Please, set engine.state.max_epochs = None "
985985
"before calling engine.run() in order to restart the training from the beginning."
@@ -992,7 +992,7 @@ def _check_and_set_max_iters(self, max_iters: Optional[int] = None) -> None:
992992
raise ValueError("Argument max_iters is invalid. Please, set a correct max_iters positive value")
993993
if (self.state.max_iters is not None) and max_iters <= self.state.iteration:
994994
raise ValueError(
995-
"Argument max_iters should be larger than the current iteration "
995+
"Argument max_iters should be greater than the current iteration "
996996
f"defined in the state: {max_iters} vs {self.state.iteration}. "
997997
"Please, set engine.state.max_iters = None "
998998
"before calling engine.run() in order to restart the training from the beginning."

tests/ignite/engine/test_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def test_run_asserts(self):
536536
engine.state.epoch = 5
537537
engine.run([0, 1], max_epochs=3)
538538

539-
with pytest.raises(ValueError, match=r"Argument max_iters should be larger than"):
539+
with pytest.raises(ValueError, match=r"Argument max_iters should be greater than the current"):
540540
engine.state.max_iters = 100
541541
engine.state.iteration = 100
542542
engine.run([0, 1], max_iters=50)

tests/ignite/engine/test_engine_state_dict.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,19 @@ def _test(sd):
125125
_test({"max_epochs": 100, "epoch_length": 120, "iteration": 123})
126126
_test({"max_epochs": 100, "epoch_length": 120, "epoch": 5})
127127

128-
with pytest.raises(ValueError, match=r"Argument max_epochs should be larger than"):
128+
with pytest.raises(ValueError, match=r"Argument max_epochs should be greater than the current"):
129129
_test({"max_epochs": 10, "epoch_length": 120, "epoch": 50})
130130

131-
with pytest.raises(ValueError, match=r"Argument max_epochs should be larger than"):
131+
with pytest.raises(ValueError, match=r"Argument max_epochs should be greater than the current"):
132132
_test({"max_epochs": 10, "epoch_length": 120, "iteration": 5000})
133133

134134
_test({"max_iters": 500, "epoch_length": 120, "iteration": 123})
135135
_test({"max_iters": 500, "epoch_length": 120, "epoch": 3})
136136

137-
with pytest.raises(ValueError, match=r"Argument max_iters should be larger than"):
137+
with pytest.raises(ValueError, match=r"Argument max_iters should be greater than"):
138138
_test({"max_iters": 500, "epoch_length": 120, "epoch": 5})
139139

140-
with pytest.raises(ValueError, match=r"Argument max_iters should be larger than"):
140+
with pytest.raises(ValueError, match=r"Argument max_iters should be greater than"):
141141
_test({"max_iters": 500, "epoch_length": 120, "iteration": 501})
142142

143143

@@ -184,7 +184,7 @@ def test_load_state_dict_with_params_overriding_integration():
184184
assert state.max_epochs == new_max_epochs
185185
assert state.iteration == state_dict["epoch_length"] * new_max_epochs
186186
assert state.epoch == new_max_epochs
187-
with pytest.raises(ValueError, match=r"Argument max_epochs should be larger than the current epoch"):
187+
with pytest.raises(ValueError, match=r"Argument max_epochs should be greater than the current epoch"):
188188
engine.load_state_dict(state_dict)
189189
engine.run(data, max_epochs=3)
190190

0 commit comments

Comments
 (0)