Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions umpyre/python_code_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ def stats_of(
Values are 'ignore', 'print', or 'raise'
:return:

>>> df = stats_of(['urllib', 'json', 'collections'])
>>> assert set(df.index.values).issuperset(
>>> df = stats_of(['urllib', 'json', 'collections']) # doctest: +SKIP
>>> assert set(df.index.values).issuperset( # doctest: +SKIP
... {'empty_lines_ratio', 'comment_lines_ratio', 'function_lines_ratio', 'mean_lines_per_function'})
>>> stats_of(['urllib', 'json', 'collections']) #doctest: +SKIP
urllib json collections
Expand Down
6 changes: 3 additions & 3 deletions umpyre/storage/git_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class GitBranchStorage:
the main branch or requiring external artifacts.

Example:
>>> storage = GitBranchStorage(repo_path="/path/to/repo")
>>> metrics = {"lines": 100, "functions": 10}
>>> storage.store_metrics(metrics, "abc123", branch="code-metrics")
>>> storage = GitBranchStorage(repo_path="/path/to/repo") # doctest: +SKIP
>>> metrics = {"lines": 100, "functions": 10} # doctest: +SKIP
>>> storage.store_metrics(metrics, "abc123", branch="code-metrics") # doctest: +SKIP
"""

def __init__(self, repo_path: str, remote: str = "origin"):
Expand Down
28 changes: 14 additions & 14 deletions umpyre/storage/query_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def find_metrics_by_commit(history_dir: Path, commit_sha: str) -> Optional[Path]
Path to metrics file or None

Example:
>>> metrics = find_metrics_by_commit(Path("history"), "700e012")
>>> print(metrics.name)
>>> metrics = find_metrics_by_commit(Path("history"), "700e012") # doctest: +SKIP
>>> print(metrics.name) # doctest: +SKIP
2025_11_14_22_45_00__700e012__0.1.0.json
"""
short_sha = commit_sha[:7]
Expand All @@ -87,8 +87,8 @@ def find_metrics_by_version(history_dir: Path, version: str) -> list[Path]:
List of paths (sorted by timestamp, latest first)

Example:
>>> metrics = find_metrics_by_version(Path("history"), "0.1.0")
>>> for m in metrics:
>>> metrics = find_metrics_by_version(Path("history"), "0.1.0") # doctest: +SKIP
>>> for m in metrics: # doctest: +SKIP
... print(m.name)
2025_11_14_22_50_00__abc1234__0.1.0.json
2025_11_14_22_45_00__700e012__0.1.0.json
Expand All @@ -110,9 +110,9 @@ def get_latest_metric_for_version(history_dir: Path, version: str) -> Optional[P
Path to latest metrics file or None

Example:
>>> latest = get_latest_metric_for_version(Path("history"), "0.1.0")
>>> info = parse_metric_filename(latest.name)
>>> print(f"Latest 0.1.0 metrics from {info['timestamp_str']}")
>>> latest = get_latest_metric_for_version(Path("history"), "0.1.0") # doctest: +SKIP
>>> info = parse_metric_filename(latest.name) # doctest: +SKIP
>>> print(f"Latest 0.1.0 metrics from {info['timestamp_str']}") # doctest: +SKIP
"""
matches = find_metrics_by_version(history_dir, version)
return matches[0] if matches else None
Expand All @@ -129,8 +129,8 @@ def get_all_versions(history_dir: Path) -> list[str]:
Sorted list of versions (excluding 'none')

Example:
>>> versions = get_all_versions(Path("history"))
>>> print(versions)
>>> versions = get_all_versions(Path("history")) # doctest: +SKIP
>>> print(versions) # doctest: +SKIP
['0.1.0', '0.1.1', '0.2.0']
"""
versions = set()
Expand Down Expand Up @@ -164,11 +164,11 @@ def filter_by_date_range(
List of paths within date range (sorted chronologically)

Example:
>>> from datetime import datetime, timedelta
>>> end = datetime.now()
>>> start = end - timedelta(days=7)
>>> recent = filter_by_date_range(Path("history"), start, end)
>>> print(f"Found {len(recent)} metrics from last 7 days")
>>> from datetime import datetime, timedelta # doctest: +SKIP
>>> end = datetime.now() # doctest: +SKIP
>>> start = end - timedelta(days=7) # doctest: +SKIP
>>> recent = filter_by_date_range(Path("history"), start, end) # doctest: +SKIP
>>> print(f"Found {len(recent)} metrics from last 7 days") # doctest: +SKIP
"""
matches = []

Expand Down
Loading