Skip to content

Commit

Permalink
🐛 Improve validate and standardize logging wording (#84)
Browse files Browse the repository at this point in the history
* ✨ Improve standardize wording

Signed-off-by: zethson <lukas.heumos@posteo.net>

* 🎨 Improve validate logging

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
  • Loading branch information
Zethson authored Sep 2, 2024
1 parent 486bf1d commit 84dec7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lamin_utils/_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _validate_logging(result: InspectResult, field: str | None = None) -> None:
success_msg = ""
if len(result.validated) > 0:
success_msg = (
f"{colors.green(f'{len(result.validated)} term{s}')} ({result.frac_validated:.2f}%)"
f"{colors.green(f'{len(result.validated)} unique term{s}')} ({result.frac_validated:.2f}%)"
f" {are} validated{field_msg}"
)
if result.frac_validated < 100:
Expand All @@ -213,7 +213,7 @@ def _validate_logging(result: InspectResult, field: str | None = None) -> None:
if len(result.non_validated) > 20:
print_values += ", ..."
warn_msg = (
f"{colors.yellow(f'{len(result.non_validated)} term{s}')} ({(100-result.frac_validated):.2f}%)"
f"{colors.yellow(f'{len(result.non_validated)} unique term{s}')} ({(100-result.frac_validated):.2f}%)"
f" {are} not validated{field_msg}: {colors.yellow(print_values)}"
)
if len(empty_warn_msg) > 0:
Expand Down Expand Up @@ -298,7 +298,7 @@ def inspect(
print_values += ", ..."
s = "" if len(synonyms_mapper) == 1 else "s"
labels = colors.yellow(
f"{len(synonyms_mapper)} terms with {msg_casing}synonym{s}"
f"{len(synonyms_mapper)} unique terms with {msg_casing}synonym{s}"
)
info_msg = f"detected {labels}: {colors.yellow(print_values)}"
result._synonyms_mapper = synonyms_mapper
Expand Down

0 comments on commit 84dec7a

Please sign in to comment.