Skip to content

Commit aa604c0

Browse files
committed
fix to inconsistency
1 parent a977789 commit aa604c0

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

zephyr_ml/core.py

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -221,32 +221,38 @@ def try_perform_inconsistent_producer_step( # add using stale and overwriting
221221
prev_step = next_step - 1
222222
prev_set_method = self.or_join(self.ordered_steps[prev_step][1])
223223
prev_key_method = self.or_join(self.ordered_steps[prev_step][0])
224-
LOGGER.warning(f"""[GUIDE] INCONSISTENCY WARNING:Unable\
225-
to perform {name} because you are performing a key method at
226-
step {next_step} but the result of the previous step,
227-
step {prev_step}, is STALE.
228-
If you already have the data for step {next_step},
229-
you can use the corresponding set method: {corr_set_method}.
230-
Otherwise, please perform step {prev_step} with
231-
{prev_key_method} or {prev_set_method}.""")
224+
LOGGER.warning(f"[GUIDE] INCONSISTENCY WARNING:\n"
225+
f"\tUnable to perform {name} because you are performing a key method at"
226+
f"step {next_step} but the result of the previous step,"
227+
f"step {prev_step}, is stale.\n"
228+
f"\tIf you want to use the stale result or"
229+
f"already have the data for step {next_step}, you can use the"
230+
f"corresponding set method: {prev_set_method}.\n"
231+
f"\tIf you already have the data for THIS step, you can call"
232+
f"{corr_set_method} to set the data.\n"
233+
f"\tOtherwise, you can regenerate the data of the"
234+
f"previous step by calling {prev_key_method},"
235+
f"and then recall this method.")
232236
elif (next_step < self.current_step and
233237
self.iterations[next_step - 1] != self.cur_iteration):
234238
prev_step = next_step - 1
235239
prev_key_method = self.or_join(self.ordered_steps[prev_step][0])
236240
corr_set_method = self.or_join(self.ordered_steps[next_step][1])
237-
prev_get_method = self.or_join(self.ordered_steps[prev_step][2])
238241
prev_set_method = self.or_join(self.ordered_steps[prev_step][1])
239-
LOGGER.warning(f"""[GUIDE] INCONSISTENCY WARNING: Unable to perform {name}
240-
because you are going backwards and starting a new iteration by
241-
performing a key method at step {next_step} but the result of the
242-
previous step, step {prev_step}, is STALE.
243-
If you want to use the STALE result of the PREVIOUS step,
244-
you can call {prev_get_method} to get the data, then
245-
{prev_set_method} to set the data, and then recall this method.
246-
If you want to regenerate the data of the PREVIOUS step,
247-
please call {prev_key_method}, and then recall this method.
248-
If you already have the data for THIS step, you can call
249-
{corr_set_method} to set the data.""")
242+
LOGGER.warning(f"[GUIDE] INCONSISTENCY WARNING:\n"
243+
f"\tUnable to perform {name} because"
244+
f"you are going backwards and starting a new iteration by"
245+
f"performing a key method at step {next_step} but the result of the"
246+
f"previous step, step {prev_step}, is STALE.\n"
247+
f"\tIf you want to use the STALE result or"
248+
f"already have the data for step {next_step}, you can use the"
249+
f"corresponding set method: {prev_set_method}.\n"
250+
f"\tIf you already have the data for THIS step, you can call"
251+
f"{corr_set_method} to set the data.\n"
252+
f"\tOtherwise, you can regenerate the data of the"
253+
f"previous step by calling {prev_key_method},"
254+
f"and then recall this method."
255+
)
250256

251257
def try_perform_getter_step(
252258
self, zephyr, method, *method_args, **method_kwargs):

0 commit comments

Comments
 (0)