Skip to content

Commit

Permalink
added docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
zilto authored and zilto committed Oct 24, 2024
1 parent f0c0bab commit 7e9e9f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hamilton/caching/stores/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


def get_directory_size(directory: str) -> float:
"""Get the size of the content of a directory in bytes."""
total_size = 0
for p in pathlib.Path(directory).rglob("*"):
if p.is_file():
Expand All @@ -11,6 +12,7 @@ def get_directory_size(directory: str) -> float:


def readable_bytes_size(n_bytes: float) -> str:
"""Convert a number of bytes to a human-readable unit."""
labels = ["B", "KB", "MB", "GB", "TB"]
exponent = 0

Expand Down

0 comments on commit 7e9e9f0

Please sign in to comment.