Skip to content

Commit

Permalink
Remove some useless code
Browse files Browse the repository at this point in the history
log: I had no idea what it did and why it did it, so I deleted it.
  • Loading branch information
tfiedor committed Feb 12, 2024
1 parent 5861306 commit 433379c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion perun/check/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def degradation_between_files(
pcs.get_object_directory(), target_minor_version, detected_changes
)
log.newline()
log.print_list_of_degradations(detected_changes, models_strategy)
log.print_list_of_degradations(detected_changes)
log.print_short_summary_of_degradations(detected_changes)


Expand Down
14 changes: 3 additions & 11 deletions perun/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def print_short_change_string(counts: dict[str, int]) -> None:
newline()


def _print_models_info(deg_info: DegradationInfo, model_strategy: str) -> None:
def _print_models_info(deg_info: DegradationInfo) -> None:
"""
The function prints information about both models from detection.
Expand Down Expand Up @@ -585,13 +585,7 @@ def print_models_kinds(

from_colour, to_colour = get_degradation_change_colours(deg_info.result)

if model_strategy == "best-param":
print_models_kinds(" from: ", from_colour, " -> to: ", to_colour, ["bold"])
elif model_strategy in ("best-nonparam", "best-model", "best-both"):
print_models_kinds(" base: ", "blue", " targ: ", "blue", ["bold"])
elif model_strategy in ("all-nonparam", "all-param", "all-models"):
write(" model: ", end="")
cprint(f"{deg_info.from_baseline}", colour="blue", attrs=["bold"])
print_models_kinds(" from: ", from_colour, " -> to: ", to_colour, ["bold"])

if deg_info.confidence_type != "no":
write(" (with confidence ", end="")
Expand Down Expand Up @@ -625,7 +619,6 @@ def _print_partial_intervals(

def print_list_of_degradations(
degradation_list: list[tuple[DegradationInfo, str, str]],
model_strategy: str = "best-model",
) -> None:
"""Prints list of found degradations grouped by location
Expand All @@ -635,7 +628,6 @@ def print_list_of_degradations(
{result} from {from} -> to {to}
:param list degradation_list: list of found degradations
:param str model_strategy: detection model strategy for obtains the relevant kind of models
"""
if not degradation_list:
write("no changes found")
Expand Down Expand Up @@ -676,7 +668,7 @@ def keygetter(item: tuple[DegradationInfo, str, str]) -> str:
["bold"],
)
if deg_info.result != PerformanceChange.NoChange:
_print_models_info(deg_info, model_strategy)
_print_models_info(deg_info)

# Print information about command that was executed
write(" (", end="")
Expand Down

0 comments on commit 433379c

Please sign in to comment.