Skip to content

Commit

Permalink
fix(utils): include type in dictionary log
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Smith <cameron.ray.smith@gmail.com>
  • Loading branch information
cameronraysmith committed Sep 15, 2024
1 parent 8af8450 commit 24c3f27
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/pyrovelocity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,13 @@ def print_attributes(obj):
def pretty_log_dict(d: dict) -> str:
dict_as_string = "\n"
for key, value in d.items():
# key_colored = colored(key, "green")
key_colored = key
if isinstance(value, ArrayLike):
value_colored = f"{value.shape} {value.dtype}"
else:
value_lines = str(value).split("\n")
value_colored = "\n".join(
# colored(line, "white") for line in value_lines
line
for line in value_lines
)
dict_as_string += f"{key_colored}:\n{value_colored}\n"
value_colored = "\n".join(line for line in value_lines)
dict_as_string += f"{key_colored}:\n{type(value)}\n{value_colored}\n\n"
return dict_as_string


Expand Down

0 comments on commit 24c3f27

Please sign in to comment.